- Home /
How to check Time when player is join the room in Unity Photon Networking
i am working on multi-player game in unity using photon network. i have an issue of checking the time when players are joined the lobby or joined the room. i set the room Option max Player is 4. now i want that within 30 seconds the next level starts rather there will be 2 players or less than 5 or more than one who joined the lobby and i also want to know that if more than 5 users then how i will create another room for one user. how can i do this, anybody can tell me please.
Answer by tobiass · Apr 08, 2015 at 08:43 AM
You can easily create this workflow from within a room, as you can close it any time.
Do random matchmaking. Try to find any room and if there is none, create a new one. Every player does this.
Players in a room measure the time since the first player got in. After X seconds, the room gets closed (the Master Client sets PhotonNetwork.room.isOpen = false) and hidden (PhotonNetwork.room.isVisible = false). That takes the room out of random matchmaking. And you're done.
One exception: If there is only one player in the room, don't close it yet. Wait some longer.
@tobiass thanks a lot but i have one more issue that how time can be shown same to all players
Your answer
Follow this Question
Related Questions
Can we use "Photon cloud" for a card game like poker in Unity3d? 1 Answer
Photon Networking (Viking Demo) - GetRoomList() func not working 2 Answers
Using Photon to Send Screenshot to other Players 0 Answers
my sql + photon server( my cloud) 1 Answer
Photon Bike Racing Game Position Problem 0 Answers