예제 #1
0
        // Token: 0x060027C7 RID: 10183 RVA: 0x000F0C2C File Offset: 0x000EF02C
        public static void list(CSteamID steamID, EChatMode mode, Color color, bool isRich, string text)
        {
            text = text.Trim();
            if (OptionsSettings.filter)
            {
                text = ChatManager.filter(text);
            }
            if (OptionsSettings.streamer)
            {
                color = Color.white;
            }
            SteamPlayer steamPlayer = null;
            string      text2;

            if (steamID == CSteamID.Nil)
            {
                text2 = Provider.localization.format("Say");
            }
            else
            {
                steamPlayer = PlayerTool.getSteamPlayer(steamID);
                if (steamPlayer == null)
                {
                    return;
                }
                if (!OptionsSettings.chatText && steamPlayer.playerID.steamID != Provider.client)
                {
                    return;
                }
                if (steamPlayer.player.quests.isMemberOfSameGroupAs(Player.player))
                {
                    if (steamPlayer.playerID.nickName != string.Empty && steamPlayer.playerID.steamID != Provider.client)
                    {
                        text2 = steamPlayer.playerID.nickName;
                    }
                    else
                    {
                        text2 = steamPlayer.playerID.characterName;
                    }
                }
                else
                {
                    text2 = steamPlayer.playerID.characterName;
                }
            }
            for (int i = ChatManager.chat.Length - 1; i > 0; i--)
            {
                if (ChatManager.chat[i - 1] != null)
                {
                    if (ChatManager.chat[i] == null)
                    {
                        ChatManager.chat[i] = new Chat(ChatManager.chat[i - 1].player, ChatManager.chat[i - 1].mode, ChatManager.chat[i - 1].color, ChatManager.chat[i - 1].isRich, ChatManager.chat[i - 1].speaker, ChatManager.chat[i - 1].text);
                    }
                    else
                    {
                        ChatManager.chat[i].player  = ChatManager.chat[i - 1].player;
                        ChatManager.chat[i].mode    = ChatManager.chat[i - 1].mode;
                        ChatManager.chat[i].color   = ChatManager.chat[i - 1].color;
                        ChatManager.chat[i].isRich  = ChatManager.chat[i - 1].isRich;
                        ChatManager.chat[i].speaker = ChatManager.chat[i - 1].speaker;
                        ChatManager.chat[i].text    = ChatManager.chat[i - 1].text;
                    }
                }
            }
            if (ChatManager.chat[0] == null)
            {
                ChatManager.chat[0] = new Chat(steamPlayer, mode, color, isRich, text2, text);
            }
            else
            {
                ChatManager.chat[0].player  = steamPlayer;
                ChatManager.chat[0].mode    = mode;
                ChatManager.chat[0].color   = color;
                ChatManager.chat[0].isRich  = isRich;
                ChatManager.chat[0].speaker = text2;
                ChatManager.chat[0].text    = text;
            }
            if (ChatManager.onListed != null)
            {
                ChatManager.onListed();
            }
        }
예제 #2
0
 public static void terminalChat([TerminalCommandParameter("message", "text to send")] string message)
 {
     ChatManager.sendChat(EChatMode.GLOBAL, message);
 }
예제 #3
0
 // Token: 0x060027D5 RID: 10197 RVA: 0x000F17DA File Offset: 0x000EFBDA
 public static void say(CSteamID target, string text, Color color, bool isRich = false)
 {
     ChatManager.say(target, text, color, EChatMode.WELCOME, isRich);
 }
예제 #4
0
 private static void onClickedSpySlayButton(SleekButton button)
 {
     ChatManager.sendChat(EChatMode.GLOBAL, "/slay " + PlayerPauseUI.spySteamID + "/Screenshot Evidence");
 }
