Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ObsComp authored Mar 2, 2018
1 parent cc80508 commit dfbea13
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 221 deletions.
8 changes: 4 additions & 4 deletions ServerTools/src/ConsoleCommands/GiveBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with steamdId {0} is not spawned", _params[1]));
SdtdConsole.Instance.Output(string.Format("Player with steamdId {0} is not spawned", _params[0]));
}
}
}
else
{
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[0]);
if (_cInfo != null)
{
int count = 1;
Expand Down Expand Up @@ -167,12 +167,12 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with Id {0} is not spawned", _params[1]));
SdtdConsole.Instance.Output(string.Format("Player with Id {0} is not spawned", _params[0]));
}
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with steamdId {0} does not exist", _params[1]));
SdtdConsole.Instance.Output(string.Format("Player with steamdId {0} does not exist", _params[0]));
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions ServerTools/src/ConsoleCommands/GiveItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with steamdId {0} is not spawned", _params[1]));
SdtdConsole.Instance.Output(string.Format("Player with steamdId {0} is not spawned", _params[0]));
}

}
}
else
{
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[0]);
if (_cInfo != null)
{
int count = 1;
Expand Down Expand Up @@ -204,12 +204,12 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with Id {0} is not spawned", _params[1]));
SdtdConsole.Instance.Output(string.Format("Player with Id {0} is not spawned", _params[0]));
}
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with Id {0} does not exist", _params[1]));
SdtdConsole.Instance.Output(string.Format("Player with Id {0} does not exist", _params[0]));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions ServerTools/src/ConsoleCommands/GiveStartingItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
}
else
{
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[0]);
if (_cInfo != null)
{
if (StartingItems.startItemList.Count > 0)
Expand Down Expand Up @@ -92,7 +92,7 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with Id {0} does not exist", _params[1]));
SdtdConsole.Instance.Output(string.Format("Player with Id {0} does not exist", _params[0]));
}
}
}
Expand Down
22 changes: 4 additions & 18 deletions ServerTools/src/ConsoleCommands/ResetAnimalTracking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,6 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
return;
}
if (_params[1].Length == 17)
{
Player p = PersistentContainer.Instance.Players[_params[1], false];
if (p.LastAnimals != null)
{
PersistentContainer.Instance.Players[_params[1], true].LastAnimals = DateTime.Now.AddDays(-2);
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Animal tracking delay reset.");
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a animal tracking delay to reset.", _params[1]));
}
}
else
{
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
Expand All @@ -73,10 +59,10 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a animal tracking delay to reset.", _params[1]));
}
}
}
else
{
SdtdConsole.Instance.Output(string.Format("Invalid argument {0}.", _params[0]));
else
{
SdtdConsole.Instance.Output(string.Format("Invalid argument {0}.", _params[0]));
}
}
}
catch (Exception e)
Expand Down
32 changes: 7 additions & 25 deletions ServerTools/src/ConsoleCommands/ResetFirstClaimBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,42 +43,24 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
SdtdConsole.Instance.Output(string.Format("Can not reset Id: Invalid Id {0}.", _params[1]));
return;
}
if (_params[1].Length == 17)
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p != null)
{
Player p = PersistentContainer.Instance.Players[_params[1], false];
if (p != null)
{
PersistentContainer.Instance.Players[_params[1], true].WorldSeedFirstClaim = 1;
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Players first claim block reset.");
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a first claim block to reset.", _params[1]));
}
PersistentContainer.Instance.Players[_cInfo.playerId, true].WorldSeedFirstClaim = 1;
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Players first claim block reset.");
}
else
{
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p != null)
{
PersistentContainer.Instance.Players[_cInfo.playerId, true].WorldSeedFirstClaim = 1;
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Players first claim block reset.");
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a first claim block to reset.", _params[1]));
}
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a first claim block to reset.", _params[1]));
}
}
else
{
SdtdConsole.Instance.Output(string.Format("Invalid argument {0}.", _params[0]));
}
}

catch (Exception e)
{
Log.Out(string.Format("[SERVERTOOLS] Error in ResetFirstClaimBlock.Run: {0}.", e));
Expand Down
33 changes: 7 additions & 26 deletions ServerTools/src/ConsoleCommands/ResetGimme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,43 +43,24 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
SdtdConsole.Instance.Output(string.Format("Can not reset Id: Invalid Id {0}", _params[1]));
return;
}
if (_params[1].Length == 17)
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p.LastGimme != null)
{
Player p = PersistentContainer.Instance.Players[_params[1], false];
if (p.LastGimme != null)
{
PersistentContainer.Instance.Players[_params[1], true].LastGimme = DateTime.Now.AddDays(-2);
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Gimme delay reset.");
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a Gimme delay to reset.", _params[1]));
}
PersistentContainer.Instance.Players[_cInfo.playerId, true].LastGimme = DateTime.Now.AddDays(-2);
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Gimme delay reset.");
}
else
{
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p.LastGimme != null)
{
PersistentContainer.Instance.Players[_cInfo.playerId, true].LastGimme = DateTime.Now.AddDays(-2);
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Gimme delay reset.");
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a Gimme delay to reset.", _params[1]));
}
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a Gimme delay to reset.", _params[1]));
}
}
else
{
SdtdConsole.Instance.Output(string.Format("Invalid argument {0}.", _params[0]));
}
}


catch (Exception e)
{
Log.Out(string.Format("[SERVERTOOLS] Error in ResetGimme.Run: {0}.", e));
Expand Down
33 changes: 7 additions & 26 deletions ServerTools/src/ConsoleCommands/ResetHome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,43 +43,24 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
SdtdConsole.Instance.Output(string.Format("Can not reset Id: Invalid Id {0}", _params[1]));
return;
}
if (_params[1].Length == 17)
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p.LastSetHome != null)
{
Player p = PersistentContainer.Instance.Players[_params[1], false];
if (p.LastSetHome != null)
{
PersistentContainer.Instance.Players[_params[1], true].LastSetHome = DateTime.Now.AddDays(-2);
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Players chat command /home and /home2 delay reset.");
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a Home delay to reset.", _params[1]));
}
PersistentContainer.Instance.Players[_cInfo.playerId, true].LastSetHome = DateTime.Now.AddDays(-2);
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Players chat command /home and /home2 delay reset.");
}
else
{
ClientInfo _cInfo = ConsoleHelper.ParseParamIdOrName(_params[1]);
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p.LastSetHome != null)
{
PersistentContainer.Instance.Players[_cInfo.playerId, true].LastSetHome = DateTime.Now.AddDays(-2);
PersistentContainer.Instance.Save();
SdtdConsole.Instance.Output("Players chat command /home and /home2 delay reset.");
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a Home delay to reset.", _params[1]));
}
SdtdConsole.Instance.Output(string.Format("Player with id {0} does not have a Home delay to reset.", _params[1]));
}
}
else
{
SdtdConsole.Instance.Output(string.Format("Invalid argument {0}.", _params[0]));
}
}


catch (Exception e)
{
Log.Out(string.Format("[SERVERTOOLS] Error in ResetHome.Run: {0}.", e));
Expand Down
Loading

0 comments on commit dfbea13

Please sign in to comment.