OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
gpiProfile.h
1/*
2gpiProfile.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 _GPIPROFILE_H_
15#define _GPIPROFILE_H_
16
17//INCLUDES
19#include "gpi.h"
20
21//DEFINES
23#define GPI_SIG_LEN 33
24
25//TYPES
27// The status for a buddy profile.
29
30// New Status Info
31typedef struct _GPIBuddyStatusInfo
32{
33 int buddyIndex;
34 GPEnum statusState;
35 char *richStatus;
36 char *gameType;
37 char *gameVariant;
38 char *gameMapName;
39 unsigned int sessionFlags;
40 unsigned int buddyIp;
41 unsigned short buddyPort;
42 unsigned int hostIp;
43 unsigned int hostPrivateIp;
44 unsigned short queryPort;
45 unsigned short hostPort;
46 GPEnum quietModeFlags;
47 int productId;
48 // New Status Info extended info Keys
49 DArray extendedInfoKeys;
50} GPIBuddyStatusInfo;
51
52// Old status
53typedef struct
54{
55 int buddyIndex;
56 GPEnum status;
57 char * statusString;
58 char * locationString;
59 unsigned int ip;
60 unsigned short port;
61 GPEnum quietModeFlags;
63
64// Profile data.
66typedef struct GPIProfile
67{
68 int profileId;
69 int userId;
70 GPIBuddyStatus * buddyStatus;
71 GPIBuddyStatusInfo *buddyStatusInfo;
72 GPIInfoCache * cache;
73 char * authSig;
74 int requestCount;
75 char * peerSig;
76 gsi_bool blocked;
77 int blockIndex;
78 gsi_bool buddyOrBlockCache;
80
81// A list of profiles.
83typedef struct
84{
85 HashTable profileTable;
86 int num;
87 int numBuddies;
88 int numBlocked;
90
91//FUNCTIONS
93GPIBool
94gpiInitProfiles(
95 GPConnection * connection
96);
97
99gpiProfileListAdd(
100 GPConnection * connection,
101 int id
102);
103
104GPIBool
105gpiGetProfile(
106 GPConnection * connection,
107 GPProfile profileid,
108 GPIProfile ** pProfile
109);
110
111GPResult
112gpiProcessNewProfile(
113 GPConnection * connection,
114 GPIOperation * operation,
115 const char * input
116);
117
118GPResult
119gpiNewProfile(
120 GPConnection * connection,
121 const char nick[GP_NICK_LEN],
122 GPEnum replace,
123 GPEnum blocking,
124 GPCallback callback,
125 void * param
126);
127
128GPResult gpiProcessDeleteProfle
129(
130 GPConnection * connection,
131 GPIOperation * operation,
132 const char * input
133);
134
135GPResult gpiDeleteProfile(
136 GPConnection * connection,
137 GPCallback callback,
138 void * param
139);
140
141void
142gpiRemoveProfile(
143 GPConnection * connection,
144 GPIProfile * profile
145);
146
147void
148gpiRemoveProfileByID(
149 GPConnection * connection,
150 int profileid
151);
152
153GPResult
154gpiLoadDiskProfiles(
155 GPConnection * connection
156);
157
158GPResult
159gpiSaveDiskProfiles(
160 GPConnection * connection
161);
162
163GPResult
164gpiFindProfileByUser(
165 GPConnection * connection,
166 char nick[GP_NICK_LEN],
167 char email[GP_EMAIL_LEN],
168 GPIProfile ** profile
169);
170
171// return false to stop the mapping
172typedef GPIBool
173(* gpiProfileMapFunc)(
174 GPConnection * connection,
175 GPIProfile * profile,
176 void * data
177);
178
179GPIBool
180gpiProfileMap(
181 GPConnection * connection,
182 gpiProfileMapFunc func,
183 void * data
184);
185
187gpiFindBuddy(
188 GPConnection * connection,
189 int buddyIndex
190);
191
192void gpiRemoveBuddyStatus(GPIBuddyStatus *buddyStatus);
193void gpiRemoveBuddyStatusInfo(GPIBuddyStatusInfo *buddyStatusInfo);
194
195GPIBool
196gpiCanFreeProfile(
197 GPIProfile * profile
198);
199
200void gpiSetInfoCacheFilename(
201 const char filename[FILENAME_MAX + 1]
202);
203
204// BLOCK LIST
205GPResult
206gpiAddToBlockedList(
207 GPConnection * connection,
208 int profileid
209);
210
211GPResult
212gpiRemoveFromBlockedList(
213 GPConnection * connection,
214 int profileid
215);
216
218gpiFindBlockedProfile(
219 GPConnection * connection,
220 int blockIndex
221);
222
223GPResult
224gpiProcessRecvBlockedList(
225 GPConnection * connection,
226 const char * input
227);
228
229#endif
Definition gpiProfile.h:54
Definition gpiInfo.h:26
Definition gpiProfile.h:84
Definition gpiProfile.h:67
Definition gpiProfile.h:32