Skip to content

Commit

Permalink
Updated to 21.1.1
Browse files Browse the repository at this point in the history
-Fixed internal event scheduler error
-Fixed Player_Logs triggering an index error
-Fixed event scheduler utilizing a concurrent collection with
a non concurrent by passing the work to another thread
-Fixed Bot_Response not working as intended
-Fixed /commands not utilizing the CommandList.xml replacements
-Fixed Sorter tool failing to transfer items when the target
container had full stacks
-Changed claim check process inside unloaded chunks
-Changed CommandList.xml upgrade process
-Changed all tool delays to note the time interval in the name.
Some tools allow a 24h time schedule. This has not changed
-Updated HowToSetup.txt

Known issues:
-Vault_Box does not work with all modded servers.
Might be a mod load order issue
-RIO is not functioning as intended
-Some console commands are out of date
  • Loading branch information
ObsComp committed Aug 27, 2023
1 parent d121e36 commit e3b4d41
Show file tree
Hide file tree
Showing 40 changed files with 1,395 additions and 1,757 deletions.
24 changes: 24 additions & 0 deletions ServerTools/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
CHANGELOG

21.1.1
Built using Alpha 21 stable assets
Functioning with Alpha 21 stable. Untested with other versions

-Fixed internal event scheduler error
-Fixed Player_Logs triggering an index error
-Fixed event scheduler utilizing a concurrent collection with
a non concurrent by passing the work to another thread
-Fixed Bot_Response not working as intended
-Fixed /commands not utilizing the CommandList.xml replacements
-Fixed Sorter tool failing to transfer items when the target
container had full stacks
-Changed claim check process inside unloaded chunks
-Changed CommandList.xml upgrade process
-Changed all tool delays to note the time interval in the name.
Some tools allow a 24h time schedule. This has not changed
-Updated HowToSetup.txt

Known issues:
-Vault_Box does not work with all modded servers.
Might be a mod load order issue
-RIO is not functioning as intended
-Some console commands are out of date

