OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
peerOperations.h
1/*
2GameSpy Peer SDK
3Dan "Mr. Pants" Schoenblum
4dan@gamespy.com
5
6Copyright 1999-2007 GameSpy Industries, Inc
7
8devsupport@gamespy.com
9*/
10
11#ifndef _PEEROPERATIONS_H_
12#define _PEEROPERATIONS_H_
13
14/*************
15** INCLUDES **
16*************/
17#include "peerMain.h"
18
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/**********
25** TYPES **
26**********/
27typedef enum piOperationType
28{
29 PI_CONNECT_OPERATION,
30 PI_CREATE_ROOM_OPERATION,
31 PI_JOIN_ROOM_OPERATION,
32 PI_ENUM_PLAYERS_OPERATION,
33 PI_LIST_GROUP_ROOMS_OPERATION,
34 PI_LIST_STAGING_ROOMS_OPERATION,
35 PI_GET_PLAYER_INFO_OPERATION,
36 PI_GET_PROFILE_ID_OPERATION,
37 PI_GET_IP_OPERATION,
38 PI_CHANGE_NICK_OPERATION,
39 PI_GET_GLOBAL_KEYS_OPERATION,
40 PI_GET_ROOM_KEYS_OPERATION,
41 PI_AUTHENTICATE_CDKEY_OPERATION,
42 PI_AUTO_MATCH_OPERATION,
43 PI_NUM_OPERATION_TYPES
44} piOperationType;
45
46typedef enum piConnectType
47{
48 PI_CONNECT,
49 PI_CONNECT_UNIQUENICK_LOGIN,
50 PI_CONNECT_PROFILENICK_LOGIN,
51 PI_CONNECT_PREAUTH
52} piConnectType;
53
54typedef struct piOperation
55{
56 PEER peer; // the peer object
57 piOperationType type; // PI_<type>_OPERATION
58 void * data; // operation-specific data
59 int ID; // unique ID for this operation
60 PEERCBType callback; // the callback for this operation
61 PEERCBType callback2; // second callback if needed
62 void * callbackParam; // user-data for the callback
63 RoomType roomType; // lots of operations need this
64 char * name; // general purpose name
65 char * password; // general purpose password
66 int num; // general purpose integer
67 SOCKET socket; // general purpose socket
68 unsigned short port; // general purpose port
69 PEERBool socketClose; // close the socket when done
70 PEERBool cancel; // this op has been cancelled
72
73/**************
74** FUNCTIONS **
75**************/
76PEERBool piOperationsInit(PEER peer);
77void piOperationsReset(PEER peer);
78void piOperationsCleanup(PEER peer);
79PEERBool piIsOperationFinished(PEER peer, int opID);
80void piRemoveOperation(PEER peer, piOperation * operation);
81void piCancelJoinOperation(PEER peer, RoomType roomType);
82piOperation * piGetOperation(PEER peer, int opID);
83int piGetNextID(PEER peer);
84
85/***************
86** OPERATIONS **
87***************/
88PEERBool piNewConnectOperation
89(
90 PEER peer,
91 piConnectType connectType,
92 const char * nick,
93 int namespaceID,
94 const char * email,
95 const char * profilenick,
96 const char * uniquenick,
97 const char * password,
98 const char * authtoken,
99 const char * partnerchallenge,
100 peerConnectCallback callback,
101 void * callbackParam,
102 int opID
103);
104
105PEERBool piNewCreateStagingRoomOperation
106(
107 PEER peer,
108 const char * name,
109 const char * password,
110 int maxPlayers,
111 SOCKET socket,
112 unsigned short port,
113 peerJoinRoomCallback callback,
114 void * callbackParam,
115 int opID
116);
117
118PEERBool piNewJoinRoomOperation
119(
120 PEER peer,
121 RoomType roomType,
122 const char * channel,
123 const char * password,
124 peerJoinRoomCallback callback,
125 void * callbackParam,
126 int opID
127);
128
129PEERBool piNewListGroupRoomsOperation
130(
131 PEER peer,
132 const char * fields,
133 peerListGroupRoomsCallback callback,
134 void * param,
135 int opID
136);
137
138PEERBool piNewGetPlayerInfoOperation
139(
140 PEER peer,
141 const char * nick,
142 peerGetPlayerInfoCallback callback,
143 void * param,
144 int opID
145);
146
147PEERBool piNewGetProfileIDOperation
148(
149 PEER peer,
150 const char * nick,
151 peerGetPlayerProfileIDCallback callback,
152 void * param,
153 int opID
154);
155
156PEERBool piNewGetIPOperation
157(
158 PEER peer,
159 const char * nick,
160 peerGetPlayerIPCallback callback,
161 void * param,
162 int opID
163);
164
165PEERBool piNewChangeNickOperation
166(
167 PEER peer,
168 const char * newNick,
169 peerChangeNickCallback callback,
170 void * param,
171 int opID
172);
173
174PEERBool piNewGetGlobalKeysOperation
175(
176 PEER peer,
177 const char * target,
178 int num,
179 const char ** keys,
180 peerGetGlobalKeysCallback callback,
181 void * param,
182 int opID
183);
184
185PEERBool piNewGetRoomKeysOperation
186(
187 PEER peer,
188 RoomType roomType,
189 const char * nick,
190 int num,
191 const char ** keys,
192 peerGetRoomKeysCallback callback,
193 void * param,
194 int opID
195);
196
197PEERBool piNewAuthenticateCDKeyOperation
198(
199 PEER peer,
200 const char * cdkey,
201 peerAuthenticateCDKeyCallback callback,
202 void * param,
203 int opID
204);
205
206PEERBool piNewAutoMatchOperation
207(
208 PEER peer,
209 SOCKET socket,
210 unsigned short port,
211 peerAutoMatchStatusCallback statusCallback,
212 peerAutoMatchRateCallback rateCallback,
213 void * param,
214 int opID
215);
216
217#ifdef __cplusplus
218}
219#endif
220
221#endif
Definition peerOperations.h:55