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 15, 2018
1 parent 7fced93 commit 5e11c25
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 55 deletions.
9 changes: 7 additions & 2 deletions ServerTools/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ Who console command to see who was in an area you are standing in...
Add missing phrases to phrase list...
*

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...
In process...
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...
Added a HowTo.xml explaining how to use each tool within ServerTools. Can be found in the same folder as the config file...

v.6.3
Added reward count option to Vote Reward system. This is how many items from the VoteReward.xml a player receives. Setting 3 will give
3 random entry types from the list. This does not effect the minimum or maximum item counts, just the total entries from the list they receive
Fixed console commands give item and give block

v.6.2
Added console command to reset home and home2 delay of a specific player
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.2" />
<Version value="6.3" />
<Website value="https://github.com/dmustanger/7dtd-ServerTools/releases" />
</ModInfo>
</xml>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.1\ServerTools\obj
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.1\ServerTools\obj\Release\ServerTools.Properties.Resources.resources
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.1\ServerTools\obj\Release\ServerTools.csproj.GenerateResource.Cache
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.1\ServerTools\obj\Release\ServerTools.dll
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.3\bin\Mods\ServerTools\ChatCommandExamples.txt
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.3\bin\Mods\ServerTools\ConsoleCommandExamples.txt
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.3\bin\Mods\ServerTools\ModInfo.xml
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.3\bin\Mods\ServerTools\Changelog.txt
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.3\bin\Mods\ServerTools\ServerTools.dll
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.3\ServerTools\obj\Release\ServerTools.csprojResolveAssemblyReference.cache
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.3\ServerTools\obj\Release\ServerTools.Properties.Resources.resources
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.3\ServerTools\obj\Release\ServerTools.csproj.GenerateResource.Cache
C:\Modding Mods\owncloud\development\7dtd-ServerTools-master-6.3\ServerTools\obj\Release\ServerTools.dll
Binary file modified ServerTools/obj/Release/ServerTools.dll
Binary file not shown.
1 change: 0 additions & 1 deletion ServerTools/src/AntiCheat/WorldRadius.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System;
using System.Collections.Generic;
using System.Timers;
using UnityEngine;

