OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
gsAvailable.h
1#ifndef _AVAILABLE_H_
2#define _AVAILABLE_H_
3
4#include "gsStringUtil.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#ifndef GSI_UNICODE
11#define GSIStartAvailableCheck GSIStartAvailableCheckA
12#else
13#define GSIStartAvailableCheck GSIStartAvailableCheckW
14#endif
15
16// the available check contacts a backend server at "<gamename>.available.gamespy.com"
17// an app can resolve the hostname itself and store the IP here before starting the check
18extern char GSIACHostname[64];
19
20// these are possible return types for GSIAvailableCheckThink
21typedef enum
22{
23 GSIACWaiting, // still waiting for a response from the backend
24 GSIACAvailable, // the game's backend services are available
25 GSIACUnavailable, // the game's backend services are unavailable
26 GSIACTemporarilyUnavailable // the game's backend services are temporarily unavailable
27} GSIACResult;
28
29// start an available check for a particular game
30// return 0 if no error starting up, non-zero if there's an error
31void GSIStartAvailableCheck(const gsi_char * gamename);
32
33// let the available check think
34// continue to call this while it returns GSIACWaiting
35// if it returns GSIACAvailable, use the GameSpy SDKs as normal
36// if it returns GSIACUnavailable or GSIACTemporarilyUnavailable, do NOT
37// continue to use the GameSpy SDKs. the backend services are not available
38// for the game. in this case, you can show the user a
39// message based on the particular result.
40GSIACResult GSIAvailableCheckThink(void);
41
42// this should only be used if the availability check needs to be aborted
43// for example, if the player leaves the game's multiplayer area before the check completes
44void GSICancelAvailableCheck(void);
45
46// internal use only
47extern GSIACResult __GSIACResult;
48extern char __GSIACGamename[64];
49
50#ifdef __cplusplus
51}
52#endif
53
54#endif