Kick player if the App (Android) is paused/in background
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Kick player if the App (Android) is paused/in background
AndreWe
2021-12-17 03:54:18
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é
Comments
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.
Thank you. I guess we will leave it like it is for now and will add the Server Plugin in the mid term.
Back to top