Previous Book Contents Book Index Next

Inside Macintosh: Apple Game Sprockets Guide /
Chapter 4 - NetSprocket / NetSprocket Reference
NetSprocket Functions / Human Interface Functions


NSpDoModalHostDialog

You can use the NSpDoModalHostDialog function to present your user with a default modal dialog box on for hosting a game on the network.

Boolean NSpDoModalHostDialog (
	NSpProtocolListReference ioProtocolList,
	Str31 ioGameName,
	Str31 ioPlayerName,
	Str31 ioPassword,
	NSpEventProcPtr inEventProcPtr);
ioProtocolList
An opaque reference to a list of protocols. You can create an empty list that will be filled in with information about the protocols the user selects, but you cannot pass NULL. If you wish to preconfigure certain protocols, you can create protocol references for them, then add them to your protocol list before passing it to this function.
ioGameName
A Pascal string (maximum 31 characters) of the name of the game to be registered in NBP and displayed to users if you are using the NSpGame_Join function in their game. Pass an empty string (not NULL) if you don't want to display a default game name. The value of ioGameName is often obtained from a preferences setting. This field contains changes (if any) the user made to the ioGameName field.
ioPlayerName
A Pascal (maximum 31 characters) string of the user name (generally from a preferences setting). Pass an empty string (not NULL) if you do not want a default name displayed in the dialog box. This field contains any changes the user has made to the name.
ioPassword
A Pascal (maximum 31 characters) string of the password (generally from a preferences setting). Pass an empty string (not NULL) if you do not want a default password displayed in the dialog box. This field contains any changes the user made to the password.
inEventProcPtr
A pointer to DialogProcUPP, the dialog filter function for handling Mac OS events that may affect other windows you have displayed on the screen concurrently. Pass NULL if you do not need to receive Mac OS events while the dialog box is being displayed.
function result
A value of true if the user selected OK, false if the user selected Cancel.
DESCRIPTION
This function fills in the protocol list with the protocol(s) the user has selected and configures the protocol references in the list with the proper information. If the user did not cancel the dialog box, you should then pass the protocol list to the NSpGame_Host function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996