Skip to content

Commit

Permalink
Invoke Disconnect earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
Chykary committed Jun 12, 2021
1 parent 3e53022 commit b6c1e38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions NextClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ private void OnConnectionStatusChanged(SteamNetConnectionStatusChangedCallback_t
}
}
}
else if (param.m_info.m_eState == ESteamNetworkingConnectionState.k_ESteamNetworkingConnectionState_ClosedByPeer)
else if (param.m_info.m_eState == ESteamNetworkingConnectionState.k_ESteamNetworkingConnectionState_ClosedByPeer || param.m_info.m_eState == ESteamNetworkingConnectionState.k_ESteamNetworkingConnectionState_ProblemDetectedLocally)
{
Debug.Log("Connection was closed by peer.");
Debug.Log($"Connection was closed by peer, {param.m_info.m_szEndDebug}");
Disconnect();
}
else
{
Debug.Log($"Connection state changed: {param.m_info.m_eState.ToString()}");
Debug.Log($"Connection state changed: {param.m_info.m_eState.ToString()} - {param.m_info.m_szEndDebug}");
}
}

Expand Down
2 changes: 1 addition & 1 deletion NextServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void OnConnectionStatusChanged(SteamNetConnectionStatusChangedCallback_t
OnConnected.Invoke(connectionId);
Debug.Log($"Client with SteamID {clientSteamID} connected. Assigning connection id {connectionId}");
}
else if (param.m_info.m_eState == ESteamNetworkingConnectionState.k_ESteamNetworkingConnectionState_ClosedByPeer)
else if (param.m_info.m_eState == ESteamNetworkingConnectionState.k_ESteamNetworkingConnectionState_ClosedByPeer || param.m_info.m_eState == ESteamNetworkingConnectionState.k_ESteamNetworkingConnectionState_ProblemDetectedLocally)
{
if (connToMirrorID.TryGetValue(param.m_hConn, out int connId))
{
Expand Down

0 comments on commit b6c1e38

Please sign in to comment.