Closed Biebras closed 1 year ago
Here is the fix:
private void ProcessData(int clientId, byte[] clientData, int channel, int sendTo = -1)
{
if(_cachedClientRooms.TryGetValue(clientId, out Room room) == false)
return;
if (room.hostId == clientId)
{
if (room.clients.Contains(sendTo))
{
SendData(clientData, channel, sendTo, clientId);
}
}
else
{
SendDataToRoomHost(clientId, clientData, channel, room);
}
}
fixed whit your PR that merged
The current function produces an error if the function tries to process data with a room that does not exist. This can happen for a few seconds when the host disconnects and a client sends a message to the room that does not exist.
These lines throw error: