Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Build for SMod 3.10.2, fixing some typos (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rnen committed Jul 1, 2022
1 parent 5906f24 commit 26a0095
Show file tree
Hide file tree
Showing 28 changed files with 92 additions and 92 deletions.
2 changes: 1 addition & 1 deletion AdminToolbox/AdminToolbox/API/ATWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace AdminToolbox.API
{
using API.Webhook;
/// <summary>
/// Static <see cref="AdminToolbox"/> class that contains all of the plugins web-based methods
/// Static <see cref="AdminToolbox"/> class that contains all of the plugin web-based methods
/// </summary>
public static class ATWeb
{
Expand Down
6 changes: 3 additions & 3 deletions AdminToolbox/AdminToolbox/API/ExtentionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ internal static bool IsPermitted(this ICommandSender sender, string[] commandKey
{
command.Trim();
if (string.IsNullOrEmpty(command)) continue;
//Gets a array of whitelisted users (if any)
//Gets a array of white-listed users (if any)
string[] configList = ConfigManager.Manager.Config.GetListValue("admintoolbox_" + command.ToLower() + "_whitelist", new string[0]);
if (configList.Length > 0)
validConfigs++;
if (configList.ContainsPlayer(pl))
return true;
}
string reply = "You are not permitted to use the (" + string.Join(" / ", commandKey) + ") command!";
denied = mustBeListed ? new string[] { reply, "You are required to be spesificly whitelisted to use this command." } : new string[] { reply };
denied = mustBeListed ? new string[] { reply, "You are required to be specifically white-listed to use this command." } : new string[] { reply };
return (mustBeListed || ConfigManager.Manager.Config.GetBoolValue("admintoolbox_whitelist_required", false)) && validConfigs < 1
? false
: !(validConfigs > 0);
Expand All @@ -128,7 +128,7 @@ internal static bool IsPermitted(this ICommandSender sender, string[] commandKey
}
catch
{
denied = new string[] { "Error during command whitelist calculation!" };
denied = new string[] { "Error during command white-list calculation!" };
return false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions AdminToolbox/AdminToolbox/API/GetFromString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static Player GetPlayer(string arg)
}

/// <summary>
/// Gets list of players from <see cref="string"/> <paramref name="name"/> param
/// Gets list of players from <see cref="string"/> <paramref name="name"/> parameter
/// </summary>
/// <returns><see cref="System.Array"/> of <see cref="Player"/></returns>
public static Player[] GetGroup(string name)
Expand All @@ -69,7 +69,7 @@ public static Player[] GetGroup(string name)
}

/// <summary>
/// Gets list of players from <see cref="string"/> <paramref name="name"/> param
/// Gets list of players from <see cref="string"/> <paramref name="name"/> parameter
/// </summary>
/// <returns><see cref="System.Array"/> of <see cref="Player"/></returns>
public static Player[] GetRole(string name)
Expand All @@ -84,7 +84,7 @@ public static Player[] GetRole(string name)
}

/// <summary>
/// Gets list of players from <see cref="string"/> <paramref name="name"/> param
/// Gets list of players from <see cref="string"/> <paramref name="name"/> parameter
/// </summary>
/// <returns><see cref="System.Array"/> of <see cref="Player"/></returns>
public static Player[] GetTeam(string name)
Expand Down
4 changes: 2 additions & 2 deletions AdminToolbox/AdminToolbox/API/JailHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static bool SendToJail(Smod2.API.Player player, DateTime? jailedToTime)
if (a != AmmoType.NONE)
psetting.Ammo[a] = player.GetAmmo(a);
}
//Changes role to Tutorial, teleports to jail, removes inv.
//Changes role to Tutorial, teleport to jail, removes inventory.
Debug($"Variables stored, sending \"{player.Name}\" to jail");
player.ChangeRole(Smod2.API.RoleType.TUTORIAL, true, false);
player.Teleport(JailPos, true);
Expand All @@ -102,7 +102,7 @@ public static bool ReturnFromJail(Player player)
Debug("Return: Player or UserID null/empty");
return false;
}
Debug($"Attempting to unjail \"{player.Name}\"");
Debug($"Attempting to un-jail \"{player.Name}\"");
if (AdminToolbox.ATPlayerDict.TryGetValue(player.UserID, out PlayerSettings psetting))
{
psetting.isJailed = false;
Expand Down
6 changes: 3 additions & 3 deletions AdminToolbox/AdminToolbox/API/SetPlayerVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace AdminToolbox.API
public static class SetPlayerVariables
{
/// <summary>
/// For setting <see cref="API.PlayerSettings"/> bools by <paramref name="UserID"/>
/// For setting <see cref="API.PlayerSettings"/> booleans by <paramref name="UserID"/>
/// <para>Returns false if <paramref name="UserID"/> is not in <see cref="AdminToolbox.ATPlayerDict"/></para>
/// </summary>
public static bool SetPlayerBools(string UserID, bool? spectatorOnly = null, bool? godMode = null, bool? dmgOff = null, bool? destroyDoor = null, bool? keepSettings = null, bool? lockDown = null, bool? instantKill = null, bool? isJailed = null)
Expand All @@ -30,13 +30,13 @@ public static bool SetPlayerBools(string UserID, bool? spectatorOnly = null, boo

}
/// <summary>
/// For setting <see cref="API.PlayerSettings"/> bools on a <see cref="Player"/>
/// For setting <see cref="API.PlayerSettings"/> booleans on a <see cref="Player"/>
/// <para>Returns false if <paramref name="player"/>'s UserID is not in <see cref="AdminToolbox.ATPlayerDict"/></para>
/// </summary>
public static bool SetPlayerBools(Player player, bool? spectatorOnly = null, bool? godMode = null, bool? dmgOff = null, bool? destroyDoor = null, bool? keepSettings = null, bool? lockDown = null, bool? instantKill = null, bool? isJailed = null)
=> SetPlayerBools(player.UserID, spectatorOnly, godMode, dmgOff, destroyDoor, keepSettings, lockDown, instantKill, isJailed);
/// <summary>
/// For setting <see cref="API.PlayerSettings"/> bools on a list of <see cref="Player"/>s
/// For setting <see cref="API.PlayerSettings"/> booleans on a list of <see cref="Player"/>s
/// <para>Returns false if one or more of <paramref name="players"/> UserID's is not in <see cref="AdminToolbox.ATPlayerDict"/></para>
/// </summary>
public static bool SetPlayerBools(List<Player> players, bool? spectatorOnly = null, bool? godMode = null, bool? dmgOff = null, bool? destroyDoor = null, bool? keepSettings = null, bool? lockDown = null, bool? instantKill = null, bool? isJailed = null)
Expand Down
4 changes: 2 additions & 2 deletions AdminToolbox/AdminToolbox/API/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ internal static DiscordWebhook BuildBanWebhook(Player player, int duration, stri
{
DiscordWebhook webH;
List<Field> listOfFields = new List<Field>();
CultureInfo timeFormat = new CultureInfo("ja-JP");
listOfFields.AddField("Playername: ", player?.Name ?? "TEST", true);
CultureInfo timeFormat = new CultureInfo("ja-JP"); //Don't ask why Japanese, I just liked the formatting.
listOfFields.AddField("Player-name: ", player?.Name ?? "TEST", true);
listOfFields.AddField("Duration: ", (duration / 60).ToString("0", CultureInfo.InvariantCulture) + " minutes", true);
listOfFields.AddField("Timespan: ", $"[{DateTime.UtcNow.ToString(timeFormat)}] -> [{DateTime.UtcNow.AddSeconds(duration).ToString(timeFormat)}]");
if (!string.IsNullOrEmpty(reason))
Expand Down
30 changes: 15 additions & 15 deletions AdminToolbox/AdminToolbox/AdminToolbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ namespace AdminToolbox
version = AT_Version + "-" + AT_Revision,
SmodMajor = 3,
SmodMinor = 10,
SmodRevision = 0
SmodRevision = 2
)]
public class AdminToolbox : Plugin
{
internal const string AT_Version = "1.3.9";
internal const string AT_Version = "1.3.10";
internal const string AT_Revision = "0";
internal const string SModLetter = "";

Expand All @@ -40,12 +40,12 @@ public class AdminToolbox : Plugin
public static readonly LogManager LogManager = new LogManager();

/// <summary>
/// The plugin's instance instance of <see cref="Managers.WarpManager"/>
/// The plugin's instance of <see cref="Managers.WarpManager"/>
/// </summary>
public static readonly WarpManager WarpManager = new WarpManager();

/// <summary>
/// The plugin's instance instance of <see cref="Managers.ATFile"/>
/// The plugin's instance of <see cref="Managers.ATFile"/>
/// </summary>
public static readonly ATFile FileManager = new ATFile();

Expand Down Expand Up @@ -171,22 +171,22 @@ internal void RegisterCommands()
internal void UnRegisterCommands() => PluginManager.CommandManager.UnregisterCommands(this);
internal void RegisterConfigs()
{
#region Core-configs
#region Core-configurations
this.AddConfig(new ConfigSetting("admintoolbox_enable", true, true, "Enable/Disable AdminToolbox"));
this.AddConfig(new ConfigSetting("admintoolbox_colors", false, true, "Enable/Disable AdminToolbox colors in server window"));
this.AddConfig(new ConfigSetting("admintoolbox_tracking", true, true, "Appends the AdminToolbox version to your server name, this is for tracking how many servers are running the plugin"));
#endregion

this.AddConfig(new ConfigSetting("admintoolbox_tutorial_dmg_allowed", new int[] { -1 }, true, "What (int)damagetypes TUTORIAL is allowed to take"));
this.AddConfig(new ConfigSetting("admintoolbox_tutorial_dmg_allowed", new int[] { -1 }, true, "What (int)damage-types TUTORIAL is allowed to take"));

#region Debug
this.AddConfig(new ConfigSetting("admintoolbox_debug_damagetypes", Utility.HumanDamageTypes, true, "What (int)damagetypes to debug"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_damagetypes", Utility.HumanDamageTypes, true, "What (int)damage-types to debug"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_server_damage", false, true, "Debugs damage dealt by server"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_spectator_damage", false, true, "Debugs damage done to/by spectators"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_tutorial_damage", false, true, "Debugs damage done to tutorial"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_player_damage", false, true, "Debugs damage to all players except teammates"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_friendly_damage", false, true, "Debugs damage to teammates"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_player_kill", false, true, "Debugs player kills except teamkills"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_player_kill", false, true, "Debugs player kills except team-kills"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_friendly_kill", true, true, "Debugs team-kills"));
this.AddConfig(new ConfigSetting("admintoolbox_debug_scp_and_self_killed", false, true, "Debug suicides and SCP kills"));
#endregion
Expand All @@ -196,29 +196,29 @@ internal void RegisterConfigs()
this.AddConfig(new ConfigSetting("admintoolbox_round_damagemultiplier", 1f, true, "Damage multiplier"));
this.AddConfig(new ConfigSetting("admintoolbox_decontamination_damagemultiplier", 1f, true, "Damage multiplier for the decontamination of LCZ"));
this.AddConfig(new ConfigSetting("admintoolbox_friendlyfire_damagemultiplier", 1f, true, "Damage multiplier for friendly fire"));
this.AddConfig(new ConfigSetting("admintoolbox_pocketdimention_damagemultiplier", 1f, true, "Damage multiplier for pocket dimention damage"));
this.AddConfig(new ConfigSetting("admintoolbox_pocketdimention_damagemultiplier", 1f, true, "Damage multiplier for pocket dimension damage"));
#endregion
#region Cards
this.AddConfig(new ConfigSetting("admintoolbox_custom_nuke_cards", false, true, "Enables the use of custom keycards for the activation of the nuke"));
this.AddConfig(new ConfigSetting("admintoolbox_custom_nuke_cards", false, true, "Enables the use of custom key-cards for the activation of the nuke"));
this.AddConfig(new ConfigSetting("admintoolbox_nuke_card_list", new int[] { (int)ItemType.KeycardContainmentEngineer, (int)ItemType.KeycardFacilityManager, (int)ItemType.KeycardO5 }, true, "List of all cards that can enable the nuke"));
#endregion
#region Log-Stuff
this.AddConfig(new ConfigSetting("admintoolbox_log_teamkills", false, true, "Writing logfiles for teamkills"));
this.AddConfig(new ConfigSetting("admintoolbox_log_kills", false, true, "Writing logfiles for regular kills"));
this.AddConfig(new ConfigSetting("admintoolbox_log_commands", false, true, "Writing logfiles for all AT command usage"));
this.AddConfig(new ConfigSetting("admintoolbox_log_teamkills", false, true, "Writing log-files for team-kills"));
this.AddConfig(new ConfigSetting("admintoolbox_log_kills", false, true, "Writing log-files for regular kills"));
this.AddConfig(new ConfigSetting("admintoolbox_log_commands", false, true, "Writing log-files for all AT command usage"));

this.AddConfig(new ConfigSetting("admintoolbox_round_info", true, true, "Prints round count and player number on round start & end"));
this.AddConfig(new ConfigSetting("admintoolbox_player_join_info", true, true, "Writes player name in console on players joining"));
#endregion
#region Intercom
//this.AddConfig(new Smod2.Config.ConfigSetting("admintoolbox_intercom_whitelist", new string[] { string.Empty }, Smod2.Config.SettingType.LIST, true, "What ServerRank can use the Intercom to your specified settings"));
this.AddConfig(new ConfigSetting("admintoolbox_intercom_UserID_blacklist", new string[0], true, "Blacklist of UserID's that cannot use the intercom"));
this.AddConfig(new ConfigSetting("admintoolbox_intercomlock", false, true, "If set to true, locks the command for all non-whitelist players"));
this.AddConfig(new ConfigSetting("admintoolbox_intercomlock", false, true, "If set to true, locks the command for all non- white-list players"));
#endregion

this.AddConfig(new ConfigSetting("admintoolbox_block_role_damage", new string[0], true, "What roles cannot attack other roles"));

this.AddConfig(new ConfigSetting("admintoolbox_ban_webhooks", new string[0], true, "Links to channel webhooks for bans"));
this.AddConfig(new ConfigSetting("admintoolbox_ban_webhooks", new string[0], true, "Links to channel web-hooks for bans"));
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions AdminToolbox/AdminToolbox/Commands/AT_TemplateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public string[] OnCall(ICommandSender sender, string[] args)

if (args.Length > 0)
{
//Get player from first arguement of OnCall
//Get player from first argument of OnCall
Player targetPlayer = Server.GetPlayers(args[0]).FirstOrDefault();

//If player could not be found, return reply to command user
Expand All @@ -41,7 +41,7 @@ public string[] OnCall(ICommandSender sender, string[] args)
}
else if (caller != null)
{
//Do something on calling player without any arguements
//Do something on calling player without any arguments
return new string[] { "We did something to player: " + caller.Name + "!" };
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class IntercomLockCommand : ICommandHandler
private readonly AdminToolbox plugin;

public IntercomLockCommand(AdminToolbox plugin) => this.plugin = plugin;
public string GetCommandDescription() => "Enables/Disables the intercom for non-whitelisted players";
public string GetCommandDescription() => "Enables/Disables the intercom for non- white-listed players";
public string GetUsage() => "(" + string.Join(" / ", CommandAliases) + ") <bool>";

public static readonly string[] CommandAliases = new string[] { "INTERCOMLOCK", "INTERLOCK", "ILOCK", "IL" };
Expand Down
2 changes: 1 addition & 1 deletion AdminToolbox/AdminToolbox/Commands/Facility/JailCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public string[] OnCall(ICommandSender sender, string[] args)
return new string[] { "\"" + myPlayer.Name + "\" sent to jail for 1 year" };
}
else
return new string[] { "Failed to jail/unjail " + myPlayer.Name + "!", "Error: Player not in dictionary" };
return new string[] { "Failed to jail/un-jail " + myPlayer.Name + "!", "Error: Player not in dictionary" };
}
else
return new string[] { GetUsage() };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace AdminToolbox.Command
using API.Extentions;
public class WarpsCommmand : ICommandHandler
{
public string GetCommandDescription() => "Returns a list of warps. Use arguement \"Refresh\" to reload warps from file";
public string GetCommandDescription() => "Returns a list of warps. Use argument \"Refresh\" to reload warps from file";
public string GetUsage() => "(" + string.Join(" / ", CommandAliases) + ") <REFRESH / R>";

public static readonly string[] CommandAliases = new string[] { "WARPS", "ATWARPS", "WARPLIST" };
Expand Down
2 changes: 1 addition & 1 deletion AdminToolbox/AdminToolbox/Commands/Player/EmptyCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private string[] DropItems(Player player, Smod2.API.ItemType itemFilter = Smod2.
Smod2.API.ItemType ammoFlag = Smod2.API.ItemType.AMMO_12_GAUGE | Smod2.API.ItemType.AMMO_44_CAL | Smod2.API.ItemType.AMMO_556_X45 | Smod2.API.ItemType.AMMO_762_X39 | Smod2.API.ItemType.AMMO_9_X19;

if (player == null)
return new string[] { "Player not spesified!" };
return new string[] { "Player not specified!" };
if (player.PlayerRole.RoleID == Smod2.API.RoleType.NONE)
return new string[] { "Player not properly initialized!" };
if (player.PlayerRole.RoleID == Smod2.API.RoleType.SPECTATOR)
Expand Down
20 changes: 10 additions & 10 deletions AdminToolbox/AdminToolbox/Commands/Player/GodModeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class GodModeCommand : ICommandHandler

private Server Server => PluginManager.Manager.Server;

public string GetCommandDescription() => "Switch on/off godmode for player";
public string GetCommandDescription() => "Switch on/off god-mode for player";
public string GetUsage() => "(" + string.Join(" / ", CommandAliases) + ") [PLAYER] (BOOL)";

public static readonly string[] CommandAliases = new string[] { "ATGOD", "ATGODMODE", "AT-GOD", "AT-GODMODE" };
Expand Down Expand Up @@ -46,9 +46,9 @@ public string[] OnCall(ICommandSender sender, string[] args)
playerNum++;
}
}
outPut += "\nSet " + playerNum + " player's AT-Godmode to " + j;
if (changedState) return new string[] { "\n" + "Set " + playerNum + " player's AT-Godmode to " + j, "\n" + "NoDmg for theese " + playerNum + " players set to: " + j };
return new string[] { "\n" + "Set " + playerNum + " player's AT-Godmode to " + j };
outPut += "\nSet " + playerNum + " player's AT-God-mode to " + j;
if (changedState) return new string[] { "\n" + "Set " + playerNum + " player's AT-God-ode to " + j, "\n" + "NoDmg for " + playerNum + " players set to: " + j };
return new string[] { "\n" + "Set " + playerNum + " player's AT-God-mode to " + j };
}
else
{
Expand All @@ -62,12 +62,12 @@ public string[] OnCall(ICommandSender sender, string[] args)
if (AdminToolbox.ATPlayerDict.TryGetValue(pl.UserID, out PlayerSettings psetting))
psetting.godMode = !psetting.godMode;
}
return new string[] { "Toggled all players AT-Godmodes" };
return new string[] { "Toggled all players AT-God-modes" };
}
}
else if (args[0].ToLower() == "list" || args[0].ToLower() == "get")
{
string str = "\n" + "Players with AT-Godmode enabled: " + "\n";
string str = "\n" + "Players with AT-God-mode enabled: " + "\n";
List<string> myPlayerList = new List<string>();
foreach (Player pl in Server.GetPlayers())
{
Expand All @@ -85,7 +85,7 @@ public string[] OnCall(ICommandSender sender, string[] args)
str += "\n - " + item;
}
}
else str = "\n" + "No players with \"AT-Godmode\" enabled!";
else str = "\n" + "No players with \"AT-God-mode\" enabled!";
return new string[] { str };
}
Player myPlayer = GetFromString.GetPlayer(args[0]);
Expand All @@ -101,15 +101,15 @@ public string[] OnCall(ICommandSender sender, string[] args)
if (changedValue)
{
pls.dmgOff = pls.godMode;
return new string[] { myPlayer.Name + " AT-Godmode: " + pls.godMode, myPlayer.Name + " No Dmg: " + pls.dmgOff };
return new string[] { myPlayer.Name + " AT-God-mode: " + pls.godMode, myPlayer.Name + " No Dmg: " + pls.dmgOff };
}
else
return new string[] { myPlayer.Name + " AT-Godmode: " + pls.godMode };
return new string[] { myPlayer.Name + " AT-God-mode: " + pls.godMode };
}
else
{
pls.godMode = !pls.godMode;
return new string[] { myPlayer.Name + " AT-Godmode: " + pls.godMode };
return new string[] { myPlayer.Name + " AT-God-mode: " + pls.godMode };
}
}
else
Expand Down

0 comments on commit 26a0095

Please sign in to comment.