예제 #1
0
파일: Hooks.cs 프로젝트: gnerex2/Pluton
        // chat.say()
        public static void Chat(ConsoleSystem.Arg arg)
        {
            if (arg.ArgsStr.StartsWith("\"/"))
            {
                Command(arg);
                return;
            }

            if (!chat.enabled)
            {
                arg.ReplyWith("Chat is disabled.");
            }
            else
            {
                if (arg.ArgsStr == "\"\"")
                {
                    return;
                }

                BasePlayer basePlayer = ArgExtension.Player(arg);
                if (!(bool)((UnityEngine.Object)basePlayer))
                {
                    return;
                }

                Chat pChat = new Chat(new Player(basePlayer), arg);

                string str = arg.GetString(0, "text");

                if (str.Length > 128)
                {
                    str = str.Substring(0, 128);
                }

                if (chat.serverlog)
                {
                    Debug.Log((object)(basePlayer.displayName + ": " + str));
                }

                OnChat.OnNext(pChat);

                if (pChat.FinalText != "")
                {
                    ConsoleSystem.Broadcast("chat.add " + StringExtensions.QuoteSafe(pChat.BroadcastName) + " " + StringExtensions.QuoteSafe(pChat.FinalText));
                    arg.ReplyWith(pChat.ReplyWith);
                }

                Logger.ChatLog(pChat.BroadcastName, pChat.FinalText);
            }
        }
예제 #2
0
 public void BroadcastFrom(string name, string arg)
 {
     ConsoleSystem.Broadcast("chat.add " + StringExtensions.QuoteSafe(name) + " " + StringExtensions.QuoteSafe(arg));
 }
예제 #3
0
파일: Player.cs 프로젝트: mcjefix/Pluton
 public void MessageFrom(string from, string msg)
 {
     basePlayer.SendConsoleCommand("chat.add " + StringExtensions.QuoteSafe(from) + " " + StringExtensions.QuoteSafe(msg));
 }
예제 #4
0
 public void Broadcast(string arg)
 {
     ConsoleSystem.Broadcast("chat.add " + StringExtensions.QuoteSafe(server_message_name) + " " + StringExtensions.QuoteSafe(arg));
 }
예제 #5
0
파일: Player.cs 프로젝트: mcjefix/Pluton
 public void Message(string msg)
 {
     basePlayer.SendConsoleCommand("chat.add " + StringExtensions.QuoteSafe(Server.server_message_name) + " " + StringExtensions.QuoteSafe(msg));
 }