- 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

@ -106,7 +106,7 @@ public class PermissionManager(Database.Database? database)
}
catch (Exception ex)
{
CS2_SimpleAdmin._logger?.LogError(ex.ToString());
CS2_SimpleAdmin._logger?.LogError("Unable to load admins from database! {exception}", ex.Message);
return [];
}
}
@ -224,7 +224,7 @@ public class PermissionManager(Database.Database? database)
}
catch (Exception ex)
{
CS2_SimpleAdmin._logger?.LogError(ex.ToString());
CS2_SimpleAdmin._logger?.LogError("Unable to load groups from database! {exception}", ex.Message);
}
return [];
@ -371,7 +371,6 @@ public class PermissionManager(Database.Database? database)
public async Task DeleteAdminBySteamId(string playerSteamId, bool globalDelete = false)
{
if (database == null) return;
if (string.IsNullOrEmpty(playerSteamId)) return;
//_adminCache.TryRemove(playerSteamId, out _);
@ -453,7 +452,7 @@ public class PermissionManager(Database.Database? database)
});
}
await Server.NextFrameAsync(() =>
await Server.NextWorldUpdateAsync(() =>
{
CS2_SimpleAdmin.Instance.ReloadAdmins(null);
});
@ -500,7 +499,7 @@ public class PermissionManager(Database.Database? database)
await connection.ExecuteAsync(insertGroupServer, new { groupId, server_id = globalGroup ? null : CS2_SimpleAdmin.ServerId });
await Server.NextFrameAsync(() =>
await Server.NextWorldUpdateAsync(() =>
{
CS2_SimpleAdmin.Instance.ReloadAdmins(null);
});
@ -508,7 +507,7 @@ public class PermissionManager(Database.Database? database)
}
catch (Exception ex)
{
CS2_SimpleAdmin._logger?.LogError(ex.ToString());
CS2_SimpleAdmin._logger?.LogError("Problem with loading admins: {exception}", ex.Message);
}
}