Getting 'Only server can disconnect players' on NetworkRunner.Disconnect RPC.

Options

Hello Photonians,

We have recently started using Fusion as per recommendation from Photon staff. We are attempting to handle disconnecting from a room, and are receiving the 'Only server can disconnect players' error.

This image is a snippet of the script with the relevant code shown (not the whole script).

The NetworkRunner is created on Start, and myPlayer is assigned when you create/join a room.

We CAN disconnect if we are host, we CANNOT disconnect if we are client. From my understanding, if the client hits the disconnect button, it should call DisconnectSelf(), which passes the client NetworkRunner, client PlayerRef, and PlayerRef.None to ensure that the DisconnectPlayer() call runs on the server (docs clearly state PlayerRef.None ensures the server receives the call, and executes it on the server). As a result, the server should call runner.Disconnect().

When the client calls the DisconnectSelf() method, the server never calls the RPC call. We know this from a print statement earlier. The client, however, does execute the method as it throws the 'Only server can disconnect players' error. Can anyone help me out and tell me why this happens, and how to properly set this up?

Thank you.