Skip to content

Commit

Permalink
Revert GlobalKnownGoodActorCache logic
Browse files Browse the repository at this point in the history
  • Loading branch information
FallenDev committed Jan 3, 2025
1 parent 7f5abd3 commit 567fed4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Zolian.Server.Base/Network/Server/LobbyServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ protected override void OnConnected(Socket clientSocket)
return;
}

var foundIp = ServerSetup.Instance.GlobalKnownGoodActorsCache.Values.First(savedIp => savedIp == ipAddress.ToString());
if (!foundIp.IsEmpty())
foreach (var _ in ServerSetup.Instance.GlobalKnownGoodActorsCache.Values.Where(savedIp => savedIp == ipAddress.ToString()))
safe = true;

if (!safe)
Expand Down Expand Up @@ -206,7 +205,7 @@ private void OnDisconnect(object sender, EventArgs e)
var client = (ILobbyClient)sender!;
ClientRegistry.TryRemove(client.Id, out _);
}

private readonly HashSet<string> _bannedIPs = [];

private bool BannedIpCheck(string ip)
Expand Down
3 changes: 1 addition & 2 deletions Zolian.Server.Base/Network/Server/LoginServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,7 @@ protected override void OnConnected(Socket clientSocket)
client.OnDisconnected += OnDisconnect;
var safe = false;

var foundIp = ServerSetup.Instance.GlobalKnownGoodActorsCache.Values.First(savedIp => savedIp == ipAddress.ToString());
if (StringExtensions.IsEmpty(foundIp))
foreach (var _ in ServerSetup.Instance.GlobalKnownGoodActorsCache.Values.Where(savedIp => savedIp == ipAddress.ToString()))
safe = true;

if (!safe)
Expand Down
3 changes: 1 addition & 2 deletions Zolian.Server.Base/Network/Server/WorldServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3225,8 +3225,7 @@ protected override void OnConnected(Socket clientSocket)
client.OnDisconnected += OnDisconnect;
var safe = false;

var foundIp = ServerSetup.Instance.GlobalKnownGoodActorsCache.Values.First(savedIp => savedIp == ipAddress.ToString());
if (!foundIp.IsEmpty())
foreach (var _ in ServerSetup.Instance.GlobalKnownGoodActorsCache.Values.Where(savedIp => savedIp == ipAddress.ToString()))
safe = true;

if (!safe)
Expand Down

0 comments on commit 567fed4

Please sign in to comment.