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

Commit

Permalink
1.3.4
Browse files Browse the repository at this point in the history
 - Fixed broken 1.3.3 build
 - Apparently, i cannot use the AdminToolbox class as base for another class >:c Probally logical, i'm just experimenting with code
  • Loading branch information
Rnen committed Aug 13, 2018
1 parent 47ee5a0 commit c2d2ff1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions AdminToolbox/AdminToolbox/AdminToolbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace AdminToolbox
name = "Admin Toolbox",
description = "Plugin for advanced admin tools",
id = "rnen.admin.toolbox",
version = "1.3.3",
version = "1.3.4",
SmodMajor = 3,
SmodMinor = 1,
SmodRevision = 12
Expand Down Expand Up @@ -101,7 +101,7 @@ public override void Register()
this.AddEventHandlers(new RoundEventHandler(this), Priority.Normal);
this.AddEventHandler(typeof(IEventHandlerPlayerHurt), new DamageDetect(this), Priority.Normal);
this.AddEventHandler(typeof(IEventHandlerPlayerDie), new DieDetect(this), Priority.Normal);
this.AddEventHandlers(new MyMiscEvents(), Priority.Normal);
this.AddEventHandlers(new MyMiscEvents(this), Priority.Normal);
#endregion
#region Commands Registering Commands
// Register Commands
Expand Down Expand Up @@ -535,7 +535,7 @@ private static string ToMax(string text, int max)
return text;
}
}
class SetPlayerVariables : AdminToolbox
class SetPlayerVariables
{
public static void SetPlayerBools(string steamID, 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
10 changes: 8 additions & 2 deletions AdminToolbox/AdminToolbox/MyMiscEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@

namespace AdminToolbox
{
class MyMiscEvents : AdminToolbox, IEventHandlerIntercom, IEventHandlerDoorAccess, IEventHandlerSpawn, IEventHandlerWaitingForPlayers, IEventHandlerAdminQuery, IEventHandlerLure, IEventHandlerContain106, IEventHandlerPlayerJoin, IEventHandlerUpdate, IEventHandlerSetRole, IEventHandlerWarheadStartCountdown
class MyMiscEvents : IEventHandlerIntercom, IEventHandlerDoorAccess, IEventHandlerSpawn, IEventHandlerWaitingForPlayers, IEventHandlerAdminQuery, IEventHandlerLure, IEventHandlerContain106, IEventHandlerPlayerJoin, IEventHandlerUpdate, IEventHandlerSetRole, IEventHandlerWarheadStartCountdown
{
private Plugin plugin;

public MyMiscEvents(Plugin plugin)
{
this.plugin = plugin;
}
public void OnIntercom(PlayerIntercomEvent ev)
{
AdminToolbox.AddMissingPlayerVariables(new List<Player> { ev.Player });
Expand Down Expand Up @@ -77,7 +83,7 @@ public void OnSpawn(PlayerSpawnEvent ev)
public void OnWaitingForPlayers(WaitingForPlayersEvent ev)
{
AdminToolbox.lockRound = false;
if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_enable", true, false) == false) this.pluginManager.DisablePlugin(plugin);
if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_enable", true, false) == false) this.plugin.pluginManager.DisablePlugin(plugin);
if (!AdminToolbox.isColoredCommand) AdminToolbox.isColored = ConfigManager.Manager.Config.GetBoolValue("admintoolbox_colors", false);
if (!AdminToolbox.intercomLockChanged) AdminToolbox.intercomLock = ConfigManager.Manager.Config.GetBoolValue("admintoolbox_intercomlock", false);
//this.plugin.Info(System.Reflection.Assembly.GetExecutingAssembly().Location);
Expand Down
4 changes: 2 additions & 2 deletions AdminToolbox/AdminToolbox/RoundEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace AdminToolbox
{
class RoundEventHandler : SetPlayerVariables, IEventHandlerRoundStart, IEventHandlerRoundEnd, IEventHandlerRoundRestart, IEventHandlerCheckRoundEnd
class RoundEventHandler : IEventHandlerRoundStart, IEventHandlerRoundEnd, IEventHandlerRoundRestart, IEventHandlerCheckRoundEnd
{
private Plugin plugin;

Expand Down Expand Up @@ -89,7 +89,7 @@ public void OnRoundRestart(RoundRestartEvent ev)
AdminToolbox.lockRound = false;
if (AdminToolbox.playerdict.Count > 0)
foreach (KeyValuePair<string, AdminToolbox.AdminToolboxPlayerSettings> item in AdminToolbox.playerdict)
if (!item.Value.keepSettings && !item.Value.isJailed) SetPlayerBools(item.Key, spectatorOnly: false, godMode: false, dmgOff: false, destroyDoor: false, lockDown: false, instantKill: false);
if (!item.Value.keepSettings && !item.Value.isJailed) SetPlayerVariables.SetPlayerBools(item.Key, spectatorOnly: false, godMode: false, dmgOff: false, destroyDoor: false, lockDown: false, instantKill: false);
}
}
}

0 comments on commit c2d2ff1

Please sign in to comment.