IP address banning
- IP address banning **Require CounterStrikeSharp v98**
This commit is contained in:
parent
0f32daa4c0
commit
d16b92e694
7 changed files with 137 additions and 16 deletions
12
Events.cs
12
Events.cs
|
|
@ -46,7 +46,17 @@ namespace CS2_SimpleAdmin
|
|||
|
||||
BanManager _banManager = new(dbConnectionString);
|
||||
MuteManager _muteManager = new(dbConnectionString);
|
||||
bool isBanned = _banManager.IsPlayerBanned(player.AuthorizedSteamID.SteamId64.ToString());
|
||||
|
||||
bool isBanned = false;
|
||||
if (player.IpAddress != null)
|
||||
{
|
||||
isBanned = _banManager.IsPlayerBanned(player.AuthorizedSteamID.SteamId64.ToString(), player.IpAddress.Split(":")[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
isBanned = _banManager.IsPlayerBanned(player.AuthorizedSteamID.SteamId64.ToString());
|
||||
}
|
||||
|
||||
List<dynamic> activeMutes = _muteManager.IsPlayerMuted(player.AuthorizedSteamID.SteamId64.ToString());
|
||||
|
||||
if (activeMutes.Count > 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue