NSpGame_Join
You can use the NSpGame_Join function to join a game.
OSStatus NSpGame_Join (
NSpGameReference *outGame,
NSpAddressReference inAddress,
ConstStr31Param inName,
ConstStr31Param inPassword,
NSpPlayerType inType,
Uint32 inUserDataLen,
void *inUserData,
NSpFlags inFlags);
outGame
- A pointer to a game reference structure that is filled in by the function. You must provide a pointer to an
NSpGameReference in the outGame parameter. This pointer will be filled in with a valid NSpGameReference on exit.
inAddress
- A valid address reference returned from the
NSpDoModalJoinDialog function or created by the application.
inName
- The player's name as it will appear to other players in the game. You must pass a valid Pascal string.
NULL is not permitted in this field.
inPassword
- The password entered by the user to join the game. Pass
NULL or an empty string if no password is required.
inType
- The player's type. This value is for your own use. It is stored, but not used by NetSprocket.
inUserDataLen
- The length of custom authentication data being sent to the host as part of the join request. If your game does not use a custom authentication mechanism, you must set the value to 0.
inUserData
- A pointer to your custom data being sent to the host for use by your custom authentication function you have installed to override the standard password mechanism offered by NetSprocket. This parameter is passed to the host, but not used by NetSprocket. If your game does not use a custom authentication mechanism, you should set this value to
NULL.
inFlags
- Options for joining the game. There are no options for this field in NetSprocket version 1.0.
- function result
- A result code of
noErr, or a NetSprocket or Open Transport result code.
DESCRIPTION
This function joins the game specified by the inAddress parameter. You can obtain an address reference from NSpDoModalJoinDialog or NSpConvertOTAddrToAddressReference.