Game shuts down immediately after 2 seconds when the second player joins to the game.

Madara47
Madara47
edited August 1 in Photon Server
Hello guys, I've been trying to get local server work for about 2 weeks. I asked many photon progorammers and the said to me to share this problem in the forum hopping that someone could help me in this problem..

Description :
-I have a game that worked perfectly with no errors on the photon cloud.
-Then, I've downloaded photon server so I can play the game locally for more performance and less latency.
-I've set up the server exactly as in the guide.
-I can connect to the game via local play with 1 player, the game run so fast with no errors.
-Game shuts down immediately after 2 seconds when the second player joins to the game for all players. And error (unexpected msgType 5) shows for both players.


Errors details :
unexpected msgType 5
0x00007FFB7F948F6C (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F94BD59 (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F93BCC8 (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB80AC4B73 (UnityPlayer) PAL_Memory_Free
0x00007FFB803FE4B5 (UnityPlayer) PAL_Thread_YieldExecution
0x0000017A97DED43E (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x0000017A97DED39B (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000017A97E00570 (Mono JIT Code) [Logger.cs:61] UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x0000017A97E5E755 (Mono JIT Code) [Debug.bindings.cs:127] UnityEngine.Debug:LogError (object)
0x0000017A9B08374B (Mono JIT Code) [LoadBalancingClient.cs:2394] Photon.Realtime.LoadBalancingClient:DebugReturn (ExitGames.Client.Photon.DebugLevel,string)
0x0000017A97E5E6FC (Mono JIT Code) ExitGames.Client.Photon.PeerBase/<>c__DisplayClass109_0:<EnqueueDebugReturn>b__0 ()
0x0000017A963125D5 (Mono JIT Code) ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands ()
0x0000017A96312220 (Mono JIT Code) ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands ()
0x0000017A96311FFB (Mono JIT Code) [PhotonHandler.cs:208] Photon.Pun.PhotonHandler:Dispatch ()
0x0000017A96311F3B (Mono JIT Code) [PhotonHandler.cs:143] Photon.Pun.PhotonHandler:FixedUpdate ()
0x0000017AF0264E80 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FFB7EC4BC80 (mono-2.0-bdwgc) mono_get_runtime_build_info
0x00007FFB7EBD1D92 (mono-2.0-bdwgc) mono_perfcounters_init
0x00007FFB7EBDAD8F (mono-2.0-bdwgc) mono_runtime_invoke
0x00007FFB80398E4D (UnityPlayer) PAL_Thread_YieldExecution
0x00007FFB80395E14 (UnityPlayer) PAL_Thread_YieldExecution
0x00007FFB803756F9 (UnityPlayer) PAL_Thread_YieldExecution
0x00007FFB803757AD (UnityPlayer) PAL_Thread_YieldExecution
0x00007FFB7FDAF310 (UnityPlayer) UnityMain
0x00007FFB7FDB5E5D (UnityPlayer) UnityMain
0x00007FFB80064662 (UnityPlayer) UnityMain
0x00007FFB80053A77 (UnityPlayer) UnityMain
0x00007FFB80053B45 (UnityPlayer) UnityMain
0x00007FFB800572AF (UnityPlayer) UnityMain
0x00007FFB7F97FCF2 (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F97E4FA (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F982CA9 (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F98693B (UnityPlayer) UnityMain
0x00007FF6FDDE11F2 (MyTestGame)
0x00007FFBF7C17034 (KERNEL32) BaseThreadInitThunk
0x00007FFBF9342651 (ntdll) RtlUserThreadStart

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Coroutine couldn't be started because the the game object 'EquipmentPickerWindow' is inactive!
0x00007FFB7F948F6C (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F94BD59 (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F93BCC8 (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB80AC4B73 (UnityPlayer) PAL_Memory_Free
0x00007FFB8037FDEE (UnityPlayer) PAL_Thread_YieldExecution
0x00007FFB8040E540 (UnityPlayer) PAL_Thread_YieldExecution
0x0000017A9B053089 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.MonoBehaviour:StartCoroutineManaged2 (UnityEngine.MonoBehaviour,System.Collections.IEnumerator)
0x0000017A9B052E2B (Mono JIT Code) [MonoBehaviour.bindings.cs:91] UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
0x0000017ABD521D93 (Mono JIT Code) [vItemWindow.cs:101] Invector.vItemManager.vItemWindow:CreateEquipmentWindow (System.Collections.Generic.List`1<Invector.vItemManager.vItem>,System.Collections.Generic.List`1<Invector.vItemManager.vItemType>,Invector.vItemManager.vItem,UnityEngine.Events.UnityAction`1<Invector.vItemManager.vItemSlot>,UnityEngine.Events.UnityAction`1<Invector.vItemManager.vItemSlot>)
0x0000017ABD521927 (Mono JIT Code) [vEquipArea.cs:140] Invector.vItemManager.vEquipArea:OnSubmitSlot (Invector.vItemManager.vItemSlot)
0x0000017ABD521651 (Mono JIT Code) [vItemSlot.cs:360] Invector.vItemManager.vItemSlot:OnPointerClick (UnityEngine.EventSystems.PointerEventData)
0x0000017ABD52157B (Mono JIT Code) [vEquipSlot.cs:76] Invector.vItemManager.vEquipSlot:OnPointerClick (UnityEngine.EventSystems.PointerEventData)
0x0000017A963717B9 (Mono JIT Code) [ExecuteEvents.cs:51] UnityEngine.EventSystems.ExecuteEvents:Execute (UnityEngine.EventSystems.IPointerClickHandler,UnityEngine.EventSystems.BaseEventData)
0x0000017A9630D0C2 (Mono JIT Code) [ExecuteEvents.cs:261] UnityEngine.EventSystems.ExecuteEvents:Execute<T_REF> (UnityEngine.GameObject,UnityEngine.EventSystems.BaseEventData,UnityEngine.EventSystems.ExecuteEvents/EventFunction`1<T_REF>)
0x0000017A9636A5A3 (Mono JIT Code) [StandaloneInputModule.cs:196] UnityEngine.EventSystems.StandaloneInputModule:ReleaseMouse (UnityEngine.EventSystems.PointerEventData,UnityEngine.GameObject)
0x0000017A9635EA33 (Mono JIT Code) [StandaloneInputModule.cs:646] UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress (UnityEngine.EventSystems.PointerInputModule/MouseButtonEventData)
0x0000017A96357F2B (Mono JIT Code) [StandaloneInputModule.cs:553] UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent (int)
0x0000017A96357E0B (Mono JIT Code) [StandaloneInputModule.cs:533] UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent ()
0x0000017A963573AB (Mono JIT Code) [StandaloneInputModule.cs:291] UnityEngine.EventSystems.StandaloneInputModule:Process ()
0x0000017A963160FF (Mono JIT Code) [EventSystem.cs:378] UnityEngine.EventSystems.EventSystem:Update ()
0x0000017AED567120 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FFB7EC4BC80 (mono-2.0-bdwgc) mono_get_runtime_build_info
0x00007FFB7EBD1D92 (mono-2.0-bdwgc) mono_perfcounters_init
0x00007FFB7EBDAD8F (mono-2.0-bdwgc) mono_runtime_invoke
0x00007FFB80398E4D (UnityPlayer) PAL_Thread_YieldExecution
0x00007FFB80395E14 (UnityPlayer) PAL_Thread_YieldExecution
0x00007FFB803756F9 (UnityPlayer) PAL_Thread_YieldExecution
0x00007FFB803757AD (UnityPlayer) PAL_Thread_YieldExecution
0x00007FFB7FDAF100 (UnityPlayer) UnityMain
0x00007FFB7FDB5B7D (UnityPlayer) UnityMain
0x00007FFB800653F9 (UnityPlayer) UnityMain
0x00007FFB80053A77 (UnityPlayer) UnityMain
0x00007FFB80053B45 (UnityPlayer) UnityMain
0x00007FFB800572AF (UnityPlayer) UnityMain
0x00007FFB7F97FCF2 (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F97E4FA (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F982CA9 (UnityPlayer) PAL_Thread_SupportsThreads
0x00007FFB7F98693B (UnityPlayer) UnityMain
0x00007FF6FDDE11F2 (MyTestGame)
0x00007FFBF7C17034 (KERNEL32) BaseThreadInitThunk
0x00007FFBF9342651 (ntdll) RtlUserThreadStart

(Filename: C:\buildslave\unity\build\Runtime/Mono/MonoBehaviour.cpp Line: 725)

Comments

  • RayF
    RayF
    edited August 1
    Sorry, you are self-hosting
  • RayF wrote: »
    Sorry, you are self-hosting

    Yes ofcourse. I'm trying to get mygame works on local network.
  • The message (type 5) is a disconnect message. Look into your server's logs.
    Also update the client, so it's able to handle it.
  • @Tobias Thanks for replying ,
    there is many I'm going to check them : " GSGame , MSMaster , NameServer , PhotonCLR , Photon-20210803 and Photon-LoadBalancing-20210803 "
  • I've got an error and a warning in GSGame.Log :
    "2021-08-03 09:51:33,834 [23] ERROR Photon.SocketServer.PeerBase - Limit exceeded: OpCode_248 rate exceeded. limit_1, rate_2, dataRate_32, errorCode=-35, dataLen_16, peer=GameClientPeer: PID: 6, IsConnected: True, IsDisposed: False, Last Activity: Operation 253 at UTC 2021-08-03T06:51:33, in Room 'TestRoomGame_TC2', IP 192.168.1.107:53364, NetworkProtocol Udp, Protocol GpBinaryV16, JoinStage: 12 "
    .
    .
    "2021-08-03 09:51:52,005 [21] WARN Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - s2s MS connection: connection closed (id=1, reason=0, detail=), serverId=1ef5227e-1713-43b6-91da-a81abd0bdcfd"

    and got a warning in MSMaster.Log
    "2021-08-03 09:51:52,005 [19] WARN Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer - s2s GS connection: OnDisconnect - game server connection closed (connectionId=1, addr:{null}, serverId=1ef5227e-1713-43b6-91da-a81abd0bdcfd, reason=2)"
  • OpCode 248 is for ChangeGroups. Apparently the Server SDK applies a limit to changing interest groups and this is kicking the player.
    I would refer you to the doc about the new limits but could not find this particular one in the page.
    Will ask a colleague to chime in.
  • Tobias wrote: »
    OpCode 248 is for ChangeGroups. Apparently the Server SDK applies a limit to changing interest groups and this is kicking the player.
    I would refer you to the doc about the new limits but could not find this particular one in the page.
    Will ask a colleague to chime in.

    Thanks for the quick response, I'm glad to hear that.
    Can't wait to hear from you guys..
  • hi, @Madara47

    first lets make it clear what is an operation rate. The operation rate is average values that we collected for last 8 seconds. so, if last 8 seconds you managed to send 15 operations than your rate will be 1. (integer division). if you managed to send 16-23 operations your rate will be 2. and boom. player is disconencted.

    so, yes, you can increase the ChangeGroups rate. this can be done in GameServer.xml.config section Photon/GameServer/Limits/Inbound/Operations/ChangeGroupsRate. default value is 1

    However I'm very curious why do you send ChangeGroups operation so often?

    best,
    ilya
  • chvetsov wrote: »
    hi, @Madara47

    first lets make it clear what is an operation rate. The operation rate is average values that we collected for last 8 seconds. so, if last 8 seconds you managed to send 15 operations than your rate will be 1. (integer division). if you managed to send 16-23 operations your rate will be 2. and boom. player is disconencted.

    so, yes, you can increase the ChangeGroups rate. this can be done in GameServer.xml.config section Photon/GameServer/Limits/Inbound/Operations/ChangeGroupsRate. default value is 1

    However I'm very curious why do you send ChangeGroups operation so often?

    best,
    ilya

    :o:o:o:o:o:o:o:o:o:o:o:o:o !!!
    Wow!! @chvetsov
    it works like a charm !!
    I've tried <ChangeGroupsRate>2</ChangeGroupsRate>
    then 3,4 and finally it works on 5.

    I'm not sure what is "Change Groups " and why it sends too many operations So I'm going to go deeper in this problem and reply to you as soon as possible.

    Thanks alot.
  • @Madara47 ChangeGroups operation is used to group players. Like rad and blue team in capture the flag. and once players are grouped you are able to send messages only to group members. Something like team chat.

    I do not see at all why you have to send 5 times per second change group operation

    best,
    ilya
  • @chvetsov I didn't know that, Thanks for the info. Yes actually we are using teams in our game.
    We set the team once a player join the room, he can then change the team before the match start. Does ChangeGroupsRate affect the server/client side performnce alot ?
  • chvetsov
    chvetsov mod
    edited August 4
    @Madara47 5 times per second every of your players sends this operation to server. for 4 players 20 times per second. What for? even if its influence is negligible still it creates traffic that does not make any sense at all.

    again it might be ok for good connection however it might be that sand particle that will break connection for someone on mobile connection.

    you have to be very careful here. traffic should be as lean as possible

    best,
    ilya
  • @chvetsov
    You are right !
    There is a script called NetworkCulling which cause most of changing groups operations ..
    working on customizing it right now..
    best,
    Thank you
  • I just realized how bad of a script the culling is. Yes, it makes sense to customize it, definitely.