mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-17 18:39:07 +00:00
1.7.2b
- Revert temp fix for kick
This commit is contained in:
@@ -11,7 +11,7 @@ using MySqlConnector;
|
|||||||
|
|
||||||
namespace CS2_SimpleAdmin;
|
namespace CS2_SimpleAdmin;
|
||||||
|
|
||||||
[MinimumApiVersion(286)]
|
[MinimumApiVersion(300)]
|
||||||
public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdminConfig>
|
public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdminConfig>
|
||||||
{
|
{
|
||||||
internal static CS2_SimpleAdmin Instance { get; private set; } = new();
|
internal static CS2_SimpleAdmin Instance { get; private set; } = new();
|
||||||
@@ -19,7 +19,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
public override string ModuleName => "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)");
|
public override string ModuleName => "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)");
|
||||||
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
||||||
public override string ModuleAuthor => "daffyy & Dliix66";
|
public override string ModuleAuthor => "daffyy & Dliix66";
|
||||||
public override string ModuleVersion => "1.7.2a";
|
public override string ModuleVersion => "1.7.2b";
|
||||||
|
|
||||||
public override void Load(bool hotReload)
|
public override void Load(bool hotReload)
|
||||||
{
|
{
|
||||||
@@ -56,8 +56,6 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
|
|
||||||
public override void OnAllPluginsLoaded(bool hotReload)
|
public override void OnAllPluginsLoaded(bool hotReload)
|
||||||
{
|
{
|
||||||
new ServerManager().CheckHibernationStatus();
|
|
||||||
|
|
||||||
AddTimer(3.0f, () => ReloadAdmins(null));
|
AddTimer(3.0f, () => ReloadAdmins(null));
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.287" />
|
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.300" />
|
||||||
<PackageReference Include="Dapper" Version="2.1.35" />
|
<PackageReference Include="Dapper" Version="2.1.35" />
|
||||||
<PackageReference Include="MySqlConnector" Version="2.4.0" />
|
<PackageReference Include="MySqlConnector" Version="2.4.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="*" />
|
<PackageReference Include="Newtonsoft.Json" Version="*" />
|
||||||
|
|||||||
@@ -365,6 +365,8 @@ value.WaitingForKick)
|
|||||||
if (Config.OtherSettings.ReloadAdminsEveryMapChange && ServerLoaded && ServerId != null)
|
if (Config.OtherSettings.ReloadAdminsEveryMapChange && ServerLoaded && ServerId != null)
|
||||||
AddTimer(3.0f, () => ReloadAdmins(null));
|
AddTimer(3.0f, () => ReloadAdmins(null));
|
||||||
|
|
||||||
|
AddTimer(1.0f, () => new ServerManager().CheckHibernationStatus());
|
||||||
|
|
||||||
// AddTimer(34, () =>
|
// AddTimer(34, () =>
|
||||||
// {
|
// {
|
||||||
// if (!ServerLoaded)
|
// if (!ServerLoaded)
|
||||||
|
|||||||
@@ -144,8 +144,8 @@ internal static class Helper
|
|||||||
if (player == null || !player.IsValid || player.IsHLTV)
|
if (player == null || !player.IsValid || player.IsHLTV)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (player.UserId.HasValue)
|
if (player.UserId.HasValue && CS2_SimpleAdmin.PlayersInfo.TryGetValue(player.UserId.Value, out var value))
|
||||||
CS2_SimpleAdmin.PlayersInfo[player.UserId.Value].WaitingForKick = true;
|
value.WaitingForKick = true;
|
||||||
|
|
||||||
player.CommitSuicide(true, true);
|
player.CommitSuicide(true, true);
|
||||||
|
|
||||||
@@ -156,16 +156,16 @@ internal static class Helper
|
|||||||
if (!player.IsValid || player.IsHLTV)
|
if (!player.IsValid || player.IsHLTV)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Server.ExecuteCommand($"kickid {player.UserId}");
|
// Server.ExecuteCommand($"kickid {player.UserId}");
|
||||||
|
|
||||||
// player.Disconnect(reason); Broken after last update
|
player.Disconnect(reason);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Server.ExecuteCommand($"kickid {player.UserId}");
|
// Server.ExecuteCommand($"kickid {player.UserId}");
|
||||||
|
|
||||||
// player.Disconnect(reason); // Broken after last update
|
player.Disconnect(reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CS2_SimpleAdmin.UnlockedCommands && reason == NetworkDisconnectionReason.NETWORK_DISCONNECT_REJECT_BANNED)
|
if (CS2_SimpleAdmin.UnlockedCommands && reason == NetworkDisconnectionReason.NETWORK_DISCONNECT_REJECT_BANNED)
|
||||||
@@ -189,8 +189,8 @@ internal static class Helper
|
|||||||
if (!player.IsValid || player.IsHLTV)
|
if (!player.IsValid || player.IsHLTV)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (player.UserId.HasValue)
|
if (player.UserId.HasValue && CS2_SimpleAdmin.PlayersInfo.TryGetValue(player.UserId.Value, out var value))
|
||||||
CS2_SimpleAdmin.PlayersInfo[player.UserId.Value].WaitingForKick = true;
|
value.WaitingForKick = true;
|
||||||
|
|
||||||
player.CommitSuicide(true, true);
|
player.CommitSuicide(true, true);
|
||||||
|
|
||||||
@@ -211,15 +211,15 @@ internal static class Helper
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
Server.ExecuteCommand($"kickid {player.UserId}");
|
// Server.ExecuteCommand($"kickid {player.UserId}");
|
||||||
// player.Disconnect(reason); // Broken after last update
|
player.Disconnect(reason);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Server.ExecuteCommand($"kickid {player.UserId}");
|
// Server.ExecuteCommand($"kickid {player.UserId}");
|
||||||
|
|
||||||
// player.Disconnect(reason); // Broken after last update
|
player.Disconnect(reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CS2_SimpleAdmin.UnlockedCommands && reason == NetworkDisconnectionReason.NETWORK_DISCONNECT_REJECT_BANNED)
|
if (CS2_SimpleAdmin.UnlockedCommands && reason == NetworkDisconnectionReason.NETWORK_DISCONNECT_REJECT_BANNED)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.7.2a
|
1.7.2b
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.287" />
|
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.300" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user