- Added `IsAdminSilent` to api
- Fixed disabling noclip via admin menu
- Fixed (?) hibernation problem
- Added discord webhook fire when adding ban or mute for offline player
- Updated css and mysqlconnector
This commit is contained in:
Dawid Bepierszcz
2024-11-22 22:31:06 +01:00
parent 70a62d4b63
commit b2ebe136c3
17 changed files with 175 additions and 41 deletions

View File

@@ -86,6 +86,11 @@ public class PlayerManager
try
{
if (!CS2_SimpleAdmin.PlayersInfo.ContainsKey(userId))
{
Helper.KickPlayer(userId, NetworkDisconnectionReason.NETWORK_DISCONNECT_REJECT_INVALIDCONNECTION);
}
// Check if the player is banned
var isBanned = await CS2_SimpleAdmin.Instance.BanManager.IsPlayerBanned(CS2_SimpleAdmin.PlayersInfo[userId]);
@@ -194,7 +199,7 @@ public class PlayerManager
}
catch (Exception ex)
{
CS2_SimpleAdmin._logger?.LogError($"Error processing player connection: {ex}");
CS2_SimpleAdmin._logger?.LogError("Error processing player connection: {exception}", ex.Message);
}
});
@@ -263,7 +268,7 @@ public class PlayerManager
}
catch (Exception ex)
{
CS2_SimpleAdmin._logger?.LogError($"Unexpected error: {ex.Message}");
CS2_SimpleAdmin._logger?.LogError("Unexpected error: {exception}", ex.Message);
}
CS2_SimpleAdmin.BannedPlayers.Clear();