Kick player if the App (Android) is paused/in background

Options

Hi,

I want to kick a player, even if the app (android) of that player is in background, e.g. paused.

I tried sending RPC/RaiseEvent and PhotonNetwork.CloseConnection + EnableCloseConnection = true. The PhotonNetwork.KeepAliveInBackground is set to 5 minutes.

Maybe this is because the message queue for incoming messages is not handled if the app is paused. Is there a way to start another background thread etc. which can maybe read certain messages while in background. Or, is there a way to tell the server (without plugin), to close the connected (maybe via a scripting-hook or the like)?

Thank you.

Regards

André

Answers

  • Tobias
    Options

    PUN 2 had a built-in event sent to someone to please kindly leave the room but as you figured out, this could be ignored or does not always work (if that person is in background or not dispatching messages). We disabled this in a recent PUN 2 update but it could be enabled and used with the known limitations.

    There is no built-in server-side kick feature. It would be extremely easy and powerful to exploit.

    If you wanted to have this, you'd have to implement a Photon Server Plugin and customize the logic server side.

  • AndreWe
    Options

    Thank you. I guess we will leave it like it is for now and will add the Server Plugin in the mid term.