If I'm not wrong the onSpectatorSwitched event is sent only to the user that required to be switched, the onUserCountChange event is sent only if the number of user + spectator in a room change. We have a feature in our game that show you who is watching your match, how I can be notified when another person in my game room switch from spectator to player?
Any suggestion?
spectator switched event question
- psychopixel
- Posts: 19
- Joined: 14 Apr 2008, 08:44
- Location: Italy
- Contact:
Hi,
good question. What you said is correct.
On the client side only the user attempting a switch (player-to-spectator or viceversa) receives an event back if the operation is successful.
Actually this is not entirely true. All players receive an update but only the user that was switched gets a client event.
This means that if you "redraw" your user list from scratch on each uCount event you would be able to show who is player and who is watching, because the User List is kept up to date.
Your request suggests that we should fire events not only for the requester but also for all other users in the Room.
I am taking a note in the todo list for the next update
good question. What you said is correct.
On the client side only the user attempting a switch (player-to-spectator or viceversa) receives an event back if the operation is successful.
Actually this is not entirely true. All players receive an update but only the user that was switched gets a client event.
This means that if you "redraw" your user list from scratch on each uCount event you would be able to show who is player and who is watching, because the User List is kept up to date.
Your request suggests that we should fire events not only for the requester but also for all other users in the Room.
I am taking a note in the todo list for the next update
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 89 guests