19 #ifndef __NETSPROCKET__
20 #define __NETSPROCKET__
22 #ifndef __CONDITIONALMACROS__
34 #ifndef __OPENTRANSPORT__
38 #ifndef __OPENTRANSPORTPROVIDERS__
59 #if PRAGMA_STRUCT_ALIGN
60 #pragma options align = power
61 #elif PRAGMA_STRUCT_PACKPUSH
63 #elif PRAGMA_STRUCT_PACK
70 kNSpMaxPlayerNameLen = 31,
71 kNSpMaxGroupNameLen = 31,
72 kNSpMaxPasswordLen = 31,
73 kNSpMaxGameNameLen = 31,
74 kNSpMaxDefinitionStringLen = 255
78 typedef struct OpaqueNSpGameReference *NSpGameReference;
79 typedef struct OpaqueNSpProtocolReference *NSpProtocolReference;
80 typedef struct OpaqueNSpProtocolListReference *NSpProtocolListReference;
81 typedef struct OpaqueNSpAddressReference *NSpAddressReference;
82 typedef SInt32 NSpEventCode;
83 typedef SInt32 NSpGameID;
84 typedef SInt32 NSpPlayerID;
85 typedef NSpPlayerID NSpGroupID;
86 typedef UInt32 NSpPlayerType;
87 typedef SInt32 NSpFlags;
88 typedef Str31 NSpPlayerName;
99 typedef struct NSpPlayerInfo NSpPlayerInfo;
101 typedef NSpPlayerInfo *NSpPlayerInfoPtr;
103 struct NSpPlayerEnumeration
106 NSpPlayerInfoPtr playerInfo[1];
108 typedef struct NSpPlayerEnumeration NSpPlayerEnumeration;
109 typedef NSpPlayerEnumeration *NSpPlayerEnumerationPtr;
115 NSpPlayerID players[1];
117 typedef struct NSpGroupInfo NSpGroupInfo;
118 typedef NSpGroupInfo *NSpGroupInfoPtr;
120 struct NSpGroupEnumeration
123 NSpGroupInfoPtr groups[1];
125 typedef struct NSpGroupEnumeration NSpGroupEnumeration;
126 typedef NSpGroupEnumeration *NSpGroupEnumerationPtr;
128 typedef UInt32 NSpTopology;
131 kNSpClientServer = 0x00000001
138 UInt32 currentPlayers;
139 UInt32 currentGroups;
140 NSpTopology topology;
145 typedef struct NSpGameInfo NSpGameInfo;
147 struct NSpMessageHeader
158 typedef struct NSpMessageHeader NSpMessageHeader;
160 struct NSpErrorMessage
165 typedef struct NSpErrorMessage NSpErrorMessage;
166 struct NSpJoinRequestMessage
172 UInt32 customDataLen;
175 typedef struct NSpJoinRequestMessage NSpJoinRequestMessage;
176 struct NSpJoinApprovedMessage
180 typedef struct NSpJoinApprovedMessage NSpJoinApprovedMessage;
181 struct NSpJoinDeniedMessage
186 typedef struct NSpJoinDeniedMessage NSpJoinDeniedMessage;
187 struct NSpPlayerJoinedMessage
191 NSpPlayerInfo playerInfo;
193 typedef struct NSpPlayerJoinedMessage NSpPlayerJoinedMessage;
194 struct NSpPlayerLeftMessage
198 NSpPlayerID playerID;
199 NSpPlayerName playerName;
201 typedef struct NSpPlayerLeftMessage NSpPlayerLeftMessage;
202 struct NSpHostChangedMessage
207 typedef struct NSpHostChangedMessage NSpHostChangedMessage;
208 struct NSpGameTerminatedMessage
212 typedef struct NSpGameTerminatedMessage NSpGameTerminatedMessage;
213 struct NSpCreateGroupMessage
217 NSpPlayerID requestingPlayer;
219 typedef struct NSpCreateGroupMessage NSpCreateGroupMessage;
220 struct NSpDeleteGroupMessage
224 NSpPlayerID requestingPlayer;
226 typedef struct NSpDeleteGroupMessage NSpDeleteGroupMessage;
227 struct NSpAddPlayerToGroupMessage
233 typedef struct NSpAddPlayerToGroupMessage NSpAddPlayerToGroupMessage;
234 struct NSpRemovePlayerFromGroupMessage
240 typedef struct NSpRemovePlayerFromGroupMessage NSpRemovePlayerFromGroupMessage;
241 struct NSpPlayerTypeChangedMessage
245 NSpPlayerType newType;
247 typedef struct NSpPlayerTypeChangedMessage NSpPlayerTypeChangedMessage;
251 kNSpSendFlag_Junk = 0x00100000,
253 kNSpSendFlag_Normal = 0x00200000,
254 kNSpSendFlag_Registered =
262 kNSpSendFlag_FailIfPipeFull = 0x00000001,
263 kNSpSendFlag_SelfSend = 0x00000002,
264 kNSpSendFlag_Blocking = 0x00000004
270 kNSpGameFlag_DontAdvertise = 0x00000001,
271 kNSpGameFlag_ForceTerminateGame = 0x00000002
278 kNSpSystemMessagePrefix = (long)0x80000000,
279 kNSpError = kNSpSystemMessagePrefix | 0x7FFFFFFF,
280 kNSpJoinRequest = kNSpSystemMessagePrefix | 0x00000001,
281 kNSpJoinApproved = kNSpSystemMessagePrefix | 0x00000002,
282 kNSpJoinDenied = kNSpSystemMessagePrefix | 0x00000003,
283 kNSpPlayerJoined = kNSpSystemMessagePrefix | 0x00000004,
284 kNSpPlayerLeft = kNSpSystemMessagePrefix | 0x00000005,
285 kNSpHostChanged = kNSpSystemMessagePrefix | 0x00000006,
286 kNSpGameTerminated = kNSpSystemMessagePrefix | 0x00000007,
287 kNSpGroupCreated = kNSpSystemMessagePrefix | 0x00000008,
288 kNSpGroupDeleted = kNSpSystemMessagePrefix | 0x00000009,
289 kNSpPlayerAddedToGroup = kNSpSystemMessagePrefix | 0x0000000A,
290 kNSpPlayerRemovedFromGroup = kNSpSystemMessagePrefix | 0x0000000B,
291 kNSpPlayerTypeChanged = kNSpSystemMessagePrefix | 0x0000000C
297 kNSpAllPlayers = 0x00000000,
298 kNSpHostOnly = (long)0xFFFFFFFF
312 NSpInitialize(UInt32 inStandardMessageSize, UInt32 inBufferSize,
313 UInt32 inQElements, NSpGameID inGameID, UInt32 inTimeout);
327 NSpProtocol_New(
const char *inDefinitionString,
328 NSpProtocolReference *outReference);
340 NSpProtocol_Dispose(NSpProtocolReference inProtocolRef);
352 NSpProtocol_ExtractDefinitionString(NSpProtocolReference inProtocolRef,
353 char *outDefinitionString);
366 NSpProtocolList_New(NSpProtocolReference inProtocolRef,
367 NSpProtocolListReference *outList);
379 NSpProtocolList_Dispose(NSpProtocolListReference inProtocolList);
391 NSpProtocolList_Append(NSpProtocolListReference inProtocolList,
392 NSpProtocolReference inProtocolRef);
404 NSpProtocolList_Remove(NSpProtocolListReference inProtocolList,
405 NSpProtocolReference inProtocolRef);
417 NSpProtocolList_RemoveIndexed(NSpProtocolListReference inProtocolList,
430 NSpProtocolList_GetCount(NSpProtocolListReference inProtocolList);
442 NSpProtocolList_GetIndexedRef(NSpProtocolListReference inProtocolList,
456 NSpProtocol_CreateAppleTalk(ConstStr31Param inNBPName,
457 ConstStr31Param inNBPType, UInt32 inMaxRTT,
458 UInt32 inMinThruput);
470 NSpProtocol_CreateIP(
InetPort inPort, UInt32 inMaxRTT, UInt32 inMinThruput);
484 NSpDoModalJoinDialog(ConstStr31Param inGameType,
485 ConstStr255Param inEntityListLabel, Str31 ioName,
486 Str31 ioPassword, NSpEventProcPtr inEventProcPtr);
498 NSpDoModalHostDialog(NSpProtocolListReference ioProtocolList, Str31 ioGameName,
499 Str31 ioPlayerName, Str31 ioPassword,
500 NSpEventProcPtr inEventProcPtr);
513 NSpGame_Host(NSpGameReference *outGame, NSpProtocolListReference inProtocolList,
514 UInt32 inMaxPlayers, ConstStr31Param inGameName,
515 ConstStr31Param inPassword, ConstStr31Param inPlayerName,
516 NSpPlayerType inPlayerType, NSpTopology inTopology,
529 NSpGame_Join(NSpGameReference *outGame, NSpAddressReference inAddress,
530 ConstStr31Param inName, ConstStr31Param inPassword,
531 NSpPlayerType inType,
void *inCustomData, UInt32 inCustomDataLen,
544 NSpGame_EnableAdvertising(NSpGameReference inGame,
545 NSpProtocolReference inProtocol,
Boolean inEnable);
557 NSpGame_Dispose(NSpGameReference inGame, NSpFlags inFlags);
569 NSpGame_GetInfo(NSpGameReference inGame, NSpGameInfo *ioInfo);
582 NSpMessage_Send(NSpGameReference inGame, NSpMessageHeader *inMessage,
595 NSpMessage_Get(NSpGameReference inGame);
607 NSpMessage_Release(NSpGameReference inGame, NSpMessageHeader *inMessage);
620 NSpMessage_SendTo(NSpGameReference inGame, NSpPlayerID inTo, SInt32 inWhat,
621 void *inData, UInt32 inDataLen, NSpFlags inFlags);
634 NSpPlayer_ChangeType(NSpGameReference inGame, NSpPlayerID inPlayerID,
635 NSpPlayerType inNewType);
647 NSpPlayer_Remove(NSpGameReference inGame, NSpPlayerID inPlayerID);
659 NSpPlayer_GetAddress(NSpGameReference inGame, NSpPlayerID inPlayerID,
672 NSpPlayer_GetMyID(NSpGameReference inGame);
684 NSpPlayer_GetInfo(NSpGameReference inGame, NSpPlayerID inPlayerID,
685 NSpPlayerInfoPtr *outInfo);
697 NSpPlayer_ReleaseInfo(NSpGameReference inGame, NSpPlayerInfoPtr inInfo);
709 NSpPlayer_GetEnumeration(NSpGameReference inGame,
710 NSpPlayerEnumerationPtr *outPlayers);
722 NSpPlayer_ReleaseEnumeration(NSpGameReference inGame,
723 NSpPlayerEnumerationPtr inPlayers);
735 NSpPlayer_GetRoundTripTime(NSpGameReference inGame, NSpPlayerID inPlayer);
747 NSpPlayer_GetThruput(NSpGameReference inGame, NSpPlayerID inPlayer);
760 NSpGroup_New(NSpGameReference inGame, NSpGroupID *outGroupID);
772 NSpGroup_Dispose(NSpGameReference inGame, NSpGroupID inGroupID);
784 NSpGroup_AddPlayer(NSpGameReference inGame, NSpGroupID inGroupID,
785 NSpPlayerID inPlayerID);
797 NSpGroup_RemovePlayer(NSpGameReference inGame, NSpGroupID inGroupID,
798 NSpPlayerID inPlayerID);
810 NSpGroup_GetInfo(NSpGameReference inGame, NSpGroupID inGroupID,
811 NSpGroupInfoPtr *outInfo);
823 NSpGroup_ReleaseInfo(NSpGameReference inGame, NSpGroupInfoPtr inInfo);
835 NSpGroup_GetEnumeration(NSpGameReference inGame,
836 NSpGroupEnumerationPtr *outGroups);
848 NSpGroup_ReleaseEnumeration(NSpGameReference inGame,
849 NSpGroupEnumerationPtr inGroups);
874 NSpSetConnectTimeout(UInt32 inSeconds);
886 NSpClearMessageHeader(NSpMessageHeader *inMessage);
898 NSpGetCurrentTimeStamp(NSpGameReference inGame);
910 NSpConvertOTAddrToAddressReference(
OTAddress *inAddress);
922 NSpConvertAddressReferenceToOTAddr(NSpAddressReference inAddress);
934 NSpReleaseAddressReference(NSpAddressReference inAddress);
937 typedef CALLBACK_API(
void,
938 NSpCallbackProcPtr)(NSpGameReference inGame,
939 void *inContext, NSpEventCode inCode,
940 OSStatus inStatus,
void *inCookie);
951 NSpInstallCallbackHandler(NSpCallbackProcPtr inHandler,
void *inContext);
953 typedef CALLBACK_API(
Boolean, NSpJoinRequestHandlerProcPtr)(
954 NSpGameReference inGame, NSpJoinRequestMessage *inMessage,
void *inContext,
966 NSpInstallJoinRequestHandler(NSpJoinRequestHandlerProcPtr inHandler,
970 NSpMessageHandlerProcPtr)(NSpGameReference inGame,
971 NSpMessageHeader *inMessage,
983 NSpInstallAsyncMessageHandler(NSpMessageHandlerProcPtr inHandler,
988 #if PRAGMA_STRUCT_ALIGN
989 #pragma options align = reset
990 #elif PRAGMA_STRUCT_PACKPUSH
992 #elif PRAGMA_STRUCT_PACK
996 #ifdef PRAGMA_IMPORT_OFF
Set up for compiler independent conditionals.
Event Manager Interfaces.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
This file contains provider-specific definitions for various built-in providers.
UInt16 InetPort
Definition: OpenTransportProviders.h:58
Open Transport client interface file. This contains all the client APIs.
Definition: MacTypes.h:638
Definition: OpenTransport.h:545