OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
gp.h
1/*
2gp.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#ifndef _GP_H_
14#define _GP_H_
15
16// necessary for gsi_char and UNICODE support
17#include "../common/gsCommon.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23//ENUMS
25typedef enum _GPEnum
26{
27 // Callbacks
29 GP_ERROR = 0,
30 GP_RECV_BUDDY_REQUEST,
31 GP_RECV_BUDDY_STATUS,
32 GP_RECV_BUDDY_MESSAGE,
33 GP_RECV_BUDDY_UTM,
34 GP_RECV_GAME_INVITE,
35 GP_TRANSFER_CALLBACK,
36 GP_RECV_BUDDY_AUTH,
37 GP_RECV_BUDDY_REVOKE,
38
39 // Global States.
41 GP_INFO_CACHING = 0x0100,
42 GP_SIMULATION,
43 GP_INFO_CACHING_BUDDY_AND_BLOCK_ONLY,
44
45 // Blocking
47 GP_BLOCKING = 1,
48 GP_NON_BLOCKING = 0,
49
50 // Firewall
52 GP_FIREWALL = 1,
53 GP_NO_FIREWALL = 0,
54
55 // Check Cache
57 GP_CHECK_CACHE = 1,
58 GP_DONT_CHECK_CACHE = 0,
59
60 // Is Valid Email.
61 // PANTS|02.15.00
63 GP_VALID = 1,
64 GP_INVALID = 0,
65
66 // Fatal Error.
68 GP_FATAL = 1,
69 GP_NON_FATAL = 0,
70
71 // Sex
73 GP_MALE = 0x0500,
74 GP_FEMALE,
75 GP_PAT,
76
77 // Profile Search.
79 GP_MORE = 0x0600,
80 GP_DONE,
81
82 // Set Info
84 GP_NICK = 0x0700,
85 GP_UNIQUENICK,
86 GP_EMAIL,
87 GP_PASSWORD,
88 GP_FIRSTNAME,
89 GP_LASTNAME,
90 GP_ICQUIN,
91 GP_HOMEPAGE,
92 GP_ZIPCODE,
93 GP_COUNTRYCODE,
94 GP_BIRTHDAY,
95 GP_SEX,
96 GP_CPUBRANDID,
97 GP_CPUSPEED,
98 GP_MEMORY,
99 GP_VIDEOCARD1STRING,
100 GP_VIDEOCARD1RAM,
101 GP_VIDEOCARD2STRING,
102 GP_VIDEOCARD2RAM,
103 GP_CONNECTIONID,
104 GP_CONNECTIONSPEED,
105 GP_HASNETWORK,
106 GP_OSSTRING,
107 GP_AIMNAME, // PANTS|03.20.01
108 GP_PIC,
109 GP_OCCUPATIONID,
110 GP_INDUSTRYID,
111 GP_INCOMEID,
112 GP_MARRIEDID,
113 GP_CHILDCOUNT,
114 GP_INTERESTS1,
115
116 // New Profile.
118 GP_REPLACE = 1,
119 GP_DONT_REPLACE = 0,
120
121 // Is Connected.
123 GP_CONNECTED = 1,
124 GP_NOT_CONNECTED = 0,
125
126 // Public mask.
128 GP_MASK_NONE = 0x00000000,
129 GP_MASK_HOMEPAGE = 0x00000001,
130 GP_MASK_ZIPCODE = 0x00000002,
131 GP_MASK_COUNTRYCODE = 0x00000004,
132 GP_MASK_BIRTHDAY = 0x00000008,
133 GP_MASK_SEX = 0x00000010,
134 GP_MASK_EMAIL = 0x00000020,
135 GP_MASK_ALL = 0xFFFFFFFF,
136
137 // Status
139 GP_OFFLINE = 0,
140 GP_ONLINE = 1,
141 GP_PLAYING = 2,
142 GP_STAGING = 3,
143 GP_CHATTING = 4,
144 GP_AWAY = 5,
145
146 // Session flags
148 GP_SESS_IS_CLOSED = 0x00000001,
149 GP_SESS_IS_OPEN = 0x00000002,
150 GP_SESS_HAS_PASSWORD = 0x00000004,
151 GP_SESS_IS_BEHIND_NAT = 0x00000008,
152 GP_SESS_IS_RANKED = 0x000000010,
153
154
155 // CPU Brand ID
157 GP_INTEL = 1,
158 GP_AMD,
159 GP_CYRIX,
160 GP_MOTOROLA,
161 GP_ALPHA,
162
163 // Connection ID.
165 GP_MODEM = 1,
166 GP_ISDN,
167 GP_CABLEMODEM,
168 GP_DSL,
169 GP_SATELLITE,
170 GP_ETHERNET,
171 GP_WIRELESS,
172
173 // Transfer callback type.
174 // *** the transfer is ended when these types are received
176 GP_TRANSFER_SEND_REQUEST = 0x800, // arg->num == numFiles
177 GP_TRANSFER_ACCEPTED,
178 GP_TRANSFER_REJECTED, // ***
179 GP_TRANSFER_NOT_ACCEPTING, // ***
180 GP_TRANSFER_NO_CONNECTION, // ***
181 GP_TRANSFER_DONE, // ***
182 GP_TRANSFER_CANCELLED, // ***
183 GP_TRANSFER_LOST_CONNECTION, // ***
184 GP_TRANSFER_ERROR, // ***
185 GP_TRANSFER_THROTTLE, // arg->num == Bps
186 GP_FILE_BEGIN,
187 GP_FILE_PROGRESS, // arg->num == numBytes
188 GP_FILE_END,
189 GP_FILE_DIRECTORY,
190 GP_FILE_SKIP,
191 GP_FILE_FAILED, // arg->num == error
192
193 // GP_FILE_FAILED error
195 GP_FILE_READ_ERROR = 0x900,
196 GP_FILE_WRITE_ERROR,
197 GP_FILE_DATA_ERROR,
198
199 // Transfer Side.
201 GP_TRANSFER_SENDER = 0xA00,
202 GP_TRANSFER_RECEIVER,
203
204 // UTM send options.
206 GP_DONT_ROUTE = 0xB00, // only send direct
207
208 // Quiet mode flags.
210 GP_SILENCE_NONE = 0x00000000,
211 GP_SILENCE_MESSAGES = 0x00000001,
212 GP_SILENCE_UTMS = 0x00000002,
213 GP_SILENCE_LIST = 0x00000004, // includes requests, auths, and revokes
214 GP_SILENCE_ALL = 0xFFFFFFFF,
215
216 // Flags for checking if newer version of status info is supported
217 GP_NEW_STATUS_INFO_SUPPORTED = 0xC00,
218 GP_NEW_STATUS_INFO_NOT_SUPPORTED = 0xC01
219} GPEnum;
220
221//RESULTS
223typedef enum _GPResult
224{
225 GP_NO_ERROR,
226 GP_MEMORY_ERROR,
227 GP_PARAMETER_ERROR,
228 GP_NETWORK_ERROR,
229 GP_SERVER_ERROR,
230 GP_MISC_ERROR,
231 GP_COUNT
232} GPResult;
233
234//ERROR CODES
236//#define GP_ERROR_TYPE(errorCode) ((errorCode) >> 8)
237typedef enum _GPErrorCode
238{
239 // General.
241 GP_GENERAL = 0x0000,
242 GP_PARSE,
243 GP_NOT_LOGGED_IN,
244 GP_BAD_SESSKEY,
245 GP_DATABASE,
246 GP_NETWORK,
247 GP_FORCED_DISCONNECT,
248 GP_CONNECTION_CLOSED,
249 GP_UDP_LAYER,
250
251 // Login.
253 GP_LOGIN = 0x0100,
254 GP_LOGIN_TIMEOUT,
255
256 GP_LOGIN_BAD_NICK,
257 GP_LOGIN_BAD_EMAIL,
258 GP_LOGIN_BAD_PASSWORD,
259 GP_LOGIN_BAD_PROFILE,
260 GP_LOGIN_PROFILE_DELETED,
261 GP_LOGIN_CONNECTION_FAILED,
262 GP_LOGIN_SERVER_AUTH_FAILED,
263 GP_LOGIN_BAD_UNIQUENICK,
264 GP_LOGIN_BAD_PREAUTH,
265
266 // Newuser.
268 GP_NEWUSER = 0x0200,
269 GP_NEWUSER_BAD_NICK,
270 GP_NEWUSER_BAD_PASSWORD,
271 GP_NEWUSER_UNIQUENICK_INVALID,
272 GP_NEWUSER_UNIQUENICK_INUSE,
273
274 // Updateui.
276 GP_UPDATEUI = 0x0300,
277 GP_UPDATEUI_BAD_EMAIL,
278
279 // Newprofile.
281 GP_NEWPROFILE = 0x0400,
282 GP_NEWPROFILE_BAD_NICK,
283 GP_NEWPROFILE_BAD_OLD_NICK,
284
285 // Updatepro.
287 GP_UPDATEPRO = 0x0500,
288 GP_UPDATEPRO_BAD_NICK,
289
290 // Addbuddy.
292 GP_ADDBUDDY = 0x0600,
293 GP_ADDBUDDY_BAD_FROM,
294 GP_ADDBUDDY_BAD_NEW,
295 GP_ADDBUDDY_ALREADY_BUDDY,
296
297 // Authadd.
299 GP_AUTHADD = 0x0700,
300 GP_AUTHADD_BAD_FROM,
301 GP_AUTHADD_BAD_SIG,
302
303 // Status.
305 GP_STATUS = 0x0800,
306
307 // Bm.
309 GP_BM = 0x0900,
310 GP_BM_NOT_BUDDY,
311 GP_BM_EXT_INFO_NOT_SUPPORTED,
312 GP_BM_BUDDY_OFFLINE,
313
314 // Getprofile.
316 GP_GETPROFILE = 0x0A00,
317 GP_GETPROFILE_BAD_PROFILE,
318
319 // Delbuddy.
321 GP_DELBUDDY = 0x0B00,
322 GP_DELBUDDY_NOT_BUDDY,
323
324 // Delprofile.
326 GP_DELPROFILE = 0x0C00,
327 GP_DELPROFILE_LAST_PROFILE,
328
329 // Search.
331 GP_SEARCH = 0x0D00,
332 GP_SEARCH_CONNECTION_FAILED,
333 GP_SEARCH_TIMED_OUT,
334
335 // Check.
337 GP_CHECK = 0x0E00,
338 GP_CHECK_BAD_EMAIL,
339 GP_CHECK_BAD_NICK,
340 GP_CHECK_BAD_PASSWORD,
341
342 // Revoke.
344 GP_REVOKE = 0x0F00,
345 GP_REVOKE_NOT_BUDDY,
346
347 // Registeruniquenick.
349 GP_REGISTERUNIQUENICK = 0x1000,
350 GP_REGISTERUNIQUENICK_TAKEN,
351 GP_REGISTERUNIQUENICK_RESERVED,
352 GP_REGISTERUNIQUENICK_BAD_NAMESPACE,
353
354 // Register cdkey.
356 GP_REGISTERCDKEY = 0x1100,
357 GP_REGISTERCDKEY_BAD_KEY,
358 GP_REGISTERCDKEY_ALREADY_SET,
359 GP_REGISTERCDKEY_ALREADY_TAKEN,
360
361 // AddBlock.
363 GP_ADDBLOCK = 0x1200,
364 GP_ADDBLOCK_ALREADY_BLOCKED,
365
366 // RemoveBlock.
368 GP_REMOVEBLOCK = 0x1300,
369 GP_REMOVEBLOCK_NOT_BLOCKED
370
371} GPErrorCode;
372
373//STRING LENGTHS
375#define GP_NICK_LEN 31
376#define GP_UNIQUENICK_LEN 21
377#define GP_FIRSTNAME_LEN 31
378#define GP_LASTNAME_LEN 31
379#define GP_EMAIL_LEN 51
380#define GP_PASSWORD_LEN 31
381#define GP_PASSWORDENC_LEN ((((GP_PASSWORD_LEN+2)*4)/3)+1)
382#define GP_HOMEPAGE_LEN 76
383#define GP_ZIPCODE_LEN 11
384#define GP_COUNTRYCODE_LEN 3
385#define GP_PLACE_LEN 128
386#define GP_AIMNAME_LEN 51
387#define GP_REASON_LEN 1025
388#define GP_STATUS_STRING_LEN 256
389#define GP_LOCATION_STRING_LEN 256
390#define GP_ERROR_STRING_LEN 256
391#define GP_AUTHTOKEN_LEN 256
392#define GP_PARTNERCHALLENGE_LEN 256
393#define GP_CDKEY_LEN 65
394#define GP_CDKEYENC_LEN ((((GP_CDKEY_LEN+2)*4)/3)+1)
395#define GP_LOGIN_TICKET_LEN 25
396
397#define GP_RICH_STATUS_LEN 256
398#define GP_STATUS_BASIC_STR_LEN 33
399
400// Random number seed for PASSWORDENC and CDKEYENC
401// MUST MATCH SERVER - If you change this, you'll have to
402// release an updated server
403#define GP_XOR_SEED 0x79707367 // "gspy"
404
405// Well known values for partner ID.
406#define GP_PARTNERID_GAMESPY 0
407#define GP_PARTNERID_IGN 10
408
409// Maximum number of namespaces that can be searched for a uniquenick
410#define GP_MAX_NAMESPACEIDS 16
411
412//TYPES
414// GPConnection
416typedef void * GPConnection;
417
418// GPProfile
420typedef int GPProfile;
421
422// GPTransfer
424typedef int GPTransfer;
425
426// GPCallback
428typedef void (* GPCallback)(
429 GPConnection * connection,
430 void * arg,
431 void * param
432);
433
434//STRUCTURES
436// GPErrorArg
438typedef struct
439{
440 GPResult result;
441 GPErrorCode errorCode;
442 gsi_char * errorString;
443 GPEnum fatal;
444} GPErrorArg;
445
446// GPConnectResponseArg
448typedef struct
449{
450 GPResult result;
451 GPProfile profile;
452 gsi_char uniquenick[GP_UNIQUENICK_LEN];
454
455// GPNewUserResponseArg
457typedef struct
458{
459 GPResult result;
460 GPProfile profile;
462
463// GPCheckResponseArg
465typedef struct
466{
467 GPResult result;
468 GPProfile profile;
470
471// GPSuggestUniqueNickResponseArg
473typedef struct
474{
475 GPResult result;
476 int numSuggestedNicks;
477 gsi_char ** suggestedNicks;
479
480// GPRegisterUniqueNickResponseArg
482typedef struct
483{
484 GPResult result;
486
487// GPRegisterCdKeyResponseArg
489typedef struct
490{
491 GPResult result;
493
494// GPNewProfileResponseArg
496typedef struct
497{
498 GPResult result;
499 GPProfile profile;
501
502// GPDeleteProfileResponseArg
504
505typedef struct
506{
507 GPResult result;
508 GPProfile profile;
510
511// GPProfileSearchMatch
513typedef struct
514{
515 GPProfile profile;
516 gsi_char nick[GP_NICK_LEN];
517 gsi_char uniquenick[GP_UNIQUENICK_LEN];
518 int namespaceID;
519 gsi_char firstname[GP_FIRSTNAME_LEN];
520 gsi_char lastname[GP_LASTNAME_LEN];
521 gsi_char email[GP_EMAIL_LEN];
523
524// GPProfileSearchResponseArg
526typedef struct
527{
528 GPResult result;
529 int numMatches;
530 GPEnum more;
531 GPProfileSearchMatch * matches;
533
534// GPGetInfoResponseArg
536typedef struct
537{
538 GPResult result;
539 GPProfile profile;
540 gsi_char nick[GP_NICK_LEN];
541 gsi_char uniquenick[GP_UNIQUENICK_LEN];
542 gsi_char email[GP_EMAIL_LEN];
543 gsi_char firstname[GP_FIRSTNAME_LEN];
544 gsi_char lastname[GP_LASTNAME_LEN];
545 gsi_char homepage[GP_HOMEPAGE_LEN];
546 int icquin;
547 gsi_char zipcode[GP_ZIPCODE_LEN];
548 gsi_char countrycode[GP_COUNTRYCODE_LEN];
549 float longitude; // negative is west, positive is east. (0, 0) means unknown.
550 float latitude; // negative is south, positive is north. (0, 0) means unknown.
551 gsi_char place[GP_PLACE_LEN]; // e.g., "USA|California|Irvine", "South Korea|Seoul", "Turkey"
552 int birthday;
553 int birthmonth;
554 int birthyear;
555 GPEnum sex;
556 GPEnum publicmask;
557 gsi_char aimname[GP_AIMNAME_LEN];
558 int pic;
559 int occupationid;
560 int industryid;
561 int incomeid;
562 int marriedid;
563 int childcount;
564 int interests1;
565 int ownership1;
566 int conntypeid;
568
569// GPRecvBuddyRequestArg
571typedef struct
572{
573 GPProfile profile;
574 unsigned int date;
575 gsi_char reason[GP_REASON_LEN];
577
578// GPBuddyStatus
580typedef struct
581{
582 GPProfile profile;
583 GPEnum status;
584 gsi_char statusString[GP_STATUS_STRING_LEN];
585 gsi_char locationString[GP_LOCATION_STRING_LEN];
586 unsigned int ip;
587 int port;
588 GPEnum quietModeFlags;
590
591
592// BETA
593//GPBuddyStatusInfo
595typedef struct
596{
597 GPProfile profile;
598 GPEnum statusState;
599 unsigned int buddyIp;
600 unsigned short buddyPort;
601 unsigned int hostIp;
602 unsigned int hostPrivateIp;
603 unsigned short queryPort;
604 unsigned short hostPort;
605 unsigned int sessionFlags;
606 gsi_char richStatus[GP_RICH_STATUS_LEN];
607 gsi_char gameType[GP_STATUS_BASIC_STR_LEN];
608 gsi_char gameVariant[GP_STATUS_BASIC_STR_LEN];
609 gsi_char gameMapName[GP_STATUS_BASIC_STR_LEN];
610 GPEnum quietModeFlags;
611 GPEnum newStatusInfoFlag;
613
614//GPGetBuddyStatusInfoKeysArg
616typedef struct
617{
618 GPProfile profile;
619 gsi_char **keys;
620 gsi_char **values;
621 int numKeys;
622
624
625
626// GPRecvBuddyStatusArg
628typedef struct
629{
630 GPProfile profile;
631 unsigned int date;
632 int index;
634
635// GPRecvBuddyMessageArg
637typedef struct
638{
639 GPProfile profile;
640 unsigned int date;
641 gsi_char * message;
643
644typedef struct
645{
646 GPProfile profile;
647 unsigned int date;
648 gsi_char * message;
650
651typedef struct
652{
653 GPProfile profile;
654 unsigned int date;
656
657typedef struct
658{
659 GPProfile profile;
660 unsigned int date;
662
663// GPTransferCallbackArg;
665typedef struct
666{
667 GPTransfer transfer;
668 GPEnum type;
669 int index;
670 int num;
671 gsi_char * message;
673
674// GPIsValidEmailResponseArg
676typedef struct
677{
678 GPResult result;
679 gsi_char email[GP_EMAIL_LEN];
680 GPEnum isValid;
682
683// GPGetUserNicksResponseArg
685typedef struct
686{
687 GPResult result;
688 gsi_char email[GP_EMAIL_LEN];
689 int numNicks; // If 0, then the email/password did not match.
690 gsi_char ** nicks;
691 gsi_char ** uniquenicks;
693
694// GPRecvGameInviteArg
696typedef struct
697{
698 GPProfile profile;
699 int productID;
700 gsi_char location[GP_LOCATION_STRING_LEN];
702
703// GPFindPlayerMatch
705typedef struct
706{
707 GPProfile profile;
708 gsi_char nick[GP_NICK_LEN];
709 GPEnum status;
710 gsi_char statusString[GP_STATUS_STRING_LEN];
712
713// GPFindPlayersResponseArg
715typedef struct
716{
717 GPResult result;
718 int productID; //PANTS|06.06.00 - added by request for JED
719 int numMatches;
720 GPFindPlayerMatch * matches;
722
723// GPGetReverseBuddiesResponseArg
725typedef struct
726{
727 GPResult result;
728 int numProfiles;
729 GPProfileSearchMatch * profiles;
731
732typedef struct
733{
734 GPProfile profile;
735 gsi_char uniqueNick[GP_UNIQUENICK_LEN];
737
738typedef struct
739{
740 GPResult result;
741 int numOfUniqueMatchs;
742 GPUniqueMatch *matches;
744
745
746//GLOBALS
748/* The hostnames of the connection manager
749server and the search manager server.
750If the app resolves either or both hostnames,
751the IP(s) can be stored in the string(s) before
752calling gpInitialize */
753extern char GPConnectionManagerHostname[64];
754extern char GPSearchManagerHostname[64];
755
756
757//FUNCTIONS
759#ifndef GSI_UNICODE
760#define gpConnect gpConnectA
761#define gpConnectNewUser gpConnectNewUserA
762#define gpConnectUniqueNick gpConnectUniqueNickA
763#define gpConnectPreAuthenticated gpConnectPreAuthenticatedA
764#define gpCheckUser gpCheckUserA
765#define gpNewUser gpNewUserA
766#define gpSuggestUniqueNick gpSuggestUniqueNickA
767#define gpRegisterUniqueNick gpRegisterUniqueNickA
768#define gpRegisterCdKey gpRegisterCdKeyA
769#define gpGetErrorString gpGetErrorStringA
770#define gpNewProfile gpNewProfileA
771#define gpProfileSearch gpProfileSearchA
772#define gpProfileSearchUniquenick gpProfileSearchUniquenickA
773#define gpSetInfos gpSetInfosA
774#define gpSendBuddyRequest gpSendBuddyRequestA
775#ifndef GP_NEW_STATUS_INFO
776#define gpSetStatus gpSetStatusA
777#endif
778#ifdef GP_NEW_STATUS_INFO
779// BETA
780#define gpSetStatusInfo gpSetStatusInfoA
781#endif
782#define gpSendBuddyMessage gpSendBuddyMessageA
783#define gpSendBuddyUTM gpSendBuddyUTMA
784#define gpIsValidEmail gpIsValidEmailA
785#define gpGetUserNicks gpGetUserNicksA
786#define gpSetInfoCacheFilename gpSetInfoCacheFilenameA
787#define gpSendFiles gpSendFilesA
788#define gpAcceptTransfer gpAcceptTransferA
789#define gpRejectTransfer gpRejectTransferA
790#define gpSetTransferDirectory gpSetTransferDirectoryA
791#define gpGetFileName gpGetFileNameA
792#define gpGetFilePath gpGetFilePathA
793#define gpInvitePlayer gpInvitePlayerA
794#ifdef GP_NEW_STATUS_INFO
795// BETA
796#define gpAddStatusInfoKey gpAddStatusInfoKeyA
797#define gpSetStatusInfoKey gpSetStatusInfoKeyA
798#define gpGetStatusInfoKeyVal gpGetStatusInfoKeyValA
799#define gpDelStatusInfoKey gpDelStatusInfoKeyA
800#endif
801#else
802#define gpConnect gpConnectW
803#define gpConnectNewUser gpConnectNewUserW
804#define gpConnectUniqueNick gpConnectUniqueNickW
805#define gpConnectPreAuthenticated gpConnectPreAuthenticatedW
806#define gpCheckUser gpCheckUserW
807#define gpNewUser gpNewUserW
808#define gpSuggestUniqueNick gpSuggestUniqueNickW
809#define gpRegisterUniqueNick gpRegisterUniqueNickW
810#define gpRegisterCdKey gpRegisterCdKeyW
811#define gpGetErrorString gpGetErrorStringW
812#define gpNewProfile gpNewProfileW
813#define gpProfileSearch gpProfileSearchW
814#define gpProfileSearchUniquenick gpProfileSearchUniquenickW
815#define gpSetInfos gpSetInfosW
816#define gpSendBuddyRequest gpSendBuddyRequestW
817#ifndef GP_NEW_STATUS_INFO
818#define gpSetStatus gpSetStatusW
819#endif
820#ifdef GP_NEW_STATUS_INFO
821// BETA
822#define gpSetStatusInfo gpSetStatusInfoW
823#endif
824#define gpSendBuddyMessage gpSendBuddyMessageW
825#define gpSendBuddyUTM gpSendBuddyUTMW
826#define gpIsValidEmail gpIsValidEmailW
827#define gpGetUserNicks gpGetUserNicksW
828#define gpSetInfoCacheFilename gpSetInfoCacheFilenameW
829#define gpSendFiles gpSendFilesW
830#define gpAcceptTransfer gpAcceptTransferW
831#define gpRejectTransfer gpRejectTransferW
832#define gpSetTransferDirectory gpSetTransferDirectoryW
833#define gpGetFileName gpGetFileNameW
834#define gpGetFilePath gpGetFilePathW
835#define gpInvitePlayer gpInvitePlayerW
836// #ifdef GP_NEW_STATUS_INFO
837// BETA
838// #define gpAddStatusInfoKey gpAddStatusInfoKeyW
839// #define gpSetStatusInfoKey gpSetStatusInfoKeyW
840// #define gpGetStatusInfoKeyVal gpGetStatusInfoKeyValW
841// #define gpDelStatusInfoKey gpDelStatusInfoKeyW
842// #endif
843#endif
844
845// gpInitialize
847GPResult gpInitialize
848(
849 GPConnection * connection,
850 int productID, // The productID is a unique ID that identifies your product
851 int namespaceID, // The namespaceID identified which namespace to login under. A namespaceID of 0 indicates that no
852 // namespace should be used. A namespaceID of 1 represents the default GameSpy namespace
853 int partnerID // The partnerID identifies the account system being used.
854 // Use GP_PARTNERID_GAMESPY for GSID accounts.
855 // Use GP_PARTNERID_IGN for IGN accounts.
856);
857
858// gpDestroy
860void gpDestroy(
861 GPConnection * connection
862);
863
864// gpEnable
866GPResult gpEnable
867(
868 GPConnection * connection,
869 GPEnum state
870);
871
872// gpDisable
874GPResult gpDisable
875(
876 GPConnection * connection,
877 GPEnum state
878);
879
880// gpProcess
882GPResult gpProcess
883(
884 GPConnection * connection
885);
886
887// gpSetCallback
889GPResult gpSetCallback
890(
891 GPConnection * connection,
892 GPEnum func,
893 GPCallback callback,
894 void * param
895);
896
897// gpConnect
899GPResult gpConnect
900(
901 GPConnection * connection,
902 const gsi_char nick[GP_NICK_LEN],
903 const gsi_char email[GP_EMAIL_LEN],
904 const gsi_char password[GP_PASSWORD_LEN],
905 GPEnum firewall,
906 GPEnum blocking,
907 GPCallback callback,
908 void * param
909);
910
911// gpConnectNewUser
913GPResult gpConnectNewUser
914(
915 GPConnection * connection,
916 const gsi_char nick[GP_NICK_LEN],
917 const gsi_char uniquenick[GP_UNIQUENICK_LEN],
918 const gsi_char email[GP_EMAIL_LEN],
919 const gsi_char password[GP_PASSWORD_LEN],
920 const gsi_char cdkey[GP_CDKEY_LEN],
921 GPEnum firewall,
922 GPEnum blocking,
923 GPCallback callback,
924 void * param
925);
926
927// gpConnectUniqueNick
929GPResult gpConnectUniqueNick
930(
931 GPConnection * connection,
932 const gsi_char uniquenick[GP_UNIQUENICK_LEN],
933 const gsi_char password[GP_PASSWORD_LEN],
934 GPEnum firewall,
935 GPEnum blocking,
936 GPCallback callback,
937 void * param
938);
939
940// gpConnectPreAuthenticated
942GPResult gpConnectPreAuthenticated
943(
944 GPConnection * connection,
945 const gsi_char authtoken[GP_AUTHTOKEN_LEN],
946 const gsi_char partnerchallenge[GP_PARTNERCHALLENGE_LEN],
947 GPEnum firewall,
948 GPEnum blocking,
949 GPCallback callback,
950 void * param
951);
952
953// gpDisconnect
955void gpDisconnect
956(
957 GPConnection * connection
958);
959
960// gpIsConnected
962GPResult gpIsConnected
963(
964 GPConnection * connection,
965 GPEnum * connected
966);
967
968// gpCheckUser
970GPResult gpCheckUser
971(
972 GPConnection * connection,
973 const gsi_char nick[GP_NICK_LEN],
974 const gsi_char email[GP_EMAIL_LEN],
975 const gsi_char password[GP_PASSWORD_LEN],
976 GPEnum blocking,
977 GPCallback callback,
978 void * param
979);
980
981// gpNewUser
983GPResult gpNewUser
984(
985 GPConnection * connection,
986 const gsi_char nick[GP_NICK_LEN],
987 const gsi_char uniquenick[GP_UNIQUENICK_LEN],
988 const gsi_char email[GP_EMAIL_LEN],
989 const gsi_char password[GP_PASSWORD_LEN],
990 const gsi_char cdkey[GP_CDKEY_LEN],
991 GPEnum blocking,
992 GPCallback callback,
993 void * param
994);
995
996// gpSuggestUniqueNick
998GPResult gpSuggestUniqueNick
999(
1000 GPConnection * connection,
1001 const gsi_char desirednick[GP_UNIQUENICK_LEN],
1002 GPEnum blocking,
1003 GPCallback callback,
1004 void * param
1005);
1006
1007// gpRegisterUniqueNick
1009GPResult gpRegisterUniqueNick
1010(
1011 GPConnection * connection,
1012 const gsi_char uniquenick[GP_UNIQUENICK_LEN],
1013 const gsi_char cdkey[GP_CDKEY_LEN],
1014 GPEnum blocking,
1015 GPCallback callback,
1016 void * param
1017);
1018
1019// gpRegisterCdKey
1021GPResult gpRegisterCdKey
1022(
1023 GPConnection * connection,
1024 const gsi_char cdkey[GP_CDKEY_LEN],
1025 GPEnum blocking,
1026 GPCallback callback,
1027 void * param
1028);
1029
1030// gpGetErrorCode
1032GPResult gpGetErrorCode(
1033 GPConnection * connection,
1034 GPErrorCode * errorCode
1035);
1036
1037// gpGetErrorString
1039GPResult gpGetErrorString(
1040 GPConnection * connection,
1041 gsi_char errorString[GP_ERROR_STRING_LEN]
1042);
1043
1044// gpNewProfile
1046GPResult gpNewProfile(
1047 GPConnection * connection,
1048 const gsi_char nick[GP_NICK_LEN],
1049 GPEnum replace,
1050 GPEnum blocking,
1051 GPCallback callback,
1052 void * param
1053);
1054
1055// gpDeleteProfile
1057GPResult gpDeleteProfile(
1058 GPConnection * connection,
1059 GPCallback callback,
1060 void * param
1061);
1062
1063// gpProfileFromID
1064// PANTS|09.11.00 - A GPProfile is now the same
1065// as a profileid. This function is no longer needed
1066// and will be removed in a future version of GP.
1068GPResult gpProfileFromID(
1069 GPConnection * connection,
1070 GPProfile * profile,
1071 int id
1072);
1073
1074// gpIDFromProfile
1075// PANTS|09.11.00 - A GPProfile is now the same
1076// as a profileid. This function is no longer needed
1077// and will be removed in a future version of GP.
1079GPResult gpIDFromProfile(
1080 GPConnection * connection,
1081 GPProfile profile,
1082 int * id
1083);
1084
1085// gpUserIDFromProfile
1087GPResult gpUserIDFromProfile(
1088 GPConnection * connection,
1089 GPProfile profile,
1090 int * userid
1091);
1092
1093// gpProfileSearch
1095GPResult gpProfileSearch(
1096 GPConnection * connection,
1097 const gsi_char nick[GP_NICK_LEN],
1098 const gsi_char uniquenick[GP_UNIQUENICK_LEN],
1099 const gsi_char email[GP_EMAIL_LEN],
1100 const gsi_char firstname[GP_FIRSTNAME_LEN],
1101 const gsi_char lastname[GP_LASTNAME_LEN],
1102 int icquin,
1103 GPEnum blocking,
1104 GPCallback callback,
1105 void * param
1106);
1107
1108// gpProfileSearchUniquenick
1110GPResult gpProfileSearchUniquenick(
1111 GPConnection * connection,
1112 const gsi_char uniquenick[GP_UNIQUENICK_LEN],
1113 const int namespaceIDs[GP_MAX_NAMESPACEIDS],
1114 int numNamespaces,
1115 GPEnum blocking,
1116 GPCallback callback,
1117 void * param
1118);
1119
1120// gpGetInfo
1122GPResult gpGetInfo(
1123 GPConnection * connection,
1124 GPProfile profile,
1125 GPEnum checkCache,
1126 GPEnum blocking,
1127 GPCallback callback,
1128 void * param
1129);
1130
1131// gpGetInfoNoWait
1133GPResult gpGetInfoNoWait(
1134 GPConnection * connection,
1135 GPProfile profile,
1137);
1138
1139// gpSetInfoi
1141GPResult gpSetInfoi(
1142 GPConnection * connection,
1143 GPEnum info,
1144 int value
1145);
1146
1147// gpSetInfos
1149GPResult gpSetInfos(
1150 GPConnection * connection,
1151 GPEnum info,
1152 const gsi_char * value
1153);
1154
1155// gpSetInfod
1157GPResult gpSetInfod(
1158 GPConnection * connection,
1159 GPEnum info,
1160 int day,
1161 int month,
1162 int year
1163);
1164
1165// gpSetInfoMask
1167GPResult gpSetInfoMask(
1168 GPConnection * connection,
1169 GPEnum mask
1170);
1171
1172// gpSendBuddyRequest
1174GPResult gpSendBuddyRequest(
1175 GPConnection * connection,
1176 GPProfile profile,
1177 const gsi_char reason[GP_REASON_LEN]
1178);
1179
1180// gpAuthBuddyRequest
1182GPResult gpAuthBuddyRequest(
1183 GPConnection * connection,
1184 GPProfile profile
1185);
1186
1187// gpDenyBuddyRequest
1188// PANTS|09.11.00
1190GPResult gpDenyBuddyRequest(
1191 GPConnection * connection,
1192 GPProfile profile
1193);
1194
1195// gpDeleteBuddy
1197GPResult gpDeleteBuddy(
1198 GPConnection * connection,
1199 GPProfile profile
1200);
1201
1202// gpAddToBlockedList
1204GPResult gpAddToBlockedList(
1205 GPConnection * connection,
1206 GPProfile profile
1207);
1208
1209// gpRemoveFromBlockedList
1211GPResult gpRemoveFromBlockedList(
1212 GPConnection * connection,
1213 GPProfile profile
1214);
1215
1216// gpGetNumBlocked
1218GPResult gpGetNumBlocked(
1219 GPConnection * connection,
1220 int * numBlocked
1221);
1222
1223// gpGetBlockedProfile
1225GPResult gpGetBlockedProfile(
1226 GPConnection * connection,
1227 int index,
1228 GPProfile * profile
1229);
1230
1231// gpIsBlocked
1232// returns gsi_true if blocked, gsi_false if not blocked
1234gsi_bool gpIsBlocked(
1235 GPConnection * connection,
1236 GPProfile profile
1237);
1238
1239// gpGetNumBuddies
1241GPResult gpGetNumBuddies(
1242 GPConnection * connection,
1243 int * numBuddies
1244);
1245
1246// gpGetBuddyStatus
1248#ifndef GP_NEW_STATUS_INFO
1249GPResult gpGetBuddyStatus(
1250 GPConnection * connection,
1251 int index,
1252 GPBuddyStatus * status
1253);
1254#endif
1255
1256#ifdef GP_NEW_STATUS_INFO
1257//
1259GPResult gpGetBuddyStatusInfo(
1260 GPConnection * connection,
1261 int index,
1262 GPBuddyStatusInfo * statusInfo
1263);
1264
1265GPResult gpSetBuddyAddr(
1266 GPConnection *connection,
1267 int index,
1268 unsigned int buddyIp,
1269 unsigned short buddyPort
1270);
1271#endif
1272// gpGetBuddyIndex
1274GPResult gpGetBuddyIndex(
1275 GPConnection * connection,
1276 GPProfile profile,
1277 int * index
1278);
1279
1280// gpIsBuddy
1281// returns 1 if a buddy, 0 if not a buddy
1283int gpIsBuddy(
1284 GPConnection * connection,
1285 GPProfile profile
1286);
1287
1288int gpIsBuddyConnectionOpen(
1289 GPConnection * connection,
1290 GPProfile profile
1291);
1292
1293// gpSetStatus
1295#ifndef GP_NEW_STATUS_INFO
1296GPResult gpSetStatus(
1297 GPConnection * connection,
1298 GPEnum status,
1299 const gsi_char statusString[GP_STATUS_STRING_LEN],
1300 const gsi_char locationString[GP_LOCATION_STRING_LEN]
1301);
1302#endif
1303
1304#ifdef GP_NEW_STATUS_INFO
1305GPResult gpSetStatusInfo(
1306 GPConnection *connection,
1307 GPEnum statusState,
1308 unsigned int hostIp,
1309 unsigned int hostPrivateIp,
1310 unsigned short queryPort,
1311 unsigned short hostPort,
1312 unsigned int sessionFlags,
1313 const gsi_char *richStatus,
1314 int richStatusLen,
1315 const gsi_char *gameType,
1316 int gameTypeLen,
1317 const gsi_char *gameVariant,
1318 int gameVariantLen,
1319 const gsi_char *gameMapName,
1320 int gameMapNameLen
1321);
1322
1323GPResult gpAddStatusInfoKey(GPConnection *connection, const gsi_char *keyName, const gsi_char *keyValue);
1324GPResult gpSetStatusInfoKey(GPConnection *connection, const gsi_char *keyName, const gsi_char *keyValue);
1325GPResult gpGetStatusInfoKeyVal(GPConnection *connection, const gsi_char *keyName, gsi_char **keyValue);
1326GPResult gpDelStatusInfoKey(GPConnection *connection, const gsi_char *keyName);
1327
1328GPResult gpGetBuddyStatusInfoKeys(GPConnection *connection, int index, GPCallback callback, void *userData);
1329#endif
1330// gpSendBuddyMessage
1332GPResult gpSendBuddyMessage(
1333 GPConnection * connection,
1334 GPProfile profile,
1335 const gsi_char * message
1336);
1337
1338// gpSendBuddyUTM
1340GPResult gpSendBuddyUTM(
1341 GPConnection * connection,
1342 GPProfile profile,
1343 const gsi_char * message,
1344 int sendOption // GP_DONT_ROUTE
1345);
1346
1347
1348// PANTS|02.15.00
1349// Added gpIsValidEmail and gpGetUserNicks for login wizard.
1351
1352// gpIsValidEmail
1354GPResult gpIsValidEmail(
1355 GPConnection * connection,
1356 const gsi_char email[GP_EMAIL_LEN],
1357 GPEnum blocking,
1358 GPCallback callback,
1359 void * param
1360);
1361
1362// gpGetUserNicks
1364GPResult gpGetUserNicks(
1365 GPConnection * connection,
1366 const gsi_char email[GP_EMAIL_LEN],
1367 const gsi_char password[GP_PASSWORD_LEN],
1368 GPEnum blocking,
1369 GPCallback callback,
1370 void * param
1371);
1372
1373// *DEPRECATED*
1374// gpSetInvitableGames
1376GPResult gpSetInvitableGames(
1377 GPConnection * connection,
1378 int numProductIDs,
1379 const int * productIDs
1380);
1381
1382// *DEPRECATED*
1383// gpFindPlayers
1385GPResult gpFindPlayers(
1386 GPConnection * connection,
1387 int productID,
1388 GPEnum blocking,
1389 GPCallback callback,
1390 void * param
1391);
1392
1393// gpInvitePlayer
1395GPResult gpInvitePlayer(
1396 GPConnection * connection,
1397 GPProfile profile,
1398 int productID,
1399 const gsi_char location[GP_LOCATION_STRING_LEN]
1400);
1401
1402// gpGetReverseBuddies
1403// Get profiles that have you on their buddy list.
1405GPResult gpGetReverseBuddies(
1406 GPConnection * connection,
1407 GPEnum blocking,
1408 GPCallback callback,
1409 void * param
1410);
1411
1412// gpGetReverseBuddiesList
1413// Get profile ids and unique nicks for profiles
1414// that have you on their buddy list.
1416GPResult gpGetReversBuddiesList( GPConnection * connection,
1417 GPProfile *targets, int numOfTargets,
1418 GPEnum blocking,
1419 GPCallback callback,
1420 void * param
1421);
1422
1423// gpRevokeBuddyAuthorization
1425GPResult gpRevokeBuddyAuthorization(
1426 GPConnection * connection,
1427 GPProfile profile
1428);
1429
1430// gpSetCdKey
1431GPResult gpSetCdKey(
1432 GPConnection * connection,
1433 const gsi_char cdkeyhash,
1434 GPCallback callback
1435);
1436
1437// gpGetLoginTicket
1439GPResult gpGetLoginTicket(
1440 GPConnection * connection,
1441 char loginTicket[GP_LOGIN_TICKET_LEN]
1442);
1443
1444// gpSetQuietMode
1446GPResult gpSetQuietMode(
1447 GPConnection * connection,
1448 GPEnum flags
1449);
1450
1451#ifndef NOFILE
1452
1453// gpiSetInfoCacheFilename
1454// Should be called before gpIntialize.
1456void gpSetInfoCacheFilename(
1457 const gsi_char * filename
1458);
1459
1461// FILE TRANSFER //
1463typedef void (* gpSendFilesCallback)(
1464 GPConnection * connection,
1465 int index,
1466 const gsi_char ** path,
1467 const gsi_char ** name,
1468 void * param
1469);
1470
1471GPResult gpSendFiles(
1472 GPConnection * connection,
1473 GPTransfer * transfer,
1474 GPProfile profile,
1475 const gsi_char * message,
1476 gpSendFilesCallback callback,
1477 void * param
1478);
1479
1480GPResult gpAcceptTransfer(
1481 GPConnection * connection,
1482 GPTransfer transfer,
1483 const gsi_char * message
1484);
1485
1486GPResult gpRejectTransfer(
1487 GPConnection * connection,
1488 GPTransfer transfer,
1489 const gsi_char * message
1490);
1491
1492GPResult gpFreeTransfer(
1493 GPConnection * connection,
1494 GPTransfer transfer
1495);
1496
1497GPResult gpSetTransferData(
1498 GPConnection * connection,
1499 GPTransfer transfer,
1500 void * userData
1501);
1502
1503void * gpGetTransferData(
1504 GPConnection * connection,
1505 GPTransfer transfer
1506);
1507
1508GPResult gpSetTransferDirectory(
1509 GPConnection * connection,
1510 GPTransfer transfer,
1511 const gsi_char * directory
1512);
1513
1514// NOTE: THROTTLING IS NOT CURRENTLY IMPLEMENTED
1515GPResult gpSetTransferThrottle(
1516 GPConnection * connection,
1517 GPTransfer transfer,
1518 int throttle
1519);
1520
1521// NOTE: THROTTLING IS NOT CURRENTLY IMPLEMENTED
1522GPResult gpGetTransferThrottle(
1523 GPConnection * connection,
1524 GPTransfer transfer,
1525 int * throttle
1526);
1527
1528GPResult gpGetTransferProfile(
1529 GPConnection * connection,
1530 GPTransfer transfer,
1531 GPProfile * profile
1532);
1533
1534GPResult gpGetTransferSide(
1535 GPConnection * connection,
1536 GPTransfer transfer,
1537 GPEnum * side
1538);
1539
1540GPResult gpGetTransferSize(
1541 GPConnection * connection,
1542 GPTransfer transfer,
1543 int * size
1544);
1545
1546GPResult gpGetTransferProgress(
1547 GPConnection * connection,
1548 GPTransfer transfer,
1549 int * progress
1550);
1551
1552GPResult gpGetNumFiles(
1553 GPConnection * connection,
1554 GPTransfer transfer,
1555 int * num
1556);
1557
1558GPResult gpGetCurrentFile(
1559 GPConnection * connection,
1560 GPTransfer transfer,
1561 int * index
1562);
1563
1564GPResult gpSkipFile(
1565 GPConnection * connection,
1566 GPTransfer transfer,
1567 int index
1568);
1569
1570GPResult gpGetFileName(
1571 GPConnection * connection,
1572 GPTransfer transfer,
1573 int index,
1574 gsi_char ** name
1575);
1576
1577GPResult gpGetFilePath(
1578 GPConnection * connection,
1579 GPTransfer transfer,
1580 int index,
1581 gsi_char ** path
1582);
1583
1584GPResult gpGetFileSize(
1585 GPConnection * connection,
1586 GPTransfer transfer,
1587 int index,
1588 int * size
1589);
1590
1591GPResult gpGetFileProgress(
1592 GPConnection * connection,
1593 GPTransfer transfer,
1594 int index,
1595 int * progress
1596);
1597
1598GPResult gpGetFileModificationTime(
1599 GPConnection * connection,
1600 GPTransfer transfer,
1601 int index,
1602 gsi_time * modTime
1603);
1604
1605GPResult gpGetNumTransfers(
1606 GPConnection * connection,
1607 int * num
1608);
1609
1610GPResult gpGetTransfer(
1611 GPConnection * connection,
1612 int index,
1613 GPTransfer * transfer
1614);
1615#endif
1616
1617#ifdef _DEBUG
1618// gpProfilesReport
1619// PANTS|09.11.00
1621void gpProfilesReport(
1622 GPConnection * connection,
1623 void (* report)(const char * output)
1624);
1625#endif
1626
1627#ifdef __cplusplus
1628}
1629#endif
1630
1631#endif
Definition gp.h:596
Definition gp.h:581
Definition gp.h:466
Definition gp.h:449
Definition gp.h:506
Definition gp.h:439
Definition gp.h:706
Definition gp.h:716
Definition gp.h:617
Definition gp.h:537
Definition gp.h:686
Definition gp.h:677
Definition gp.h:497
Definition gp.h:458
Definition gp.h:514
Definition gp.h:527
Definition gp.h:652
Definition gp.h:638
Definition gp.h:572
Definition gp.h:658
Definition gp.h:629
Definition gp.h:645
Definition gp.h:697
Definition gp.h:490
Definition gp.h:666
Definition gp.h:733
Definition puff.c:88