mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-09-27 20:17:04 +02:00
Compare commits
No commits in common. "main" and "build-1.8.2a" have entirely different histories.
main
...
build-1.8.
4 changed files with 6 additions and 12 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.2b";
|
public override string ModuleVersion => "1.8.2a";
|
||||||
|
|
||||||
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 ((ulong)record.Steamid != currentSteamId && currentSteamId != 0)
|
if (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 = (ulong)record.Steamid;
|
currentSteamId = 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(
|
||||||
(ulong)group.Key,
|
group.Key,
|
||||||
_ => ipSet,
|
_ => ipSet,
|
||||||
(_, existingSet) =>
|
(_, existingSet) =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,3 @@
|
||||||
namespace CS2_SimpleAdmin.Models;
|
namespace CS2_SimpleAdmin.Models;
|
||||||
|
|
||||||
public record IpHistoryRow
|
public record IpHistoryRow(ulong Steamid, string? Name, uint Address, DateTime Used_at);
|
||||||
{
|
|
||||||
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.2b
|
1.8.2a
|
||||||
Loading…
Add table
Add a link
Reference in a new issue