OpenMoHAA
0.82.0
Loading...
Searching...
No Matches
gcdkeys.h
1
/******
2
gcdkeys.h
3
GameSpy CDKey SDK Server Header
4
5
Copyright 1999-2007 GameSpy Industries, Inc
6
7
devsupport@gamespy.com
8
9
******
10
11
Please see the GameSpy CDKey SDK documentation for more
12
information
13
14
******/
15
16
17
#ifndef _GOACDKEYS_H_
18
#define _GOACDKEYS_H_
19
20
#ifdef __cplusplus
21
extern
"C"
{
22
#endif
23
24
#define GUSE_ASSERTS
25
26
/*****
27
QR2CDKEY_INTEGRATION: This define controls where the functions needed to integrate
28
the networking of the Query & Reporting 2 SDK and CDKey SDKs are available.
29
If you intend to use the integration option for these SDKs, you must uncomment the
30
define below, or provide it as an option to your compiler.
31
*******/
32
#define QR2CDKEY_INTEGRATION
33
34
typedef
void (*AuthCallBackFn)(
int
gameid,
int
localid,
int
authenticated,
char
*errmsg,
void
*instance);
35
typedef
void (*RefreshAuthCallBackFn)(
int
gameid,
int
localid,
int
hint,
char
*challenge,
void
*instance);
36
37
/* The hostname of the validation server.
38
If the app resolves the hostname, an
39
IP can be stored here before calling
40
gcd_init */
41
extern
char
gcd_hostname[64];
42
43
/********
44
gcd_init
45
Initializes the Server API and creates the socket
46
Should only be called once (unless gcd_shutdown has been called)
47
*********/
48
int
gcd_init(
int
gameid);
49
50
/********
51
gcd_init_qr2
52
Initializes the Server API and integrates the networking of the CDKey SDK
53
with the Query & Reporting 2 SDK.
54
You must initialize the Query & Reporting 2 SDK with qr2_init or qr2_init_socket
55
prior to calling this. If you are using multiple instances of the QR2 SDK, you
56
can pass the specific instance information in via the "qrec" argument. Otherwise
57
you can simply pass in NULL.
58
*********/
59
#ifdef QR2CDKEY_INTEGRATION
60
61
#include "../qr2/qr2.h"
62
int
gcd_init_qr2(qr2_t qrec,
int
gameid);
63
64
#endif
65
66
/********
67
gcd_shutdown
68
Frees the socket and client structures
69
Also calls gcd_disconnect_all to make sure all users are signaled as offline
70
*********/
71
void
gcd_shutdown(
void
);
72
73
/********
74
gcd_authenticate_user
75
Creates a new client and sends a request for authorization to the
76
validation server.
77
*********/
78
void
gcd_authenticate_user(
int
gameid,
int
localid,
unsigned
int
userip,
const
char
*challenge,
79
const
char
*response, AuthCallBackFn authfn, RefreshAuthCallBackFn refreshfn,
void
*instance);
80
81
/********
82
gcd_authenticate_user
83
Creates a new client and sends a request for authorization to the
84
validation server.
85
*********/
86
void
gcd_process_reauth(
int
gameid,
int
localid,
int
hint,
const
char
*response);
87
88
89
/********
90
gcd_disconnect_user
91
Notify the validation server that a user has disconnected
92
*********/
93
void
gcd_disconnect_user(
int
gameid,
int
localid);
94
95
96
/********
97
gcd_disconnect_all
98
Calls gcd_disconnect_user for each user still online (shortcut)
99
*********/
100
void
gcd_disconnect_all(
int
gameid);
101
102
/********
103
gcd_think
104
Processes any pending data from the validation server
105
and calls the callback to indicate whether a client was
106
authorized or not
107
*********/
108
void
gcd_think(
void
);
109
110
/********
111
gcd_getkeyhash
112
Returns the key hash for the given user. This hash will always
113
be the same for that users, which makes it good for banning or
114
tracking of users (used with the Tracking/Stats SDK). Returns
115
an empty string if that user isn't connected.
116
*********/
117
char
*gcd_getkeyhash(
int
gameid,
int
localid);
118
119
#ifdef __cplusplus
120
}
121
#endif
122
123
#endif
124
code
gamespy
gcdkey
gcdkeys.h
Generated by
1.13.2