how to close all rooms at a certain time
I'd like to close all game rooms (even though there are players in) at a certain time. For example, every monday 4:00am.
It seems rooms have more garbages as time goes by. Because of program or network errors. So I thought I need to close all rooms to start it all over once in a while.
I'm afraid if this is bad idea.
How can I close all rooms at the same time? Any Photon commands for this?
Or can I do this in the Photon homepage, not in the source codes?
I'm using PUN and Unity3D. Thanks for any help.
It seems rooms have more garbages as time goes by. Because of program or network errors. So I thought I need to close all rooms to start it all over once in a while.
I'm afraid if this is bad idea.
How can I close all rooms at the same time? Any Photon commands for this?
Or can I do this in the Photon homepage, not in the source codes?
I'm using PUN and Unity3D. Thanks for any help.
0
Comments
-
Hi @mhhk88,How can I close all rooms at the same time? Any Photon commands for this?There is no way to do this out-of-the-box. Do this from client code to force leaving rooms, disconnects or updates (new build with a new GameVersion/AppVersion) via custom events or custom authentication.
Or can I do this in the Photon homepage, not in the source codes?0 -
I see. Thanks.
Do these codes successfully close the room?
...if (PhotonNetwork.isMasterClient) { PhotonNetwork.room.visible = false; PhotonNetwork.room.open = false; PhotonView.RPC("ShowMsg", PhotonTargets.All, "Will close the room in a minute"); yield return new WaitForSeconds(60f); PhotonView.RPC("ForceCloseRoom", PhotonTargets.All); } [PunRPC] void ForceCloseRoom() { PhotonNetwork.LeaveRoom(); } [PunRPC] void ShowMsg() { //Show soon-to-be-disconnected message }
2 -
Thank you !!!0
-
thanks for the proposed theme0