コード例 #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));
 }