diff --git a/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/RelayHandler/RelayHandlerRoomMethods.cs b/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/RelayHandler/RelayHandlerRoomMethods.cs index 93f8b5d..622d69a 100644 --- a/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/RelayHandler/RelayHandlerRoomMethods.cs +++ b/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/RelayHandler/RelayHandlerRoomMethods.cs @@ -145,6 +145,7 @@ namespace LightReflectiveMirror { for (int i = 0; i < rooms.Count; i++) { + // if host left if (rooms[i].hostId == clientId) { int pos = 0; @@ -167,6 +168,7 @@ namespace LightReflectiveMirror } else { + // if the person that tried to kick wasnt host and it wasnt the client leaving on their own if (requiredHostId != -1 && rooms[i].hostId != requiredHostId) continue; @@ -180,6 +182,19 @@ namespace LightReflectiveMirror Program.transport.ServerSend(rooms[i].hostId, 0, new ArraySegment(sendBuffer, 0, pos)); _sendBuffers.Return(sendBuffer); + + // temporary solution to kicking bug + // this tells the local player that got kicked that he, well, got kicked. + pos = 0; + sendBuffer = _sendBuffers.Rent(1); + + sendBuffer.WriteByte(ref pos, (byte)OpCodes.ServerLeft); + + Program.transport.ServerSend(clientId, 0, new ArraySegment(sendBuffer, 0, pos)); + _sendBuffers.Return(sendBuffer); + + //end temporary solution + Endpoint.RoomsModified(); _cachedClientRooms.Remove(clientId); } diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LightReflectiveMirrorTransport.cs b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LightReflectiveMirrorTransport.cs index 5e9bab3..8b3efc7 100644 --- a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LightReflectiveMirrorTransport.cs +++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LightReflectiveMirrorTransport.cs @@ -200,7 +200,7 @@ namespace LightReflectiveMirror break; case OpCodes.ServerLeft: - // Called when we were kicked, or server was closed. + // Called when server was closed. if (_isClient) { _isClient = false; diff --git a/UnityProject/ProjectSettings/ProjectSettings.asset b/UnityProject/ProjectSettings/ProjectSettings.asset index c371b5d..c0a9369 100644 --- a/UnityProject/ProjectSettings/ProjectSettings.asset +++ b/UnityProject/ProjectSettings/ProjectSettings.asset @@ -517,7 +517,7 @@ PlayerSettings: 13: MIRROR;MIRROR_17_0_OR_NEWER;MIRROR_18_0_OR_NEWER;MIRROR_24_0_OR_NEWER;MIRROR_26_0_OR_NEWER;MIRROR_27_0_OR_NEWER;MIRROR_28_0_OR_NEWER;MIRROR_29_0_OR_NEWER;MIRROR_30_0_OR_NEWER;MIRROR_30_5_2_OR_NEWER;MIRROR_32_1_2_OR_NEWER;MIRROR_32_1_4_OR_NEWER;MIRROR_35_0_OR_NEWER;MIRROR_35_1_OR_NEWER platformArchitecture: {} scriptingBackend: - Standalone: 1 + Standalone: 0 il2cppCompilerConfiguration: {} managedStrippingLevel: {} incrementalIl2cppBuild: {}