How to temporarily make a player "immune" to timeouts?

Options
Hello!

The situation with our application is the following: We use one scene for logging in and joining a room. Then once in a room we load the actual online scene using PhotonNetwork.LoadLevel. Then, when loading the online scene, we instantiate a bunch of stuff.

Now, previously this hasn't caused any issues, but in a specific scenario when there's lots of data to instantiate it takes too long (15 seconds), and once the scene is finished loading, I get immediately booted from the server ("Reason: DisconnectedByServer").

I assume this is because of a time out - by the time the local client sends data to the server, the server has already ditched us.

I can think of a number of ways to work around this, but I'd like to ask if there is some sort of a functionality where I could ask the server to keep the local user "on hold", not expecting any data, and then I could resume after instantiation is complete. Is this possible?

Comments

  • iikka
    Options
    Doing more tests, I don't think it's actually a timeout, but maybe the buffer overflow issue.

    I tried adding a PhotonNetwork.SendAllOutgoingCommands(); to our loop that instantiates our scene, and so far it seems this has stopped the disconnect from happening. However this might just be good luck, and it might be that next time we get a larger scene instantiation going on we'll run into the same issue.

    Does the reverse of that method exist, something like PhotonNetwork.ReceiveAllIncomingCommands()? (that specific method does not exist)? I feel like being able to both receive and send data during the instantiation would solve our issues. We'll probably later move into doing the instantiation over multiple frames which should mean that this issue is fixed, but in the meanwhile I'd like to be sure that it's working and something like this could probably help.