mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-12-11 20:15:10 +01:00
okay actually do make copy
This commit is contained in:
parent
35cb05b953
commit
600b00bb7f
@ -2,6 +2,7 @@
|
||||
using Steamworks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace SteamTransport;
|
||||
|
||||
@ -102,7 +103,8 @@ public class Server
|
||||
{
|
||||
var ppOutMessages = new IntPtr[Util.MaxMessages];
|
||||
|
||||
foreach (var conn in _conns)
|
||||
// receive can result in disconnect, which modifies the collection. we must copy
|
||||
foreach (var conn in _conns.ToList())
|
||||
{
|
||||
var numMessages = SteamNetworkingSockets.ReceiveMessagesOnConnection(conn, ppOutMessages, ppOutMessages.Length);
|
||||
for (var i = 0; i < numMessages; i++)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user