Previous Book Contents Book Index Next

Inside Macintosh: Apple Game Sprockets Guide /
Chapter 4 - NetSprocket / NetSprocket Reference
Data Structures


Join Request Message Structure

The join request message structure is a standard NetSprocket network message you can use to notify the host that a player wishes to join a game about to start or one that is in progress. This structure will only be passed to your application if you install a custom join request handler. You will not get this structure via the NSpMessage_Get function. See the NSpInstallJoinRequestHandler function on (page 4-48) for more information. The join request message structure is defined by the NSpJoinRequestMessage data type.

This is an example of how you can construct your own message structures. Each structure is made using the message header structure followed by any custom data. Be sure to set the messageLen field in the header of the record to the size of your structure.

typedef struct NSpJoinRequestMessage {
   NSpMessageHeader           header;
   Str31                      name;
   Str31                      password;
   UInt32                     type;
   UInt32                     customDataLen;
   UInt8                      customData[kVariableLengthArray];
} NSpJoinRequestMessage;
Field descriptions

header
A valid game object.
name
The name of a prospective player.
password
A string being passed by the prospective player to attempt to match the password required by the host.
type
The type of the prospective player.
customDataLen
The length of the custom data passed by the game attempting to join.
customData
Data that was passed to a call to the NSpGame_Join function made by the prospective player. This is not used by NetSprocket.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996