OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
gpi.h
1/*
2gpi.h
3GameSpy Presence SDK
4Dan "Mr. Pants" Schoenblum
5
6Copyright 1999-2007 GameSpy Industries, Inc
7
8devsupport@gamespy.com
9
10***********************************************************************
11Please see the GameSpy Presence SDK documentation for more information
12**********************************************************************/
13
14#ifndef _GPI_H_
15#define _GPI_H_
16
17//INCLUDES
19#include "../common/gsCommon.h"
20#include "../common/gsAvailable.h"
21#include "../common/gsUdpEngine.h"
22#include "../hashtable.h"
23#include "../darray.h"
24#include "../md5.h"
25#include "gp.h"
26
27// Extended message support
28#define GPI_NEW_AUTH_NOTIFICATION (1<<0)
29#define GPI_NEW_REVOKE_NOTIFICATION (1<<1)
30
31// New Status Info support
32#define GPI_NEW_STATUS_NOTIFICATION (1<<2)
33
34// Buddy List + Block List retrieval on login
35#define GPI_NEW_LIST_RETRIEVAL_ON_LOGIN (1<<3)
36
37// Extended SDK features
38#ifndef GPI_SDKREV
39#ifdef GP_NEW_STATUS_INFO
40#define GPI_SDKREV (GPI_NEW_AUTH_NOTIFICATION | GPI_NEW_REVOKE_NOTIFICATION | GPI_NEW_STATUS_NOTIFICATION | GPI_NEW_LIST_RETRIEVAL_ON_LOGIN)
41#else
42#define GPI_SDKREV (GPI_NEW_AUTH_NOTIFICATION | GPI_NEW_REVOKE_NOTIFICATION | GPI_NEW_LIST_RETRIEVAL_ON_LOGIN)
43#endif
44#endif
45
46// New UDP Layer port
47#define GPI_PEER_PORT 6500
48
49//TYPES
51// Boolean.
53typedef enum _GPIBool
54{
55 GPIFalse,
56 GPITrue
57} GPIBool;
58
59#include "gpiUtility.h"
60#include "gpiCallback.h"
61#include "gpiOperation.h"
62#include "gpiConnect.h"
63#include "gpiBuffer.h"
64#include "gpiInfo.h"
65#include "gpiProfile.h"
66#include "gpiPeer.h"
67#include "gpiSearch.h"
68#include "gpiBuddy.h"
69#include "gpiTransfer.h"
70#include "gpiUnique.h"
71#include "gpiKeys.h"
72
73// For PS3 NP Sync functionality
74#ifdef _PS3
75#include "gpiPS3.h"
76#endif
77
78// Connection data.
80typedef struct
81{
82 char errorString[GP_ERROR_STRING_LEN];
83 GPIBool infoCaching;
84 GPIBool infoCachingBuddyAndBlockOnly;
85 GPIBool simulation;
86 GPIBool firewall;
87 char nick[GP_NICK_LEN];
88 char uniquenick[GP_UNIQUENICK_LEN];
89 char email[GP_EMAIL_LEN];
90 char password[GP_PASSWORD_LEN];
91 int sessKey;
92 int userid;
93 int profileid;
94 int partnerID;
95 GPICallback callbacks[GPI_NUM_CALLBACKS];
96 SOCKET cmSocket;
97 int connectState;
98 GPIBuffer socketBuffer;
99 char * inputBuffer;
100 int inputBufferSize;
101 GPIBuffer outputBuffer;
102 // Replaced by UDP Layer
103 //SOCKET peerSocket;
104 char mHeader[GS_UDP_MSG_HEADER_LEN];
105 unsigned short peerPort;
106 int nextOperationID;
107 int numSearches;
108
109 // new style status info
110 GPEnum lastStatusState;
111 unsigned int hostIp;
112 unsigned int hostPrivateIp;
113 unsigned short queryPort;
114 unsigned short hostPort;
115 unsigned int sessionFlags;
116
117 char richStatus[GP_RICH_STATUS_LEN];
118 char gameType[GP_STATUS_BASIC_STR_LEN];
119 char gameVariant[GP_STATUS_BASIC_STR_LEN];
120 char gameMapName[GP_STATUS_BASIC_STR_LEN];
121
122 // New Status Info extended info Keys
123 DArray extendedInfoKeys;
124
125 // Deprecated
126 char lastStatusString[GP_STATUS_STRING_LEN];
127 char lastLocationString[GP_LOCATION_STRING_LEN];
128
129 GPErrorCode errorCode;
130 GPIBool fatalError;
131 FILE * diskCache;
132 GPIOperation * operationList;
133 GPIProfileList profileList;
134 GPIPeer * peerList;
135 GPICallbackData * callbackList;
136 GPICallbackData * lastCallback;
137 GPIBuffer updateproBuffer;
138 GPIBuffer updateuiBuffer;
139 DArray transfers;
140 unsigned int nextTransferID;
141 int productID;
142 int namespaceID;
143 char loginTicket[GP_LOGIN_TICKET_LEN];
144 GPEnum quietModeFlags;
145 gsi_time kaTransmit;
146
147#ifdef GSI_UNICODE
148 unsigned short errorString_W[GP_ERROR_STRING_LEN];
149 unsigned short nick_W[GP_NICK_LEN];
150 unsigned short uniquenick_W[GP_UNIQUENICK_LEN];
151 unsigned short email_W[GP_EMAIL_LEN];
152 unsigned short password_W[GP_PASSWORD_LEN];
153
154 // Deprecated
155 unsigned short lastStatusString_W[GP_STATUS_STRING_LEN];
156 unsigned short lastLocationString_W[GP_LOCATION_STRING_LEN];
157
158 unsigned short richStatus_W[GP_RICH_STATUS_LEN];
159 unsigned short gameType_W[GP_STATUS_BASIC_STR_LEN];
160 unsigned short gameVariant_W[GP_STATUS_BASIC_STR_LEN];
161 unsigned short gameMapName_W[GP_STATUS_BASIC_STR_LEN];
162#endif
163
164#ifdef _PS3
165 // NP sync info
166 gsi_bool npInitialized;
167 gsi_bool npStatusRetrieved;
168 gsi_bool npBasicGameInitialized;
169 gsi_bool npLookupGameInitialized;
170 gsi_bool npPerformBuddySync;
171 gsi_bool npPerformBlockSync;
172 gsi_bool npSyncLock;
173 int npLookupTitleCtxId;
174 DArray npTransactionList;
175 gsi_time loginTime;
176#endif
177
179
180//FUNCTIONS
182GPResult
183gpiInitialize(
184 GPConnection * connection,
185 int productID,
186 int namespaceID,
187 int partnerID
188);
189
190void
191gpiDestroy(
192 GPConnection * connection
193);
194
195GPResult
196gpiReset(
197 GPConnection * connection
198);
199
200GPResult
201gpiProcessConnectionManager(
202 GPConnection * connection
203);
204
205GPResult
206gpiProcess(
207 GPConnection * connection,
208 int blockingOperationID
209);
210
211GPResult
212gpiEnable(
213 GPConnection * connection,
214 GPEnum state
215);
216
217GPResult
218gpiDisable(
219 GPConnection * connection,
220 GPEnum state
221);
222
223#ifdef _DEBUG
224void
225gpiReport(
226 GPConnection * connection,
227 void (* report)(const char * output)
228);
229#endif
230
231#endif
Definition gpiBuffer.h:26
Definition gpiCallback.h:75
Definition gpiCallback.h:67
Definition gpi.h:81
Definition gpiProfile.h:84
Definition puff.c:88