Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
NetStuff.h
#ifndef __NETSTUFF__ |
#define __NETSTUFF__ |
#include <NetSprocket.h> |
extern Boolean gHost; |
extern NSpGameReference gNetGame; |
enum { |
kUserCancelled = -100 |
}; |
#ifdef __cplusplus |
extern "C" { |
#endif |
OSStatus InitNetworking(NSpGameID inGameID); |
void ShutdownNetworking(void); |
OSStatus DoHost(void); |
OSStatus DoJoin(void); |
void HandleNetwork(void); |
void RefreshWindow(WindowPtr inWindow); |
void HandleNetMenuChoice(short menu, short item); |
void AdjustNetMenus(); |
void DoCloseNetWindow(WindowPtr inWindow); |
#ifdef __cplusplus |
} |
#endif |
enum { |
kPlayerInputMessage = 1, |
kGameStateMessage, |
kLeaveMessage |
}; |
#define iJunk 1 |
#define iNormal 2 |
#define iRegistered 3 |
//------------------- |
#define iBlocking 5 |
//------------------- |
#define i1X 7 |
#define i10X 8 |
#define i30X 9 |
#define iNoLimit 10 |
//------------------- |
#define iLess500 12 |
#define i1K 13 |
#define i10K 14 |
#define i100K 15 |
//------------------- |
#define iEnumerate 17 |
typedef struct PlayerInputMessage |
{ |
NSpMessageHeader h; |
UInt8 data[100]; |
} PlayerInputMessage; |
typedef struct GameStateMessage |
{ |
NSpMessageHeader h; |
UInt8 data[500]; |
} GameStateMessage; |
typedef struct AddPlayerMessage |
{ |
NSpMessageHeader h; |
NSpPlayerID id; |
} AddPlayerMessage; |
typedef struct WindowStuff |
{ |
NSpPlayerID id; |
Str255 text; |
UInt32 lastMessage; |
Boolean changed; |
} WindowStuff; |
#endif |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-10-14