diff --git a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/Endpoint.cs b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/Endpoint.cs index 4acef85e..61a3cce5 100644 --- a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/Endpoint.cs +++ b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/Endpoint.cs @@ -249,8 +249,9 @@ public bool Start(ushort port = 7070) return true; } - catch + catch (Exception e) { + Logger.ForceLogMessage(e.ToString(), ConsoleColor.Red); return false; } } diff --git a/UnityProject/Assets/LRMTestScene.unity b/UnityProject/Assets/LRMTestScene.unity index 13cf1965..04167cc1 100644 --- a/UnityProject/Assets/LRMTestScene.unity +++ b/UnityProject/Assets/LRMTestScene.unity @@ -1238,7 +1238,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: clientToServerTransport: {fileID: 1521806211} - serverIP: localhost + serverIP: 68.174.160.78 serverPort: 7777 endpointServerPort: 8080 heartBeatInterval: 3 @@ -1254,7 +1254,7 @@ MonoBehaviour: loadBalancerAddress: 127.0.0.1 serverName: My awesome server! extraServerData: Map 1 - maxServerPlayers: 10 + maxServerPlayers: 2 isPublicServer: 1 serverListUpdated: m_PersistentCalls: diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportOverrides.cs b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportOverrides.cs index 1b5b57e0..c1382d52 100644 --- a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportOverrides.cs +++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportOverrides.cs @@ -151,36 +151,40 @@ public override void ClientSend(int channelId, ArraySegment segment) } } -#if MIRROR_37_0_OR_NEWER - public override void ServerDisconnect(int connectionId) +#if !MIRROR_37_0_OR_NEWER + + public override bool ServerDisconnect(int connectionId) { if (_connectedRelayClients.TryGetBySecond(connectionId, out int relayId)) { int pos = 0; _clientSendBuffer.WriteByte(ref pos, (byte)OpCodes.KickPlayer); _clientSendBuffer.WriteInt(ref pos, relayId); - return; + return true; } if (_connectedDirectClients.TryGetBySecond(connectionId, out int directId)) - _directConnectModule.KickClient(directId); + return _directConnectModule.KickClient(directId); + + return false; } + #else - public override bool ServerDisconnect(int connectionId) + + public override void ServerDisconnect(int connectionId) { if (_connectedRelayClients.TryGetBySecond(connectionId, out int relayId)) { int pos = 0; _clientSendBuffer.WriteByte(ref pos, (byte)OpCodes.KickPlayer); _clientSendBuffer.WriteInt(ref pos, relayId); - return true; + return; } if (_connectedDirectClients.TryGetBySecond(connectionId, out int directId)) - return _directConnectModule.KickClient(directId); - - return false; + _directConnectModule.KickClient(directId); } + #endif #if MIRROR_40_0_OR_NEWER diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportRequests.cs b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportRequests.cs index 8dd1326b..a066ee2d 100644 --- a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportRequests.cs +++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportRequests.cs @@ -204,7 +204,7 @@ IEnumerator RetrieveMasterServerListFromLoadBalancer(LRMRegions region) case UnityWebRequest.Result.Success: relayServerList?.Clear(); - relayServerList = JsonUtilityHelper.FromJson(result.Decompress()).ToList(); + relayServerList = JsonUtilityHelper.FromJson(result).ToList(); serverListUpdated?.Invoke(); _serverListUpdated = true; break; @@ -217,7 +217,7 @@ IEnumerator RetrieveMasterServerListFromLoadBalancer(LRMRegions region) else { relayServerList?.Clear(); - relayServerList = JsonUtilityHelper.FromJson(result.Decompress()).ToList(); + relayServerList = JsonUtilityHelper.FromJson(result).ToList(); serverListUpdated?.Invoke(); _serverListUpdated = true; }