示例#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));
 }