Dispatched in response to the SwitchSpectator(Int32) request.
The request to turn a spectator into a player may fail if another user did the same before your request, and there was only one player slot available.
The request to turn a spectator into a player may fail if another user did the same before your request, and there was only one player slot available.
| C# | Visual Basic | Visual C++ |
Version:
SmartFoxServer Basic / Pro
The following example shows how to check the handle the spectator switch.
CopyC#
SFSEvent.onSpectatorSwitched += OnSpectatorSwitched; smartFox.SwitchSpectator(); public void OnSpectatorSwitched(bool success, int newId, Room room) { if (success) Debug.WriteLine("You have been turned into a player; your id is " + newId); else Debug.WriteLine("The attempt to switch from spectator to player failed"); }