mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-21 11:28:14 +00:00
1.3.0a
- 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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user