NSpGame_Delete
You can use theNSpGame_Delete
function when you want to leave the game.
OSStatus NSpGame_Delete (NSpGameReference inGame, NSpFlags inFlags);
inGame
- An opaque reference to your game object.
inFlags
- Options for leaving the game.
- function result
- A result code of
noErr
, or a NetSprocket or Open Transport result code.DESCRIPTION
If your application is hosting the game and you passkNSpGameFlag_ForceTerminateGame
in theinFlags
parameter, the game will be stopped for all participants and the game object will be deleted. However, if you do not passkNSpGameFlag_ForceTerminateGame
, NetSprocket will attempt to negotiate with another player to become the host. If the negotiation is successful, the other players will be notified that the host has changed and you will be dropped from the game. If the negotiation fails,NSpGame_Delete
returns an error and no further action is taken.If your application is operating as a player (created by
NSpGame_Join
), the other players are notified that you are leaving the game. The game is not terminated if you make this call as a player.