UpdateXml() public static method

public static UpdateXml ( ) : void
return void
 public static void Set(ClientInfo _cInfo)
 {
     if (!GameManager.Instance.adminTools.CommandAllowedFor(_cmd, _cInfo.playerId))
     {
         string _phrase200;
         if (!Phrases.Dict.TryGetValue(200, out _phrase200))
         {
             _phrase200 = "{PlayerName} you do not have permissions to use this command.";
         }
         _phrase200 = _phrase200.Replace("{PlayerName}", _cInfo.playerName);
         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase200), Config.Server_Response_Name, false, "ServerTools", false));
     }
     else
     {
         EntityPlayer _player    = GameManager.Instance.World.Players.dict[_cInfo.entityId];
         Vector3      _position  = _player.GetPosition();
         int          x          = (int)_position.x;
         int          y          = (int)_position.y;
         int          z          = (int)_position.z;
         string       _lposition = x + "," + y + "," + z;
         Lobby_Position = _lposition;
         string _phrase551;
         if (!Phrases.Dict.TryGetValue(551, out _phrase551))
         {
             _phrase551 = "{PlayerName} you have set the lobby position as {LobbyPosition}.";
         }
         _phrase551 = _phrase551.Replace("{PlayerName}", _cInfo.playerName);
         _phrase551 = _phrase551.Replace("{LobbyPosition}", Lobby_Position);
         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase551), Config.Server_Response_Name, false, "ServerTools", false));
         Config.UpdateXml();
     }
 }
Example #2
0
 public override void Execute(List <string> _params, CommandSenderInfo _senderInfo)
 {
     try
     {
         if (_params.Count != 1)
         {
             SdtdConsole.Instance.Output(string.Format("Wrong number of arguments, expected 1, found {0}.", _params.Count));
             return;
         }
         if (_params[0] == ("set"))
         {
             ClientInfo   _cInfo     = _senderInfo.RemoteClientInfo;
             EntityPlayer _player    = GameManager.Instance.World.Players.dict[_cInfo.entityId];
             Vector3      _position  = _player.GetPosition();
             int          x          = (int)_position.x;
             int          y          = (int)_position.y;
             int          z          = (int)_position.z;
             string       _lposition = x + "," + y + "," + z;
             SetLobby.Lobby_Position = _lposition;
             string _phrase551;
             if (!Phrases.Dict.TryGetValue(551, out _phrase551))
             {
                 _phrase551 = "{PlayerName} you have set the lobby position as {LobbyPosition}.";
             }
             _phrase551 = _phrase551.Replace("{PlayerName}", _cInfo.playerName);
             _phrase551 = _phrase551.Replace("{LobbyPosition}", _lposition);
             SdtdConsole.Instance.Output(string.Format("{0}", _phrase551));
             Config.UpdateXml();
         }
     }
     catch (Exception e)
     {
         Log.Out(string.Format("[SERVERTOOLS] Error in CommandJail.Run: {0}.", e));
     }
 }
Example #3
0
 public static void SetNewSpawnTele(ClientInfo _cInfo)
 {
     if (!GameManager.Instance.adminTools.CommandAllowedFor(_cmd, _cInfo.playerId))
     {
         string _phrase200;
         if (!Phrases.Dict.TryGetValue(200, out _phrase200))
         {
             _phrase200 = "{PlayerName} you do not have permissions to use this command.";
         }
         _phrase200 = _phrase200.Replace("{PlayerName}", _cInfo.playerName);
         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", CustomCommands.ChatColor, _phrase200), "Server", false, "", false));
     }
     else
     {
         EntityPlayer _player    = GameManager.Instance.World.Players.dict[_cInfo.entityId];
         Vector3      _position  = _player.GetPosition();
         string       x          = _position.x.ToString();
         string       y          = _position.y.ToString();
         string       z          = _position.z.ToString();
         string       _sposition = x + "," + y + "," + z;
         NewSpawnTelePosition = _sposition;
         string _phrase525;
         if (!Phrases.Dict.TryGetValue(525, out _phrase525))
         {
             _phrase525 = "{PlayerName} you have set the New Spawn position as {NewSpawnTelePosition}.";
         }
         _phrase525 = _phrase525.Replace("{PlayerName}", _cInfo.playerName);
         _phrase525 = _phrase525.Replace("{NewSpawnTelePosition}", NewSpawnTelePosition);
         _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", CustomCommands.ChatColor, _phrase525), "Server", false, "", false));
         Config.UpdateXml();
     }
 }
Example #4
0
 public override void Execute(List <string> _params, CommandSenderInfo _senderInfo)
 {
     try
     {
         if (_params.Count != 1)
         {
             SdtdConsole.Instance.Output("Wrong number of arguments.");
             return;
         }
         if (!int.TryParse(_params[0], out HighPingKicker.MAXPING))
         {
             SdtdConsole.Instance.Output("Maxping is not an integer.");
             return;
         }
         SdtdConsole.Instance.Output(string.Format("Max ping limit set to {0}", HighPingKicker.MAXPING));
         Config.UpdateXml();
     }
     catch (Exception e)
     {
         Log.Out(string.Format("[SERVERTOOLS] Error in ReservedSlot.Run: {0}.", e));
     }
 }