예제 #5
0
 public void askChat(CSteamID steamID, byte mode, string text)
 {
     if (Provider.isServer)
     {
         SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(steamID);
         if (steamPlayer == null || steamPlayer.player == null)
         {
             return;
         }
         if (Time.realtimeSinceStartup - steamPlayer.lastChat < ChatManager.chatrate)
         {
             return;
         }
         steamPlayer.lastChat = Time.realtimeSinceStartup;
         if (!steamPlayer.player.tryToPerformRateLimitedAction())
         {
             return;
         }
         if (text.Length < 2)
         {
             return;
         }
         if (text.Length > ChatManager.LENGTH)
         {
             text = text.Substring(0, ChatManager.LENGTH);
         }
         text = text.Trim();
         if (mode == 0)
         {
             if (CommandWindow.shouldLogChat)
             {
                 CommandWindow.Log(Provider.localization.format("Global", new object[]
                 {
                     steamPlayer.playerID.characterName,
                     steamPlayer.playerID.playerName,
                     text
                 }));
             }
         }
         else if (mode == 1)
         {
             if (CommandWindow.shouldLogChat)
             {
                 CommandWindow.Log(Provider.localization.format("Local", new object[]
                 {
                     steamPlayer.playerID.characterName,
                     steamPlayer.playerID.playerName,
                     text
                 }));
             }
         }
         else
         {
             if (mode != 2)
             {
                 return;
             }
             if (CommandWindow.shouldLogChat)
             {
                 CommandWindow.Log(Provider.localization.format("Group", new object[]
                 {
                     steamPlayer.playerID.characterName,
                     steamPlayer.playerID.playerName,
                     text
                 }));
             }
         }
         Color color = Color.white;
         if (steamPlayer.isAdmin && !Provider.hideAdmins)
         {
             color = Palette.ADMIN;
         }
         else if (steamPlayer.isPro)
         {
             color = Palette.PRO;
         }
         bool flag  = false;
         bool flag2 = true;
         if (ChatManager.onChatted != null)
         {
             ChatManager.onChatted(steamPlayer, (EChatMode)mode, ref color, ref flag, text, ref flag2);
         }
         if (ChatManager.process(steamPlayer, text) && flag2)
         {
             if (mode == 0)
             {
                 base.channel.send("tellChat", ESteamCall.OTHERS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
                 {
                     steamID,
                     mode,
                     color,
                     flag,
                     text
                 });
             }
             else if (mode == 1)
             {
                 base.channel.send("tellChat", ESteamCall.OTHERS, steamPlayer.player.transform.position, EffectManager.MEDIUM, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
                 {
                     steamID,
                     mode,
                     color,
                     flag,
                     text
                 });
             }
             else if (mode == 2 && steamPlayer.player.quests.groupID != CSteamID.Nil)
             {
                 for (int i = 0; i < Provider.clients.Count; i++)
                 {
                     SteamPlayer steamPlayer2 = Provider.clients[i];
                     if (steamPlayer2.player != null && steamPlayer.player.quests.isMemberOfSameGroupAs(steamPlayer2.player))
                     {
                         base.channel.send("tellChat", steamPlayer2.playerID.steamID, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
                         {
                             steamID,
                             mode,
                             color,
                             flag,
                             text
                         });
                     }
                 }
             }
         }
     }
 }
예제 #6
0
 private static void onClickedSpyRefreshButton(SleekButton button)
 {
     ChatManager.sendChat(EChatMode.GLOBAL, "/spy " + PlayerPauseUI.spySteamID);
 }
예제 #7
0
 private void onClickedSpyButton(SleekButton button)
 {
     ChatManager.sendChat(EChatMode.GLOBAL, "/spy " + this.player.playerID.steamID);
 }
예제 #8
0
 public static void say(CSteamID target, string text, Color color)
 {
     ChatManager.say(target, text, color, EChatMode.WELCOME);
 }
예제 #9
0
 /// <summary>
 /// Sends a private message to a player
 /// </summary>
 /// <param name="user">The steamID of the player to send to</param>
 /// <param name="text">The message text to send</param>
 /// <param name="color">The message color to send</param>
 /// <param name="mode">The message mode</param>
 public static void Tell(CSteamID user, string text, Color color, EChatMode mode = EChatMode.SAY) => CM.say(user, text, color, mode);
예제 #10
0
 /// <summary>
 /// Broadcasts a message to all the players
 /// </summary>
 /// <param name="text">The text to broadcast</param>
 /// <param name="color">The color of the broadcast</param>
 public static void Broadcast(string text, Color color) => CM.say(text, color);