OnConnectionFail right after joining room.

This is only happening with certain rooms. But immediately after joining the room (no one is in the room but me) I get this error and it removes my player's object. It happens so fast, I can't even pause it in time to catch my objects creation (it gets created then immediately is gone)

Any ideas?

OnConnectionFail: DisconnectByServerLogic
UnityEngine.Debug:Log(Object)
ctgNetworkController:OnConnectionFail(DisconnectCause) (at Assets/Assets/Scripts/Networking/ctgNetworkController.cs:560)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
NetworkingPeer:SendMonoMessage(PhotonNetworkingMessage, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1612)
NetworkingPeer:OnStatusChanged(StatusCode) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1284)
ExitGames.Client.Photon.EnetPeer:ExecuteCommand(NCommand)
ExitGames.Client.Photon.<>c__DisplayClass11:<ReceiveIncomingCommands>b__f()
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:76)

Comments

  • Hey Carmine,

    the DisconnectByServerLogic error means that the server actively disconnected your client. The most likely reason is that the connection was "overloaded", i.e. the server sent too much data, which the client could not process in time, and after the server queued a certain amount of data, it finally decided that the client would not catch up and shut down the connection.

    Is it possible that you have lots of cached events for those rooms, which are sent when the client joins?
  • Nicole,
    I know this is (normally) the cause. But I literally only have 1 object in that room and other rooms with way more objects (and even the same) is fine.

    I can create this same exact objects in other rooms (dozens of them infact) but just 1 in this room makes it drop.
  • I figured it out....

    I'm storing room data (json string) in a room variable. One of my users made a HUUUUUUUUGE level and the json ended up being 50k! I guess I need to figure out a different way of doing this.

    Thanks Nicole for your help and putting me on the right path!
  • Oops :lol:

    I'm glad you figured it out, and thanks for sharing your insights!
Sign In or Register to comment.