// Token: 0x060027D9 RID: 10201 RVA: 0x000F195C File Offset: 0x000EFD5C
 private void onServerConnected(CSteamID steamID)
 {
     if (Provider.isServer && ChatManager.welcomeText != string.Empty)
     {
         SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(steamID);
         ChatManager.say(steamPlayer.playerID.steamID, string.Format(ChatManager.welcomeText, steamPlayer.playerID.characterName), ChatManager.welcomeColor, false);
     }
 }
Exemple #2
0
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (parameter == string.Empty)
     {
         if (!Dedicator.isDedicated)
         {
             return;
         }
         CommandWindow.Log(this.localization.format("HelpText"));
         string text = string.Empty;
         for (int i = 0; i < Commander.commands.Count; i++)
         {
             text += Commander.commands[i].info;
             if (i < Commander.commands.Count - 1)
             {
                 text += "\n";
             }
         }
         CommandWindow.Log(text);
     }
     else
     {
         for (int j = 0; j < Commander.commands.Count; j++)
         {
             if (parameter.ToLower() == Commander.commands[j].command.ToLower())
             {
                 if (executorID == CSteamID.Nil)
                 {
                     CommandWindow.Log(Commander.commands[j].info);
                     CommandWindow.Log(Commander.commands[j].help);
                 }
                 else
                 {
                     ChatManager.say(executorID, Commander.commands[j].info, Palette.SERVER, EChatMode.SAY);
                     ChatManager.say(executorID, Commander.commands[j].help, Palette.SERVER, EChatMode.SAY);
                 }
                 return;
             }
         }
         if (executorID == CSteamID.Nil)
         {
             CommandWindow.Log(this.localization.format("NoCommandErrorText", new object[]
             {
                 parameter
             }));
         }
         else
         {
             ChatManager.say(executorID, this.localization.format("NoCommandErrorText", new object[]
             {
                 parameter
             }), Palette.SERVER, EChatMode.SAY);
         }
     }
 }
Exemple #3
0
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     if (!Provider.isServer)
     {
         CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
         return;
     }
     string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
     if (componentsFromSerial.Length != 1 && componentsFromSerial.Length != 4)
     {
         CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
         return;
     }
     if (componentsFromSerial.Length == 1)
     {
         ChatManager.say(componentsFromSerial[0], Palette.SERVER);
     }
     else if (componentsFromSerial.Length == 4)
     {
         byte b;
         if (!byte.TryParse(componentsFromSerial[1], out b))
         {
             CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
             {
                 componentsFromSerial[0]
             }));
             return;
         }
         byte b2;
         if (!byte.TryParse(componentsFromSerial[2], out b2))
         {
             CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
             {
                 componentsFromSerial[1]
             }));
             return;
         }
         byte b3;
         if (!byte.TryParse(componentsFromSerial[3], out b3))
         {
             CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
             {
                 componentsFromSerial[2]
             }));
             return;
         }
         ChatManager.say(componentsFromSerial[0], new Color((float)b / 255f, (float)b2 / 255f, (float)b3 / 255f));
     }
 }
 // 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);
 }
Exemple #5
0
 public static void say(CSteamID target, string text, Color color)
 {
     ChatManager.say(target, text, color, EChatMode.WELCOME);
 }
Exemple #6
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);
Exemple #7
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);