21.1.0
Built using Alpha 21 stable assets
Functioning with Alpha 21 stable. Untested with other versions
Expand Down
2 changes: 1 addition & 1 deletion ServerTools/ModInfo.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<ModInfo>
<Name value="ServerTools" />
<Version value="21.1.0" />
<Version value="21.1.1" />
<DisplayName value="Server Tools" />
<Description value="ServerTools for 7 Days to Die Dedicated Servers" />
<Author value="Dmustanger, ObsessiveCompulsive, Gik, Koi, Android_Data, Thunderbolt" />
Expand Down
4 changes: 2 additions & 2 deletions ServerTools/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("21.1.0.0")]
[assembly: AssemblyFileVersion("21.1.0.0")]
[assembly: AssemblyVersion("21.1.1.0")]
[assembly: AssemblyFileVersion("21.1.1.0")]
Binary file not shown.
11 changes: 11 additions & 0 deletions ServerTools/obj/Release/ServerTools.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1346,3 +1346,14 @@ F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.0\bin\Mods\Ser
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.0\bin\Mods\ServerTools\ServerTools.dll
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.0\ServerTools\obj\Release\ServerTools.csproj.Fody.CopyLocal.cache
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.0\ServerTools\obj\Release\ServerTools.csproj.CopyComplete
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\bin\Mods\ServerTools\ModInfo.xml
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\bin\Mods\ServerTools\Changelog.txt
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\bin\Mods\ServerTools\ServerTools.dll.config
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\bin\Mods\ServerTools\ServerTools.dll
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\ServerTools\obj\Release\ServerTools.csproj.AssemblyReference.cache
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\ServerTools\obj\Release\ServerTools.Properties.Resources.resources
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\ServerTools\obj\Release\ServerTools.csproj.GenerateResource.cache
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\ServerTools\obj\Release\ServerTools.csproj.CoreCompileInputs.cache
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\ServerTools\obj\Release\ServerTools.csproj.Fody.CopyLocal.cache
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\ServerTools\obj\Release\ServerTools.csproj.CopyComplete
F:\Modding Mods\owncloud\development\7dtd-ServerTools-master-21.1.1\ServerTools\obj\Release\ServerTools.dll
Binary file modified ServerTools/obj/Release/ServerTools.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion ServerTools/src/AntiCheat/BlockChange/BlockChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static void ProcessBlockChange(GameManager __instance, ref List<BlockChan
return;
}
ItemStack stack = cInfo.latestPlayerData.inventory[cInfo.latestPlayerData.selectedInventorySlot];
if (stack == null || !stack.IsEmpty() && stack.itemValue.ItemClass.CreativeMode == EnumCreativeMode.Dev)
if (stack == null || !stack.IsEmpty())
{
return;
}
Expand Down
165 changes: 83 additions & 82 deletions ServerTools/src/AntiCheat/PlayerLogs/PlayerLogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ public static void SetDelay(bool _reset)
{
if (EventDelay != Delay || _reset)
{
if (EventSchedule.Schedule.ContainsKey("PlayerLogs"))
{
EventSchedule.RemoveFromSchedule("PlayerLogs");
}
EventSchedule.Expired.Add("PlayerLogs");
EventDelay = Delay;
if (Delay.Contains(",") && Delay.Contains(":"))
{
Expand Down Expand Up @@ -131,87 +128,91 @@ public static void Exec()
for (int i = 0; i < playerList.Count; i++)
{
player = playerList[i];
if (player != null)
if (player == null)
{
continue;
}
cInfo = GeneralOperations.GetClientInfoFromEntityId(player.entityId);
if (cInfo == null)
{
continue;
}
playerDataFile = cInfo.latestPlayerData;
if (playerDataFile == null)
{
continue;
}
XmlNode playerNode = null;
XmlNodeList playerNodeList = xmlDoc.GetElementsByTagName("Player", "Id " + cInfo.CrossplatformId.CombinedString);
if (playerNodeList == null || playerNodeList.Count == 0)
{
playerNode = xmlDoc.CreateNode(XmlNodeType.Element, "Player", "Id " + cInfo.CrossplatformId.CombinedString);
xmlDoc.DocumentElement.AppendChild(playerNode);
}
else
{
playerNode = playerNodeList[0];
}
if (playerNode == null)
{
continue;
}
if (player.IsSpawned())
{
cInfo = GeneralOperations.GetClientInfoFromEntityId(player.entityId);
if (cInfo != null)
var x = (int)player.position.x;
var y = (int)player.position.y;
var z = (int)player.position.z;
double regionX, regionZ;
regionX = Math.Truncate(player.position.x / 512);
if (player.position.x < 0)
{
regionX -= 1;
}
regionZ = Math.Truncate(player.position.z / 512);
if (player.position.z < 0)
{
regionZ -= 1;
}
string ip = cInfo.ip;
XmlNode newEntry = xmlDoc.CreateTextNode("\n");
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(string.Format(" {0}: '{1}' '{2}' @ day '{3}' hour '{4}'\n", dt, cInfo.PlatformId.CombinedString, cInfo.CrossplatformId.CombinedString, day, hour));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(string.Format(" EntityId {0} / Name {1} / IP Address {2} / Position {3} X {4} Y {5} Z / RegionFile r.{6}.{7}.7rg\n", cInfo.entityId, cInfo.playerName, ip, x, y, z, regionX, regionZ));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(string.Format(" Health {0} / Stamina {1} / ZombieKills {2} / PlayerKills {3} / PlayerLevel {4} / Deaths {5}\n", (int)player.Stats.Health.Value, (int)player.Stats.Stamina.Value, player.KilledZombies, player.KilledPlayers, player.Progression.GetLevel(), player.Died));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(" Belt:\n");
playerNode.AppendChild(newEntry);
playerNode = PrintInv(playerDataFile.inventory, playerNode, xmlDoc);
newEntry = xmlDoc.CreateTextNode(" Backpack:\n");
playerNode.AppendChild(newEntry);
playerNode = PrintInv(playerDataFile.bag, playerNode, xmlDoc);
newEntry = xmlDoc.CreateTextNode(" Equipment:\n");
playerNode.AppendChild(newEntry);
playerNode = PrintEquipment(playerDataFile.equipment, playerNode, xmlDoc);
if (Vehicle && player.AttachedToEntity != null)
{
playerDataFile = cInfo.latestPlayerData;
if (playerDataFile != null)
{
XmlNode playerNode = null;
XmlNodeList playerNodeList = xmlDoc.GetElementsByTagName("Player", "Id " + cInfo.CrossplatformId.CombinedString);
if (playerNodeList == null || playerNodeList.Count == 0)
{
playerNode = xmlDoc.CreateNode(XmlNodeType.Element, "Player", "Id " + cInfo.CrossplatformId.CombinedString);
xmlDoc.DocumentElement.AppendChild(playerNode);
}
else
{
playerNode = playerNodeList[0];
}
if (playerNode != null)
{
if (player.IsSpawned())
{
var x = (int)player.position.x;
var y = (int)player.position.y;
var z = (int)player.position.z;
double regionX, regionZ;
regionX = Math.Truncate(player.position.x / 512);
if (player.position.x < 0)
{
regionX -= 1;
}
regionZ = Math.Truncate(player.position.z / 512);
if (player.position.z < 0)
{
regionZ -= 1;
}
string ip = cInfo.ip;
XmlNode newEntry = xmlDoc.CreateTextNode("\n");
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(string.Format(" {0}: '{1}' '{2}' @ day '{3}' hour '{4}'\n", dt, cInfo.PlatformId.CombinedString, cInfo.CrossplatformId.CombinedString, day, hour));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(string.Format(" EntityId {1} / Name {2} / IP Address {3} / Position {4} X {5} Y {6} Z / RegionFile r.{7}.{8}.7rg\n", cInfo.entityId, cInfo.playerName, ip, x, y, z, regionX, regionZ));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(string.Format(" Health {0} / Stamina {1} / ZombieKills {2} / PlayerKills {3} / PlayerLevel {4} / Deaths {5}\n", (int)player.Stats.Health.Value, (int)player.Stats.Stamina.Value, player.KilledZombies, player.KilledPlayers, player.Progression.GetLevel(), player.Died));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(" Belt:\n");
playerNode.AppendChild(newEntry);
playerNode = PrintInv(playerDataFile.inventory, playerNode, xmlDoc);
newEntry = xmlDoc.CreateTextNode(" Backpack:\n");
playerNode.AppendChild(newEntry);
playerNode = PrintInv(playerDataFile.bag, playerNode, xmlDoc);
newEntry = xmlDoc.CreateTextNode(" Equipment:\n");
playerNode.AppendChild(newEntry);
playerNode = PrintEquipment(playerDataFile.equipment, playerNode, xmlDoc);
if (Vehicle && player.AttachedToEntity != null)
{
newEntry = xmlDoc.CreateTextNode(" Vehicle:\n");
playerNode.AppendChild(newEntry);
playerNode = PrintVehicle(player.AttachedToEntity.entityId, playerNode, xmlDoc);
}
newEntry = xmlDoc.CreateTextNode(" ----------------\n");
playerNode.AppendChild(newEntry);
}
else if (!player.IsDead() && !player.IsSpawned())
{
XmlNode newEntry = xmlDoc.CreateTextNode(string.Format(" {0}: EntityId {1} / Name {2} / Player has not spawned\n", dt, cInfo.entityId, cInfo.playerName));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(" ----------------\n");
playerNode.AppendChild(newEntry);
}
else if (player.IsDead())
{
XmlNode newEntry = xmlDoc.CreateTextNode(string.Format(" {0}: EntityId {1} / Name {2} / Player is dead\n", dt, cInfo.entityId, cInfo.playerName));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(" ----------------\n");
playerNode.AppendChild(newEntry);
}
}
}
newEntry = xmlDoc.CreateTextNode(" Vehicle:\n");
playerNode.AppendChild(newEntry);
playerNode = PrintVehicle(player.AttachedToEntity.entityId, playerNode, xmlDoc);
}
newEntry = xmlDoc.CreateTextNode(" ----------------\n");
playerNode.AppendChild(newEntry);
}
else if (!player.IsDead())
{
XmlNode newEntry = xmlDoc.CreateTextNode(string.Format(" {0}: EntityId {1} / Name {2} / Player has not spawned\n", dt, cInfo.entityId, cInfo.playerName));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(" ----------------\n");
playerNode.AppendChild(newEntry);
}
else
{
XmlNode newEntry = xmlDoc.CreateTextNode(string.Format(" {0}: EntityId {1} / Name {2} / Player is dead\n", dt, cInfo.entityId, cInfo.playerName));
playerNode.AppendChild(newEntry);
newEntry = xmlDoc.CreateTextNode(" ----------------\n");
playerNode.AppendChild(newEntry);
}
}
xmlDoc.Save(PlayerLogFilePath);
Expand Down
2 changes: 1 addition & 1 deletion ServerTools/src/AntiCheat/ProtectedZones/ProtectedZones.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static void LoadXml()
}
else
{
Log.Out(string.Format("[SERVERTOOLS] Error in ProtectedZones.LoadXml: {0}", e.Message));
Log.Out("[SERVERTOOLS] Error in ProtectedZones.LoadXml: {0}", e.Message);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions ServerTools/src/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public static void ProcessNewPlayer(ClientInfo _cInfo, EntityPlayer _player)
Hardcore.Check(_cInfo, _player, false);
}
}
EventSchedule.Schedule.Add("Bonus_" + id, DateTime.Now.AddMinutes(15));
EventSchedule.AddToSchedule("Bonus_" + id, DateTime.Now.AddMinutes(15));
}
}
catch (Exception e)
Expand Down Expand Up @@ -609,7 +609,7 @@ public static void OldPlayerJoined(ClientInfo _cInfo, EntityPlayer _player)
Teleportation.InsideWorld(_cInfo, _player);
Teleportation.InsideBlock(_cInfo, _player);
}
EventSchedule.Schedule.Add("Bonus_" + id, DateTime.Now.AddMinutes(15));
EventSchedule.AddToSchedule("Bonus_" + id, DateTime.Now.AddMinutes(15));
}
}
catch (Exception e)
Expand Down
Loading

0 comments on commit e3b4d41

Please sign in to comment.