namespace ServerTools
{
Expand Down
28 changes: 15 additions & 13 deletions ServerTools/src/ConsoleCommands/GiveBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public override string GetDescription()
public override string GetHelp()
{
return "Usage:\n" +
" 1. giveblock <steamId> <blockId> <count>\n" +
" 2. giveblock all <blockId> <count>\n" +
"1. Gives a player the block(s) in their inventory unless full. Drops to the ground when full.\n"+
"2. Gives all players the block(s) in their inventory unless full. Drops to the ground when full.\n";
" 1. giveblock <steamId> <blockId or name> <count>\n" +
" 2. giveblock all <blockId or name> <count>\n" +
"1. Gives a player the block(s) to their inventory unless full. Drops to the ground when full.\n"+
"2. Gives all players the block(s) to their inventory unless full. Drops to the ground when full.\n";
}
public override string[] GetCommands()
{
Expand All @@ -26,15 +26,18 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
{
try
{
if (_params.Count > 4)
if (_params.Count > 3)
{
SdtdConsole.Instance.Output(string.Format("Wrong number of arguments, expected 4, found {0}", _params.Count));
SdtdConsole.Instance.Output(string.Format("Wrong number of arguments, expected 3, found {0}", _params.Count));
return;
}
if (_params[0].Length != 3 || _params[0].Length != 17)
if (_params[0].Length != 3)
{
SdtdConsole.Instance.Output(string.Format("Can not give block to SteamId: Invalid SteamId {0}", _params[0]));
return;
if (_params[0].Length != 17)
{
SdtdConsole.Instance.Output(string.Format("Can not give block to SteamId: Invalid SteamId {0}", _params[0]));
return;
}
}
if (_params[1].Length < 1)
{
Expand All @@ -48,8 +51,7 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
}
else
{
string all = _params[0];
if (all == "all")
if (_params[0] == "all" || _params[0] == "ALL" || _params[0] == "All")
{
List<ClientInfo> _cInfoList = ConnectionManager.Instance.GetClients();
foreach (var _cInfo in _cInfoList)
Expand Down Expand Up @@ -104,15 +106,15 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
world.SpawnEntityInWorld(entityItem);
_cInfo.SendPackage(new NetPackageEntityCollect(entityItem.entityId, _cInfo.entityId));
world.RemoveEntity(entityItem.entityId, EnumRemoveEntityReason.Killed);
_cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1} {2} was sent to your inventory by an admin. If your bag is full, check the ground.[-]", Config.ChatColor, count, itemValue.ItemClass.localizedName ?? itemValue.ItemClass.Name), "Server", false, "", false));
GameManager.Instance.GameMessageServer((ClientInfo)null, EnumGameMessages.Chat, string.Format("{0}{1} {2} was sent to your inventory by an admin. If your bag is full, check the ground.[-]", Config.ChatColor, count, itemValue.ItemClass.localizedName ?? itemValue.ItemClass.Name), "Server", false, "", false);
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with steamdId {0} is not spawned", _params[1]));
}
}
}
else if (_params[0].Length == 17)
else
{
ClientInfo _cInfo = ConnectionManager.Instance.GetClientInfoForPlayerId(_params[0]);
if (_cInfo != null)
Expand Down
35 changes: 19 additions & 16 deletions ServerTools/src/ConsoleCommands/GiveItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public override string GetHelp()
return "Usage:\n" +
" 1. giveitem <steamId> <itemId or name> <count> <quality>\n" +
" 2. giveitem all <itemId or name> <count> <quality>\n " +
"1. Gives a player the item(s) in their inventory unless full. Drops to the ground when full.\n" +
"2. Gives all players the item(s) in their inventory unless full. Drops to the ground when full.\n" +
"Note: Items with no quality require a 1\n";
"1. Gives a player the item(s) to their inventory unless full. Drops to the ground when full.\n" +
"2. Gives all players the item(s) to their inventory unless full. Drops to the ground when full.\n" +
"*Note Item(s) with no quality require a 1*\n";
}
public override string[] GetCommands()
{
Expand All @@ -28,15 +28,18 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
{
try
{
if (_params.Count != 4)
if (_params.Count > 4)
{
SdtdConsole.Instance.Output(string.Format("Wrong number of arguments, expected 4, found {0}", _params.Count));
return;
}
if (_params[0].Length != 3 || _params[0].Length != 17)
if (_params[0].Length != 3)
{
SdtdConsole.Instance.Output(string.Format("Can not give item to SteamId: Invalid SteamId {0}", _params[0]));
return;
if (_params[0].Length != 17)
{
SdtdConsole.Instance.Output(string.Format("Can not give item to SteamId: Invalid SteamId {0}", _params[0]));
return;
}
}
if (_params[1].Length < 1)
{
Expand All @@ -48,15 +51,14 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
SdtdConsole.Instance.Output(string.Format("Can not give item: Invalid count {0}", _params[2]));
return;
}
if (_params[2].Length < 1 || _params[2].Length > 3)
if (_params[3].Length < 1 || _params[3].Length > 3)
{
SdtdConsole.Instance.Output(string.Format("Can not give item: Invalid quality {0}", _params[2]));
SdtdConsole.Instance.Output(string.Format("Can not give item: Invalid quality {0}", _params[3]));
return;
}
else
{
string all = _params[0];
if (all == "all")
if (_params[0] == "all" || _params[0] == "ALL" || _params[0] == "All")
{
List<ClientInfo> _cInfoList = ConnectionManager.Instance.GetClients();
foreach (var _cInfo in _cInfoList)
Expand All @@ -65,7 +67,7 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
int _count;
if (int.TryParse(_params[2], out _count))
{
if (_count > 0 & _count < 10000)
if (_count > 0 & _count < 10001)
{
count = _count;
}
Expand All @@ -77,7 +79,7 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo

if (int.TryParse(_params[3], out quality))
{
if (quality > 0 & quality <= 600)
if (quality > 0 & quality < 601)
{
min = quality;
max = quality;
Expand Down Expand Up @@ -126,15 +128,16 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo
world.SpawnEntityInWorld(entityItem);
_cInfo.SendPackage(new NetPackageEntityCollect(entityItem.entityId, _cInfo.entityId));
world.RemoveEntity(entityItem.entityId, EnumRemoveEntityReason.Killed);
_cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1} {2} was sent to your inventory by an admin. If your bag is full, check the ground.[-]", Config.ChatColor, count, itemValue.ItemClass.localizedName ?? itemValue.ItemClass.Name), "Server", false, "", false));
GameManager.Instance.GameMessageServer((ClientInfo)null, EnumGameMessages.Chat, string.Format("{0}{1} {2} was sent to your inventory by an admin. If your bag is full, check the ground.[-]", Config.ChatColor, count, itemValue.ItemClass.localizedName ?? itemValue.ItemClass.Name), "Server", false, "", false);
}
else
{
SdtdConsole.Instance.Output(string.Format("Player with steamdId {0} is not spawned", _params[1]));
}

}
}
else if (_params[0].Length == 17)
else
{
ClientInfo _cInfo = ConnectionManager.Instance.GetClientInfoForPlayerId(_params[0]);
if (_cInfo != null)
Expand All @@ -155,7 +158,7 @@ public override void Execute(List<string> _params, CommandSenderInfo _senderInfo

if (int.TryParse(_params[3], out quality))
{
if (quality > 0 & quality <= 600)
if (quality > 0 & quality < 601)
{
min = quality;
max = quality;
Expand Down
16 changes: 13 additions & 3 deletions ServerTools/src/Functions/LoadConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Config
private const string configFile = "ServerToolsConfig.xml";
private static string configFilePath = string.Format("{0}/{1}", API.ConfigPath, configFile);
private static FileSystemWatcher fileWatcher = new FileSystemWatcher(API.ConfigPath, configFile);
private const double version = 6.2;
private const double version = 6.3;
public static bool UpdateConfigs = false;
public static string ChatColor = "[00FF00]";

Expand Down Expand Up @@ -1320,6 +1320,16 @@ private static void LoadXml()
Log.Warning(string.Format("[SERVERTOOLS] Ignoring Voting entry because of invalid (non-numeric) value for 'DelayBetweenRewards' attribute: {0}", subChild.OuterXml));
continue;
}
if (!_line.HasAttribute("RewardCount"))
{
Log.Warning(string.Format("[SERVERTOOLS] Ignoring Voting entry because of missing 'RewardCount' attribute: {0}", subChild.OuterXml));
continue;
}
if (!int.TryParse(_line.GetAttribute("RewardCount"), out VoteReward.RewardCount))
{
Log.Warning(string.Format("[SERVERTOOLS] Ignoring Voting entry because of invalid (non-numeric) value for 'RewardCount' attribute: {0}", subChild.OuterXml));
continue;
}
break;
case "Watchlist":
if (!_line.HasAttribute("Enable"))
Expand Down Expand Up @@ -1483,9 +1493,9 @@ public static void UpdateXml()
sw.WriteLine(string.Format(" <Tool Name=\"TempBan\" Enable=\"{0}\" AdminLevel=\"{1}\" />", TempBan.IsEnabled, TempBan.AdminLevel));
sw.WriteLine(string.Format(" <Tool Name=\"Travel\" Enable=\"{0}\" DelayBetweenUses=\"{1}\" />", Travel.IsEnabled, Travel.DelayBetweenUses));
sw.WriteLine(string.Format(" <Tool Name=\"UndergroundCheck\" Enable=\"{0}\" AdminLevel=\"{1}\" MaxPing=\"{2}\" KillPlayer=\"{3}\" Announce=\"{4}\" JailEnabled=\"{5}\" KickEnabled=\"{6}\" BanEnabled=\"{7}\" DaysBeforeDeleted=\"{8}\" />", UndergroundCheck.IsEnabled, UndergroundCheck.AdminLevel, UndergroundCheck.MaxPing, UndergroundCheck.KillPlayer, UndergroundCheck.Announce, UndergroundCheck.JailEnabled, UndergroundCheck.KickEnabled, UndergroundCheck.BanEnabled, UndergroundCheck.DaysBeforeDeleted));
sw.WriteLine(string.Format(" <Tool Name=\"Voting\" Enable=\"{0}\" YourVotingSite=\"{1}\" APIKey=\"{2}\" DelayBetweenRewards=\"{3}\"/>", VoteReward.IsEnabled, VoteReward.YourVotingSite, VoteReward.APIKey, VoteReward.DelayBetweenRewards));
sw.WriteLine(string.Format(" <Tool Name=\"Voting\" Enable=\"{0}\" YourVotingSite=\"{1}\" APIKey=\"{2}\" DelayBetweenRewards=\"{3}\" RewardCount=\"{4}\" />", VoteReward.IsEnabled, VoteReward.YourVotingSite, VoteReward.APIKey, VoteReward.DelayBetweenRewards, VoteReward.RewardCount));
sw.WriteLine(string.Format(" <Tool Name=\"Watchlist\" Enable=\"{0}\" />", Watchlist.IsEnabled));
//sw.WriteLine(string.Format(" <Tool Name=\"WorldRadius\" Enable=\"{0}\" WorldSize=\"{1}\" ZoneWarnings=\"{2}\", ZoneProtection.IsEnabled, ZoneProtection.WorldSize, ZoneProtection.ZoneWarnings));
//sw.WriteLine(string.Format(" <Tool Name=\"WorldRadius\" Enable=\"{0}\" WorldSize=\"{1}\" ZoneWarnings=\"{2}\", WorldRadius.IsEnabled, WorldRadius.WorldSize, WorldRadius.ZoneWarnings));
sw.WriteLine(string.Format(" <Tool Name=\"ZoneProtection\" Enable=\"{0}\" KillMurderer=\"{1}\" JailEnabled=\"{2}\" KickEnabled=\"{3}\" BanEnabled=\"{4}\" />", ZoneProtection.IsEnabled, ZoneProtection.KillMurderer, ZoneProtection.JailEnabled, ZoneProtection.KickEnabled, ZoneProtection.BanEnabled));
sw.WriteLine(" </Tools>");
sw.WriteLine("</ServerTools>");
Expand Down
4 changes: 4 additions & 0 deletions ServerTools/src/Functions/LoadMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ public static void Load()
{
VoteReward.Unload();
}
if (VoteReward.IsEnabled)
{
VoteReward.RandomList();
}
if (!Watchlist.IsRunning && Watchlist.IsEnabled)
{
Watchlist.Load();
Expand Down
16 changes: 8 additions & 8 deletions ServerTools/src/HowTo/HowToSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class HowToSetup
{
private const string file = "HowToSetup.xml";
private static string filePath = string.Format("{0}/{1}", API.ConfigPath, file);
private const double version = 6.2;
private const double version = 6.4;

public static void HowToSeup()
{
Expand All @@ -15,15 +15,15 @@ public static void HowToSeup()
sw.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
sw.WriteLine("ServerTools - How to setup ServerTools");
sw.WriteLine(string.Format("Version = \"{0}\"/>", version));
sw.WriteLine("");
sw.WriteLine("");
sw.WriteLine();
sw.WriteLine();
sw.WriteLine("ServerTools was coded and tested under a Windows operating system. It should operate on other major O.S. but if you find bugs, report them to");
sw.WriteLine("https://github.com/dmustanger/7dtd-ServerTools/issues");
sw.WriteLine("");
sw.WriteLine("");
sw.WriteLine("ServerTools is compatible with 7 Days to Die version Alpha 16.");
sw.WriteLine("");
sw.WriteLine("");
sw.WriteLine();
sw.WriteLine();
sw.WriteLine("This version is compatible with 7 Days to Die version Alpha 16.");
sw.WriteLine();
sw.WriteLine();
sw.WriteLine("Tool Name=AdminChatCommands Enable=False");
sw.WriteLine("");
sw.WriteLine("");
Expand Down
Loading

0 comments on commit 5e11c25

Please sign in to comment.