mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-09-27 20:17:04 +02:00
Compare commits
1 commit
build-1.8.
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf284bd121 |
4 changed files with 12 additions and 6 deletions
|
|
@ -22,7 +22,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||||
public override string ModuleName => "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)");
|
public override string ModuleName => "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)");
|
||||||
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
||||||
public override string ModuleAuthor => "daffyy";
|
public override string ModuleAuthor => "daffyy";
|
||||||
public override string ModuleVersion => "1.8.2a";
|
public override string ModuleVersion => "1.8.2b";
|
||||||
|
|
||||||
public override void Load(bool hotReload)
|
public override void Load(bool hotReload)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,14 @@ internal class CacheManager: IDisposable
|
||||||
foreach (var record in ipHistory)
|
foreach (var record in ipHistory)
|
||||||
{
|
{
|
||||||
// When we encounter a new steamid, save the previous one
|
// When we encounter a new steamid, save the previous one
|
||||||
if (record.Steamid != currentSteamId && currentSteamId != 0)
|
if ((ulong)record.Steamid != currentSteamId && currentSteamId != 0)
|
||||||
{
|
{
|
||||||
_playerIpsCache[currentSteamId] = currentIpSet;
|
_playerIpsCache[currentSteamId] = currentIpSet;
|
||||||
currentIpSet = new HashSet<IpRecord>(new IpRecordComparer());
|
currentIpSet = new HashSet<IpRecord>(new IpRecordComparer());
|
||||||
latestIpTimestamps.Clear();
|
latestIpTimestamps.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
currentSteamId = record.Steamid;
|
currentSteamId = (ulong)record.Steamid;
|
||||||
|
|
||||||
// Only keep the latest timestamp for each IP
|
// Only keep the latest timestamp for each IP
|
||||||
if (!latestIpTimestamps.TryGetValue(record.Address, out var existingTimestamp) ||
|
if (!latestIpTimestamps.TryGetValue(record.Address, out var existingTimestamp) ||
|
||||||
|
|
@ -307,7 +307,7 @@ internal class CacheManager: IDisposable
|
||||||
);
|
);
|
||||||
|
|
||||||
_playerIpsCache.AddOrUpdate(
|
_playerIpsCache.AddOrUpdate(
|
||||||
group.Key,
|
(ulong)group.Key,
|
||||||
_ => ipSet,
|
_ => ipSet,
|
||||||
(_, existingSet) =>
|
(_, existingSet) =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
namespace CS2_SimpleAdmin.Models;
|
namespace CS2_SimpleAdmin.Models;
|
||||||
|
|
||||||
public record IpHistoryRow(ulong Steamid, string? Name, uint Address, DateTime Used_at);
|
public record IpHistoryRow
|
||||||
|
{
|
||||||
|
public long Steamid { get; init; }
|
||||||
|
public string? Name { get; init; }
|
||||||
|
public uint Address { get; init; }
|
||||||
|
public DateTime Used_at { get; init; }
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
1.8.2a
|
1.8.2b
|
||||||
Loading…
Add table
Add a link
Reference in a new issue