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 Feb 13, 2018
1 parent 6d1002d commit 9cebf2b
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 61 deletions.
14 changes: 11 additions & 3 deletions ServerTools/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,25 @@ Vote to mute system...
Chat command /travel will teleport the player's minibike if they are riding it when command is used...
Auto respawn traders...
Who console command to see who was in an area you are standing in...
Add missing phrases to phrase list...
*

v.6.2 In process...
Added a readme.xml explaining how to use each module within ServerTools...
v.6.3 In process...
Added a HowTo.xml explaining how to use each tool within ServerTools. Can be found in the same folder as the config file...
Added Coin and Market system...
Added custom command delays...
Added chat command /top3. Shows the server's top 3 players. PvE = Zkills - deaths. PvP = Zkills + player kills - deaths...
Added Weather Control vote system...

v.6.2
Added console command to reset home and home2 delay of a specific player
Changed home and home2 chat commands to share the same delay to avoid exploiting
Changed sethome and sethome2 to not work while in a protected zone
Fixed chat command triggers
Fixed home2, sethome2, delhome2 not working with only donors when the option is set to true

v.6.1
Fixed VoteReward.xml missing after activation.
Fixed VoteReward.xml missing after activation

v.6.0
Added Stopserver ten second countdown option. During a shutdown, this will enable a warning at 10 seconds left and a countdown from 5 to 1 seconds
Expand Down
2 changes: 1 addition & 1 deletion ServerTools/ModInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Name value="Server Tools" />
<Description value="Server tools for dedicated servers" />
<Author value="Dmustanger and ObsessiveCompulsive" />
<Version value="6.1" />
<Version value="6.2" />
<Website value="https://github.com/dmustanger/7dtd-ServerTools/releases" />
</ModInfo>
</xml>
3 changes: 3 additions & 0 deletions ServerTools/ServerTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<Compile Include="src\ConsoleCommands\ResetAnimalTracking.cs" />
<Compile Include="src\ConsoleCommands\ResetFirstClaimBlock.cs" />
<Compile Include="src\ConsoleCommands\ResetGimme.cs" />
<Compile Include="src\ConsoleCommands\ResetHome.cs" />
<Compile Include="src\ConsoleCommands\ResetVoteReward.cs" />
<Compile Include="src\ConsoleCommands\SpawnEntityInRadius.cs" />
<Compile Include="src\ConsoleCommands\Jail.cs" />
Expand All @@ -92,6 +93,7 @@
<Compile Include="src\ConsoleCommands\PingImmunity.cs" />
<Compile Include="src\HighPingKicker\HighPingKicker.cs" />
<Compile Include="src\ConsoleCommands\EntityRemove.cs" />
<Compile Include="src\HowTo\HowToSetup.cs" />
<Compile Include="src\NewSpawnTele\NewSpawnTele.cs" />
<Compile Include="src\PersistentData\PersistentContainer.cs" />
<Compile Include="src\PersistentData\Player.cs" />
Expand Down Expand Up @@ -153,6 +155,7 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Binary file modified ServerTools/obj/Release/ServerTools.dll
Binary file not shown.
1 change: 0 additions & 1 deletion ServerTools/src/AntiCheat/ZoneProtection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class ZoneProtection
public static SortedDictionary<int, Vector3> Victim = new SortedDictionary<int, Vector3>();
public static SortedDictionary<int, int> Forgive = new SortedDictionary<int, int>();
public static List<int> PvEFlag = new List<int>();
public static List<int> PvEFlag2 = new List<int>();
private static FileSystemWatcher fileWatcher = new FileSystemWatcher(API.ConfigPath, file);
private static bool updateConfig = false;
private static System.Timers.Timer t = new System.Timers.Timer();
Expand Down
22 changes: 11 additions & 11 deletions ServerTools/src/Chat/ChatCommands/TeleportHome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class TeleportHome
public static void SetHome(ClientInfo _cInfo, string _playerName, bool _announce)
{
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p != null || !p.IsJailed)
if (p == null && !ZoneProtection.PvEFlag.Contains(_cInfo.entityId) || !p.IsJailed && !ZoneProtection.PvEFlag.Contains(_cInfo.entityId))
{
EntityPlayer _player = GameManager.Instance.World.Players.dict[_cInfo.entityId];
Vector3 _position = _player.GetPosition();
Expand Down Expand Up @@ -68,7 +68,7 @@ public static void SetHome(ClientInfo _cInfo, string _playerName, bool _announce
public static void TeleHome(ClientInfo _cInfo, string _playerName, bool _announce)
{
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p == null || p.HomePosition == null & !p.IsJailed)
if (p == null || p.HomePosition == null)
{
string _phrase11;
if (!Phrases.Dict.TryGetValue(11, out _phrase11))
Expand All @@ -85,7 +85,7 @@ public static void TeleHome(ClientInfo _cInfo, string _playerName, bool _announc
_cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{1}{0}[-]", _phrase11, Config.ChatColor), "Server", false, "", false));
}
}
else
else if (!p.IsJailed)
{
if (DelayBetweenUses < 1)
{
Expand All @@ -112,7 +112,7 @@ public static void TeleHome(ClientInfo _cInfo, string _playerName, bool _announc
string _phrase13;
if (!Phrases.Dict.TryGetValue(13, out _phrase13))
{
_phrase13 = "{PlayerName} you can only use /home once every {DelayBetweenUses} minutes. Time remaining: {TimeRemaining} minutes.";
_phrase13 = "{PlayerName} you can only use /home or /home2 once every {DelayBetweenUses} minutes. Time remaining: {TimeRemaining} minutes.";
}
_phrase13 = _phrase13.Replace("{PlayerName}", _cInfo.playerName);
_phrase13 = _phrase13.Replace("{DelayBetweenUses}", DelayBetweenUses.ToString());
Expand Down Expand Up @@ -181,7 +181,7 @@ public static void DelHome(ClientInfo _cInfo, string _playerName, bool _announce
public static void SetHome2(ClientInfo _cInfo, string _playerName, bool _announce)
{
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p != null || !p.IsJailed)
if (p == null && !ZoneProtection.PvEFlag.Contains(_cInfo.entityId) || !p.IsJailed && !ZoneProtection.PvEFlag.Contains(_cInfo.entityId))
{
EntityPlayer _player = GameManager.Instance.World.Players.dict[_cInfo.entityId];
Vector3 _position = _player.GetPosition();
Expand Down Expand Up @@ -236,7 +236,7 @@ public static void SetHome2(ClientInfo _cInfo, string _playerName, bool _announc
public static void TeleHome2(ClientInfo _cInfo, string _playerName, bool _announce)
{
Player p = PersistentContainer.Instance.Players[_cInfo.playerId, false];
if (p == null || p.HomePosition2 == null && !p.IsJailed)
if (p == null || p.HomePosition2 == null)
{
string _phrase608;
if (!Phrases.Dict.TryGetValue(608, out _phrase608))
Expand All @@ -253,21 +253,21 @@ public static void TeleHome2(ClientInfo _cInfo, string _playerName, bool _announ
_cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{1}{0}[-]", _phrase608, Config.ChatColor), "Server", false, "", false));
}
}
else
else if (!p.IsJailed)
{
if (DelayBetweenUses < 1)
{
Home2(_cInfo, p.HomePosition2, _playerName, _announce);
}
else
{
if (p.LastSetHome2 == null)
if (p.LastSetHome == null)
{
Home2(_cInfo, p.HomePosition2, _playerName, _announce);
}
else
{
TimeSpan varTime = DateTime.Now - p.LastSetHome2;
TimeSpan varTime = DateTime.Now - p.LastSetHome;
double fractionalMinutes = varTime.TotalMinutes;
int _timepassed = (int)fractionalMinutes;
if (_timepassed > DelayBetweenUses)
Expand All @@ -280,7 +280,7 @@ public static void TeleHome2(ClientInfo _cInfo, string _playerName, bool _announ
string _phrase609;
if (!Phrases.Dict.TryGetValue(609, out _phrase609))
{
_phrase609 = "{PlayerName} you can only use /home2 once every {DelayBetweenUses} minutes. Time remaining: {TimeRemaining} minutes.";
_phrase609 = "{PlayerName} you can only use /home or /home2 once every {DelayBetweenUses} minutes. Time remaining: {TimeRemaining} minutes.";
}
_phrase609 = _phrase609.Replace("{PlayerName}", _cInfo.playerName);
_phrase609 = _phrase609.Replace("{DelayBetweenUses}", DelayBetweenUses.ToString());
Expand Down Expand Up @@ -313,7 +313,7 @@ private static void Home2(ClientInfo _cInfo, string _home2, string _playerName,
int y = (int)yf;
int z = (int)zf;
SdtdConsole.Instance.ExecuteSync(string.Format("tele {0} {1} {2} {3}", _cInfo.entityId, x, y, z), (ClientInfo)null);
PersistentContainer.Instance.Players[_cInfo.playerId, false].LastSetHome2 = DateTime.Now;
PersistentContainer.Instance.Players[_cInfo.playerId, false].LastSetHome = DateTime.Now;
PersistentContainer.Instance.Save();
}

Expand Down
Loading

0 comments on commit 9cebf2b

Please sign in to comment.