Fix unessesary memory allocation

This commit is contained in:
twoischnig committed 2026-04-13 05:50:52 +02:00
1 parent 5cd58eeec5
commit 57855e80e3
2 files changed
+3 -18

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "com.incobyte.lobbyclient",
"version": "1.0.4",
"version": "1.0.5",
"displayName": "Game Lobby Client",
"description": "Provides a client for the game lobby server to list and join lobbies",
"unity": "2022.3",
+2 -17
View File
@@ -56,24 +56,9 @@ namespace Lobbies
}
}
public IEnumerable<LobbyClientEvent> ReadEvents(int maxEvents)
public bool TryReadEvent(out LobbyClientEvent result)
{
if (events.Count > 0)
{
maxEvents = Math.Min(maxEvents, events.Count);
while (maxEvents > 0)
{
if(events.TryDequeue(out var _event))
{
yield return _event;
}
else
{
break;
}
}
}
return events.TryDequeue(out result);
}
public void HostLobby(Guid gameId, string name, int gameMode, int maxPlayerCount, string? password, int port)