poker multiplayer game get freeze on masterclient side
Options
multiplayer poker game get freeze when 5 or 6 round runs.i have got few coroutines.wanna know what is the reason for this? is there any method to stop this? and master player have to wait until minimum two players to join to begin the game..i have used yield return wait until co routine for that. comments will be appreciate.thank you.
0
Best Answers
-
You get callbacks when players join. That is a suitable moment to know when you check if 2 players are in the room.
Callbacks are covered in our docs:
https://doc.photonengine.com/en-us/pun/current/getting-started/pun-intro
and in the Tutorial:
https://doc.photonengine.com/en-us/pun/current/tutorials/pun-basics-tutorial/intro
We are not aware of freezes with PUN itself. Unless you use it in a new, unexpected way, PUN is probably not the problem. Please debug the freeze and let us know if you're sure it's caused by PUN. Then we need some way to reproduce it, too.5 -
Hi esquire,
the OnJoinedRoom() callback must be implemented by one of your classes which handles the game or networking logic. A detailed view on how to implement this function can be found in the docs: https://doc.photonengine.com/en-us/pun/current/getting-started/feature-overview#_mbcallbackpun
When implemented those callbacks will be automatically called by PUN.5 -
Hi esquire,
without having any look at your source code I think you need to decrease the amount of coroutines running simultaneously. For example you can use the custom room properties to store the player whose turn is now. When the client gets the updated custom room properties, compare the value for the active player. If it matches, enable controls for the client.
You can read about the custom room properties in the docs over here: https://doc.photonengine.com/en-us/pun/current/tutorials/matchmaking-and-lobby1
Answers
-
You get callbacks when players join. That is a suitable moment to know when you check if 2 players are in the room.
Callbacks are covered in our docs:
https://doc.photonengine.com/en-us/pun/current/getting-started/pun-intro
and in the Tutorial:
https://doc.photonengine.com/en-us/pun/current/tutorials/pun-basics-tutorial/intro
We are not aware of freezes with PUN itself. Unless you use it in a new, unexpected way, PUN is probably not the problem. Please debug the freeze and let us know if you're sure it's caused by PUN. Then we need some way to reproduce it, too.5 -
I really appreciate your reply.. and thank you very much. How do i use Photon networking message ,ENum for OnjoinedRoom for start the game?0
-
Hi esquire,
the OnJoinedRoom() callback must be implemented by one of your classes which handles the game or networking logic. A detailed view on how to implement this function can be found in the docs: https://doc.photonengine.com/en-us/pun/current/getting-started/feature-overview#_mbcallbackpun
When implemented those callbacks will be automatically called by PUN.5 -
@Christian_Simon ,thank you for your reply.
I have few raiseevents to deal cards to each player,and betting round for each player, game is running full of coroutine ,delaying time,to each event.still can't figure out that is the reason to freeze the unity engine,
0 -
Hi esquire,
without having any look at your source code I think you need to decrease the amount of coroutines running simultaneously. For example you can use the custom room properties to store the player whose turn is now. When the client gets the updated custom room properties, compare the value for the active player. If it matches, enable controls for the client.
You can read about the custom room properties in the docs over here: https://doc.photonengine.com/en-us/pun/current/tutorials/matchmaking-and-lobby1