OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
pt.h
1/*
2GameSpy PT SDK
3Dan "Mr. Pants" Schoenblum
4dan@gamespy.com
5
6Copyright 2000 GameSpy Industries, Inc
7
8*/
9
10/**************************************
11** GameSpy Patching and Tracking SDK **
12**************************************/
13
14#ifndef _PT_H_
15#define _PT_H_
16
17#include "../common/gsCommon.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/**********
24** TYPES **
25**********/
26
27// Boolean.
29typedef int PTBool;
30#define PTFalse 0
31#define PTTrue 1
32
33/**************
34** FUNCTIONS **
35**************/
36#ifndef GSI_UNICODE
37#define ptCheckForPatch ptCheckForPatchA
38#define ptTrackUsage ptTrackUsageA
39#define ptCheckForPatchAndTrackUsage ptCheckForPatchAndTrackUsageA
40#define ptCreateCheckPatchTrackUsageReq ptCreateCheckPatchTrackUsageReqA
41#else
42#define ptCheckForPatch ptCheckForPatchW
43#define ptTrackUsage ptTrackUsageW
44#define ptCheckForPatchAndTrackUsage ptCheckForPatchAndTrackUsageW
45#define ptCreateCheckPatchTrackUsageReq ptCreateCheckPatchTrackUsageReqW
46#endif
47
48// This callback gets called when a patch is being checked for
49// with either ptCheckForPatch or ptCheckForPatchAndTrackUsage.
50// If a patch is available, and the fileID is not 0, then
51// ptLookupFilePlanetInfo can be used to find download sites.
53typedef void (* ptPatchCallback)
54(
55 PTBool available, // If PTTrue, a patch is available.
56 PTBool mandatory, // If PTTrue, this patch is flagged as being mandatory.
57 const gsi_char * versionName, // The display name for the new version.
58 int fileID, // The FilePlanet fileID for the patch, or 0.
59 const gsi_char * downloadURL, // A URL to download the patch from, or NULL.
60 void * param // User-data passed originally passed to the function.
61);
62
63// Check for a patch for the current version and particular
64// distribution of the product. If this function does not return
65// PTFalse, then the callback will be called with info on a
66// possible patch to a newer version.
68PTBool ptCheckForPatch
69(
70 int productID, // The ID of this product.
71 const gsi_char * versionUniqueID, // A string uniquely identifying this version.
72 int distributionID, // The distribution ID for this version. Can be 0.
73 ptPatchCallback callback, // The callback to call with the patch info.
74 PTBool blocking, // If PTTrue, don't return until after the callback is called.
75 void * param // User-data to pass to the callback.
76);
77
78// Used to track usage of a product, based on version and distribution.
79// If PTFalse is returned, there was an error tracking usage.
81PTBool ptTrackUsage
82(
83 int userID, // The GP userID of the user who is using the product. Can be 0.
84 int productID, // The ID of this product.
85 const gsi_char * versionUniqueID, // A string uniquely identifying this version.
86 int distributionID, // The distribution ID for this version. Can be 0.
87 PTBool blocking
88);
89
90// This does the same thing as both ptCheckForPatch and
91// ptTrackUsage in one call.
93PTBool ptCheckForPatchAndTrackUsage
94(
95 int userID, // The GP userID of the user who is using the product. Can be 0.
96 int productID, // The ID of this product.
97 const gsi_char * versionUniqueID, // A string uniquely identifying this version.
98 int distributionID, // The distribution ID for this version. Can be 0.
99 ptPatchCallback callback, // The callback to call with the patch info.
100 PTBool blocking, // If PTTrue, don't return until after the callback is called.
101 void * param // User-data to pass to the callback.
102);
103
104// This function is similar to the function ptCheckForPatchAndTrackUsage
105// except that it returns a handle that can be used to call ghttpRequestThink
106// or a failure of -1
108PTBool ptCreateCheckPatchTrackUsageReq
109(
110 int userID, // The GP userID of the user who is using the product. Can be 0.
111 int productID, // The ID of this product.
112 const gsi_char * versionUniqueID, // A string uniquely identifying this version.
113 int distributionID, // The distribution ID for this version. Can be 0.
114 ptPatchCallback callback, // The callback to call with the patch info.
115 PTBool blocking, // If PTTrue, don't return until after the callback is called.
116 int *request, // The request that can be used for ghttpRequestThink
117 void * param // User-data to pass to the callback.
118 );
119
120// This callback gets called when looking up info on a
121// FilePlanet file. If the file is found, it provides a
122// text description, size, and a list of download sites.
124typedef void (* ptFilePlanetInfoCallback)
125(
126 int fileID, // The ID of the file for which info was looked up.
127 PTBool found, // PTTrue if the file was found.
128 const gsi_char * description, // A user-readable description of the file.
129 const gsi_char * size, // A user-readable size of the file.
130 int numMirrors, // The number of mirrors found for this file.
131 const gsi_char ** mirrorNames, // The names of the mirrors.
132 const gsi_char ** mirrorURLs, // The URLS for downloading the files.
133 void * param // User-data passed originally passed to the function.
134);
135
136// 9/7/2004 (xgd) ptLookupFilePlanetInfo() deprecated; per case 2724.
137//
138// Use this function to lookup info on a fileplanet file, by ID.
139// This can be used to find a list of download sites for a patch
140// based on the fileID passed to ptPatchCallback. If PTFalse is
141// returned, then there was an error and the callback will not
142// be called.
144PTBool ptLookupFilePlanetInfo
145(
146 int fileID, // The ID of the file to find info on.
147 ptFilePlanetInfoCallback callback, // The callback to call with the patch info.
148 PTBool blocking, // If PTTrue, don't return until after the callback is called.
149 void * param // User-data to pass to the callback.
150);
151
152#ifdef __cplusplus
153}
154#endif
155
156#endif