- Fixed crashing on servers with a lot of players
- Every command chat message respect player language for now css_lang or use https://github.com/aprox2/GeoLocationLanguageManagerPlugin to detect language related on player ip
- Fixed css_respawn
- Fixed css_vote player can't vote multiple times
- Added TeamSwitchType to config, if set to 0 plugin always slay player on css_team command
- Minor changes
This commit is contained in:
Dawid Bepierszcz
2024-02-04 13:25:15 +01:00
parent 93faad27c1
commit 131030a2cd
11 changed files with 687 additions and 623 deletions

View File

@@ -1,5 +1,6 @@
using CounterStrikeSharp.API.Modules.Entities;
using Dapper;
using System.Collections.Concurrent;
namespace CS2_SimpleAdmin
{
@@ -8,8 +9,8 @@ namespace CS2_SimpleAdmin
private readonly Database _database;
// Unused for now
//public static readonly ConcurrentDictionary<string, ConcurrentBag<string>> _adminCache = new ConcurrentDictionary<string, ConcurrentBag<string>>();
public static readonly HashSet<SteamID> _adminCacheSet = new HashSet<SteamID>();
public static readonly Dictionary<SteamID, DateTime?> _adminCacheTimestamps = new Dictionary<SteamID, DateTime?>();
public static readonly ConcurrentDictionary<SteamID, DateTime?> _adminCache = new ConcurrentDictionary<SteamID, DateTime?>();
//public static readonly ConcurrentDictionary<SteamID, DateTime?> _adminCacheTimestamps = new ConcurrentDictionary<SteamID, DateTime?>();
public AdminSQLManager(Database database)
{
@@ -216,10 +217,10 @@ namespace CS2_SimpleAdmin
if (!string.IsNullOrEmpty(steamIdStr) && SteamID.TryParse(steamIdStr, out var steamId) && steamId != null)
{
if (!_adminCacheSet.Contains(steamId))
if (!_adminCache.ContainsKey(steamId))
{
_adminCacheSet.Add(steamId);
_adminCacheTimestamps.Add(steamId, ends);
_adminCache.TryAdd(steamId, ends);
//_adminCacheTimestamps.Add(steamId, ends);
}
Helper.GivePlayerFlags(steamId, flags, (uint)immunity);