Previous Book Contents Book Index Next

Inside Macintosh: Apple Game Sprockets Guide /
Chapter 4 - NetSprocket / NetSprocket Reference
NetSprocket Functions / Hosting and Joining a Game


NSpGame_Delete

You can use the NSpGame_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 pass kNSpGameFlag_ForceTerminateGame in the inFlags parameter, the game will be stopped for all participants and the game object will be deleted. However, if you do not pass kNSpGameFlag_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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996