Previous Book Contents Book Index Next

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


Network Message Types

These constants are used to identify standard message types. NetSprocket uses these types to clearly identify the network messages so you can process the message with the appropriate data structure.

enum {
   kNSpSystemMessagePrefix= 0x80000000,
   kNSpError            = kNSpSystemMessagePrefix | 0x7FFFFFFF,
   kNSpJoinRequest      = kNSpSystemMessagePrefix | 0x00000001,
   kNSpJoinApproved     = kNSpSystemMessagePrefix | 0x00000002,
   kNSpJoinDenied       = kNSpSystemMessagePrefix | 0x00000003,
   kNSpPlayerJoined     = kNSpSystemMessagePrefix | 0x00000004,
   kNSpPlayerLeft       = kNSpSystemMessagePrefix | 0x00000005,
   kNSpHostChanged      = kNSpSystemMessagePrefix | 0x00000006,
   kNSpGameTerminated   = kNSpSystemMessagePrefix | 0x00000007
};
Constant descriptions

kNSpSystemMessagePrefix
This is the prefix of all NetSprocket system messages. You can OR a message's what field with this constant to determine if the message is a system message.
kNSpError
A local error has occurred. It may have occurred when receiving a message, attempting to send a message, or attempting to allocate memory.
kNSpJoinRequest
A player wants to join a game. You do not need to respond to this message. NetSprocket will either use the default password check, or your custom join handler (if installed) to approve or deny the join request.
kNSpJoinApproved
Your request to join a game has been approved.
kNSpJoinDenied
Your request to join a game has been denied.
kNSpPlayerJoined
A player has joined the game.
kNSpPlayerLeft
A player has left the game.
kNSpHostChanged
The host of the game has changed.
kNSpGameTerminated
The game has been permanently stopped.
Note
All message types with negative values are reserved for use by Apple Computer, Inc.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996