mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Merge branch 'master' of https://github.com/vis2k/Mirror
This commit is contained in:
commit
98b6328f76
@ -99,7 +99,7 @@ void ReceiveThreadFunction(string ip, int port)
|
|||||||
// if we got here then we are done. ReceiveLoop cleans up already,
|
// if we got here then we are done. ReceiveLoop cleans up already,
|
||||||
// but we may never get there if connect fails. so let's clean up
|
// but we may never get there if connect fails. so let's clean up
|
||||||
// here too.
|
// here too.
|
||||||
client.Close();
|
client?.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Connect(string ip, int port)
|
public void Connect(string ip, int port)
|
||||||
|
@ -42,7 +42,7 @@ public bool TryDequeue(out T result)
|
|||||||
{
|
{
|
||||||
lock(queue)
|
lock(queue)
|
||||||
{
|
{
|
||||||
result = default;
|
result = default(T);
|
||||||
if (queue.Count > 0)
|
if (queue.Count > 0)
|
||||||
{
|
{
|
||||||
result = queue.Dequeue();
|
result = queue.Dequeue();
|
||||||
|
@ -230,6 +230,10 @@ public void Stop()
|
|||||||
|
|
||||||
// clear clients list
|
// clear clients list
|
||||||
clients.Clear();
|
clients.Clear();
|
||||||
|
|
||||||
|
// reset the counter in case we start up again so
|
||||||
|
// clients get connection ID's starting from 1
|
||||||
|
counter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// send message to client using socket connection.
|
// send message to client using socket connection.
|
||||||
|
Loading…
Reference in New Issue
Block a user