Simulating connection loss (temporary, not timeout)

My game relies on master client to handle concurrency and race conditions.

So I need a way to simulate if the master loses connection for a fixed amount of seconds.

I know of PhotonNetwork.NetworkingClient.SimulateConnectionLoss(true), that works but it times out the client, I need a temporary loss of connection.

Also is there a way to change the timeout time, i think it is 10 seconds now?

Comments

  • Tobias
    Tobias admin
    You can call the method again, after X seconds, to stop simulating a loss.

    If you are on Windows, use the tool Clumsy. It's very lightweight and can drop packages for a while (between start and stop clicks in the UI).

    The timeout time can not be changed server side, when using the Cloud.
    PhotonNetwork.NetworkingClient.LoadBalancingPeer.DisconnectTimeout sets the client's timeout.