Master Client Disconnect

Options
Hello,

I develop a MMO-like game using PUN all by myself.
Everything is working fine and I learned a lot so far, but one thing bothers me:
When alone in a room and some other player joins the master clients disconnects if the master client's connection is very slow and has low upload bandwidth. I am aware of the cause and agree that's the client's problem in general, but maybe the engine can help the client to not disconnect, maybe by increasing timeouts etc...
Even when alone in a room, there are several photon views being active, which leads to the amount of data being sent to new clients.

Which leads to some questions:
1. Which timeouts have to be increased to achieve my goal?
2. how to detect that I must act for this particular situation?
3. how and where should I detected that a player joins and syncing starts. Is this even required or should I alter values for this particular client after joining the room without touching them again?

Any help is much appreciated!

in case it helps, here you can play/download the game:
http://www.i-show-you.de/orbs/

Blue

Comments

  • vadim
    Options
    1. For number of reasons, timeouts (defined by server) are not adjustable.
    2. Handle OnDisconnectedFromPhoton message and reconnect. Note that if client was master, after reconnection it will be plain client since mastership has been taken by next client in the room.
    3. Not quite understand what you are asking, OnJoinedRoom message is fired when clients joins the room and OnPhotonPlayerConnected when remote player joins the room.
  • Hello and thanks for your reply.

    1.hm, you mean your photon server I guess. OK.
    2. actually my goal is not to reconnect, my goal is to not disconnect.
    3. which 2 said, I know about all the events but the question is how can I use them to make the master client not to disconnect. What do I have to do, is there anything I could do about this at all? Can I temporarily decrease messages SENT?
  • vadim
    vadim mod
    edited December 2015
    Options
    1. I meant Photon cloud. Since Photon Server is under your control, you can change timeout settings: https://doc.photonengine.com/en/onpremise/current/getting-started/server-config
    2. You can't avoid disconnection if client can't exchange packets with server.
    3. I don't see how those messages can help. Decreasing messages count is good in general, especially under poor connection conditions or when you reach bandwidth limit . It's up to you how much you send. In any case, each second ping should be sent to the server (it may get stuck in queue if too many outgoing messages). Or server drops connection.
  • So in other words I get disconnected when the cloud does not receive a ping from the client. That does mean that the client was not able to send a ping within 1 second, correct? In other words, all the other messages block the ping from being sent. Why can my amount of messages block my ping being sent to the server? Shouldnt the ping have some kind of priority?
    By the way, I am not using Photon Server, not running with any authoritative server yet.
  • vadim
    Options
    Just checked client code, Ping sent from client if there is no outgoing reliable messages in queue (such messages, if they are delivered, are enough for server to regard client as alive). Unreliable messages sent in separate queue. So there is no problem with blocking sending queue in fact. But if packets can't get to the server, ping or other reliable command sending failed after several tries and client gets disconnected.
  • nice, that's good information.
    With this knownledge it is even more of a mystery why the master client disconnects while sending. This could only be possible if it doesnt even manage to send 1 message within 1 second? Sounds unreal... The connection to the cloud is defintly not broken or interrupted when the disconnect happens. It has something to do with the amount of data somehow.
    Maybe you could simulate very low upload bandwidth, run quite a handful of photonviews with some values to sync and then let another client join. You should be able to reproduce the issue.
    Btw I do not use any buffed RPCs, just plain auto serializing with OnPhotonSerializeView. I also store a few values in the room properties, but that should not be an issue either, right?
  • vadim
    Options
    As I wrote, client disconnects if it fails to send after several attempts at least one reliable message (OnPhotonSerializeView update e.g.).
    Check disconnection cause in OnConnectionFail(DisconnectCause cause) handler. The cause would be DisconnectByClientTimeout in described case.