mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-12-11 20:15:10 +01:00
do more mirror work
This commit is contained in:
parent
54f15d6481
commit
75e2f47111
@ -40,7 +40,7 @@ public class Client
|
||||
IsConnected = false;
|
||||
_transport.OnClientError?.Invoke(TransportError.ConnectionClosed, t.m_info.m_szEndDebug);
|
||||
_transport.OnClientDisconnected?.Invoke();
|
||||
// mirror will shutdown transport
|
||||
// OnClientDisconnected will causes mirror to shutdown the transport
|
||||
break;
|
||||
}
|
||||
});
|
||||
@ -80,6 +80,7 @@ public class Client
|
||||
_transport.OnClientDataSent?.Invoke(segment, channelId);
|
||||
else
|
||||
_transport.OnClientError?.Invoke(TransportError.InvalidSend, $"send returned {result}");
|
||||
// i dont think we have to check for disconnect result here since the status change handles that
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -106,6 +107,7 @@ public class Client
|
||||
var result = SteamNetworkingSockets.FlushMessagesOnConnection(_conn);
|
||||
if (result != EResult.k_EResultOK)
|
||||
_transport.OnClientError?.Invoke(TransportError.Unexpected, $"flush returned {result}");
|
||||
// i dont think we have to check for disconnect result here since the status change handles that
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@ -116,7 +118,6 @@ public class Client
|
||||
IsConnected = false;
|
||||
// should this do error?
|
||||
_transport.OnClientDisconnected?.Invoke();
|
||||
// mirror will shutdown transport
|
||||
|
||||
_onStatusChanged.Dispose();
|
||||
}
|
||||
|
||||
@ -125,6 +125,7 @@ public static class Program
|
||||
try
|
||||
{
|
||||
var running = true;
|
||||
transport.OnClientDisconnected = () => running = false; // mirror normally does this
|
||||
while (running)
|
||||
{
|
||||
transport.ClientEarlyUpdate();
|
||||
|
||||
@ -73,6 +73,7 @@ public class Server
|
||||
_transport.OnServerDataSent?.Invoke(connectionId, segment, channelId);
|
||||
else
|
||||
_transport.OnServerError?.Invoke(connectionId, TransportError.InvalidSend, $"send returned {result}");
|
||||
// i dont think we have to check for disconnect result here since the status change handles that
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -105,6 +106,7 @@ public class Server
|
||||
var result = SteamNetworkingSockets.FlushMessagesOnConnection(conn);
|
||||
if (result != EResult.k_EResultOK)
|
||||
_transport.OnServerError?.Invoke((int)conn.m_HSteamNetConnection, TransportError.Unexpected, $"flush returned {result}");
|
||||
// i dont think we have to check for disconnect result here since the status change handles that
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user