|
1 | | -#include "stdafx.h" |
2 | 1 | #include "GameSpy_ATLAS.h" |
| 2 | +#include "stdafx.h" |
3 | 3 |
|
4 | | -CGameSpy_ATLAS::CGameSpy_ATLAS () |
| 4 | +CGameSpy_ATLAS::CGameSpy_ATLAS() |
5 | 5 | { |
6 | | - m_interface = NULL; |
7 | | - Init (); |
| 6 | + m_interface = NULL; |
| 7 | + Init(); |
8 | 8 | } |
9 | 9 |
|
10 | | -CGameSpy_ATLAS::~CGameSpy_ATLAS () |
| 10 | +CGameSpy_ATLAS::~CGameSpy_ATLAS() |
11 | 11 | { |
12 | | - if (m_interface) |
13 | | - { |
14 | | - scShutdown(m_interface); |
15 | | - } |
| 12 | + if (m_interface) { |
| 13 | + scShutdown(m_interface); |
| 14 | + } |
16 | 15 | } |
17 | 16 |
|
18 | 17 | void CGameSpy_ATLAS::Init() |
19 | 18 | { |
20 | | - SCResult init_res = scInitialize(GAMESPY_GAMEID, &m_interface); |
21 | | - VERIFY(init_res == SCResult_NO_ERROR); |
22 | | - if (init_res != SCResult_NO_ERROR) |
23 | | - { |
24 | | - Msg("! GameSpy ATLAS: failed to initialize, error code: %d", init_res); |
25 | | - } |
| 19 | + SCResult init_res = scInitialize(GAMESPY_GAMEID, &m_interface); |
| 20 | + VERIFY(init_res == SCResult_NO_ERROR); |
| 21 | + if (init_res != SCResult_NO_ERROR) { |
| 22 | + Msg("! GameSpy ATLAS: failed to initialize, error code: %d", init_res); |
| 23 | + } |
26 | 24 | } |
27 | 25 |
|
28 | 26 | void CGameSpy_ATLAS::Think() |
29 | 27 | { |
30 | | - scThink(m_interface); |
| 28 | + scThink(m_interface); |
31 | 29 | } |
32 | 30 |
|
33 | 31 | shared_str const CGameSpy_ATLAS::TryToTranslate(GHTTPResult httpResult) |
34 | 32 | { |
35 | | - return "mp_gamespy_http_error"; |
| 33 | + return "mp_gamespy_http_error"; |
36 | 34 | } |
37 | 35 |
|
38 | 36 | shared_str const CGameSpy_ATLAS::TryToTranslate(WSLoginValue loginValue) |
39 | 37 | { |
40 | | - return "mp_gamespy_ws_login_error"; |
| 38 | + return "mp_gamespy_ws_login_error"; |
41 | 39 | } |
42 | 40 |
|
43 | 41 | shared_str const CGameSpy_ATLAS::TryToTranslate(SCResult result) |
44 | 42 | { |
45 | | - return "mp_gamespy_atlas_error"; |
| 43 | + return "mp_gamespy_atlas_error"; |
46 | 44 | } |
47 | 45 |
|
48 | | -u32 CGameSpy_ATLAS::WSLoginProfile(shared_str const & email, |
49 | | - shared_str const & nick, |
50 | | - shared_str const & password, |
51 | | - WSLoginCallback callback, |
52 | | - void * userData) |
| 46 | +u32 CGameSpy_ATLAS::WSLoginProfile(shared_str const& email, shared_str const& nick, shared_str const& password, |
| 47 | + WSLoginCallback callback, void* userData) |
53 | 48 | { |
54 | | - return static_cast<u32>(wsLoginProfile(GP_PARTNERID_GAMESPY, GAMESPY_GP_NAMESPACE_ID, |
55 | | - nick.c_str(), email.c_str(), password.c_str(), NULL, callback, userData)); |
| 49 | + return static_cast<u32>(wsLoginProfile(GP_PARTNERID_GAMESPY, GAMESPY_GP_NAMESPACE_ID, nick.c_str(), email.c_str(), |
| 50 | + password.c_str(), NULL, callback, userData)); |
56 | 51 | } |
57 | 52 |
|
58 | | -SCResult CGameSpy_ATLAS::CreateSession(const GSLoginCertificate * theCertificate, |
59 | | - const GSLoginPrivateData * thePrivateData, |
60 | | - SCCreateSessionCallback theCallback, |
61 | | - gsi_time theTimeoutMs, |
62 | | - void * theUserData) |
| 53 | +SCResult CGameSpy_ATLAS::CreateSession(const GSLoginCertificate* theCertificate, |
| 54 | + const GSLoginPrivateData* thePrivateData, SCCreateSessionCallback theCallback, gsi_time theTimeoutMs, |
| 55 | + void* theUserData) |
63 | 56 | { |
64 | | - return scCreateSession( |
65 | | - m_interface, |
66 | | - theCertificate, |
67 | | - thePrivateData, |
68 | | - theCallback, |
69 | | - theTimeoutMs, |
70 | | - theUserData |
71 | | - ); |
| 57 | + return scCreateSession(m_interface, theCertificate, thePrivateData, theCallback, theTimeoutMs, theUserData); |
72 | 58 | } |
73 | 59 |
|
74 | 60 | SCResult CGameSpy_ATLAS::SetReportIntention(const gsi_u8 theConnectionId[SC_CONNECTION_GUID_SIZE], |
75 | | - gsi_bool isAuthoritative, |
76 | | - const GSLoginCertificate * theCertificate, |
77 | | - const GSLoginPrivateData * thePrivateData, |
78 | | - SCSetReportIntentionCallback theCallback, |
79 | | - gsi_time theTimeoutMs, |
80 | | - void * theUserData) |
81 | | -{ |
82 | | - return scSetReportIntention( |
83 | | - m_interface, |
84 | | - theConnectionId, |
85 | | - isAuthoritative, |
86 | | - theCertificate, |
87 | | - thePrivateData, |
88 | | - theCallback, |
89 | | - theTimeoutMs, |
90 | | - theUserData |
91 | | - ); |
92 | | -} |
93 | | - |
94 | | -char const* CGameSpy_ATLAS::GetConnectionId() |
95 | | -{ |
96 | | - return scGetConnectionId(m_interface); |
97 | | -} |
98 | | - |
99 | | -SCResult CGameSpy_ATLAS::SubmitReport(const SCReportPtr theReport, |
100 | | - gsi_bool isAuthoritative, |
101 | | - const GSLoginCertificate * theCertificate, |
102 | | - const GSLoginPrivateData * thePrivateData, |
103 | | - SCSubmitReportCallback theCallback, |
104 | | - gsi_time theTimeoutMs, |
105 | | - void * theUserData) |
106 | | -{ |
107 | | - return scSubmitReport( |
108 | | - m_interface, |
109 | | - theReport, |
110 | | - isAuthoritative, |
111 | | - theCertificate, |
112 | | - thePrivateData, |
113 | | - theCallback, |
114 | | - theTimeoutMs, |
115 | | - theUserData |
116 | | - ); |
117 | | -} |
118 | | - |
119 | | -SCResult CGameSpy_ATLAS::CreateReport(gsi_u32 theHeaderVersion, |
120 | | - gsi_u32 thePlayerCount, |
121 | | - gsi_u32 theTeamCount, |
122 | | - SCReportPtr * theReportOut) |
123 | | -{ |
124 | | - return scCreateReport( |
125 | | - m_interface, |
126 | | - theHeaderVersion, |
127 | | - thePlayerCount, |
128 | | - theTeamCount, |
129 | | - theReportOut |
130 | | - ); |
| 61 | + gsi_bool isAuthoritative, const GSLoginCertificate* theCertificate, const GSLoginPrivateData* thePrivateData, |
| 62 | + SCSetReportIntentionCallback theCallback, gsi_time theTimeoutMs, void* theUserData) |
| 63 | +{ |
| 64 | + return scSetReportIntention(m_interface, theConnectionId, isAuthoritative, theCertificate, thePrivateData, |
| 65 | + theCallback, theTimeoutMs, theUserData); |
| 66 | +} |
| 67 | + |
| 68 | +char const* CGameSpy_ATLAS::GetConnectionId() |
| 69 | +{ |
| 70 | + return scGetConnectionId(m_interface); |
| 71 | +} |
| 72 | + |
| 73 | +SCResult CGameSpy_ATLAS::SubmitReport(const SCReportPtr theReport, gsi_bool isAuthoritative, |
| 74 | + const GSLoginCertificate* theCertificate, const GSLoginPrivateData* thePrivateData, |
| 75 | + SCSubmitReportCallback theCallback, gsi_time theTimeoutMs, void* theUserData) |
| 76 | +{ |
| 77 | + return scSubmitReport(m_interface, theReport, isAuthoritative, theCertificate, thePrivateData, theCallback, |
| 78 | + theTimeoutMs, theUserData); |
| 79 | +} |
| 80 | + |
| 81 | +SCResult CGameSpy_ATLAS::CreateReport( |
| 82 | + gsi_u32 theHeaderVersion, gsi_u32 thePlayerCount, gsi_u32 theTeamCount, SCReportPtr* theReportOut) |
| 83 | +{ |
| 84 | + return scCreateReport(m_interface, theHeaderVersion, thePlayerCount, theTeamCount, theReportOut); |
131 | 85 | } |
132 | 86 | SCResult CGameSpy_ATLAS::ReportBeginGlobalData(SCReportPtr theReportData) |
133 | 87 | { |
134 | | - return scReportBeginGlobalData(theReportData); |
| 88 | + return scReportBeginGlobalData(theReportData); |
135 | 89 | } |
136 | 90 |
|
137 | 91 | SCResult CGameSpy_ATLAS::ReportBeginPlayerData(SCReportPtr theReportData) |
138 | 92 | { |
139 | | - return scReportBeginPlayerData(theReportData); |
| 93 | + return scReportBeginPlayerData(theReportData); |
140 | 94 | } |
141 | 95 |
|
142 | 96 | SCResult CGameSpy_ATLAS::ReportBeginNewPlayer(SCReportPtr theReportData) |
143 | 97 | { |
144 | | - return scReportBeginNewPlayer(theReportData); |
| 98 | + return scReportBeginNewPlayer(theReportData); |
145 | 99 | } |
146 | 100 |
|
147 | | -SCResult CGameSpy_ATLAS::ReportSetPlayerData(SCReportPtr theReport, |
148 | | - gsi_u32 thePlayerIndex, |
149 | | - const gsi_u8 thePlayerConnectionId[SC_CONNECTION_GUID_SIZE], |
150 | | - gsi_u32 thePlayerTeamIndex, |
151 | | - SCGameResult theResult, |
152 | | - gsi_u32 theProfileId, |
153 | | - const GSLoginCertificate * theCertificate) |
| 101 | +SCResult CGameSpy_ATLAS::ReportSetPlayerData(SCReportPtr theReport, gsi_u32 thePlayerIndex, |
| 102 | + const gsi_u8 thePlayerConnectionId[SC_CONNECTION_GUID_SIZE], gsi_u32 thePlayerTeamIndex, SCGameResult theResult, |
| 103 | + gsi_u32 theProfileId, const GSLoginCertificate* theCertificate) |
154 | 104 | { |
155 | | - gsi_u8 zero_auth_data[16]; |
156 | | - ZeroMemory(zero_auth_data, sizeof(zero_auth_data)); |
157 | | - return scReportSetPlayerData( |
158 | | - theReport, |
159 | | - thePlayerIndex, |
160 | | - thePlayerConnectionId, |
161 | | - thePlayerTeamIndex, |
162 | | - theResult, |
163 | | - theProfileId, |
164 | | - theCertificate, |
165 | | - zero_auth_data |
166 | | - ); |
| 105 | + gsi_u8 zero_auth_data[16]; |
| 106 | + ZeroMemory(zero_auth_data, sizeof(zero_auth_data)); |
| 107 | + return scReportSetPlayerData(theReport, thePlayerIndex, thePlayerConnectionId, thePlayerTeamIndex, theResult, |
| 108 | + theProfileId, theCertificate, zero_auth_data); |
167 | 109 | } |
168 | 110 |
|
169 | | -SCResult CGameSpy_ATLAS::ReportAddIntValue(SCReportPtr theReportData, |
170 | | - gsi_u16 theKeyId, |
171 | | - gsi_i32 theValue) |
| 111 | +SCResult CGameSpy_ATLAS::ReportAddIntValue(SCReportPtr theReportData, gsi_u16 theKeyId, gsi_i32 theValue) |
172 | 112 | { |
173 | | - return scReportAddIntValue(theReportData, theKeyId, theValue); |
| 113 | + return scReportAddIntValue(theReportData, theKeyId, theValue); |
174 | 114 | } |
175 | 115 |
|
176 | | -SCResult CGameSpy_ATLAS::ReportAddStringValue(SCReportPtr theReportData, |
177 | | - gsi_u16 theKeyId, |
178 | | - const gsi_char * theValue) |
| 116 | +SCResult CGameSpy_ATLAS::ReportAddStringValue(SCReportPtr theReportData, gsi_u16 theKeyId, const gsi_char* theValue) |
179 | 117 | { |
180 | | - return scReportAddStringValue(theReportData, theKeyId, theValue); |
| 118 | + return scReportAddStringValue(theReportData, theKeyId, theValue); |
181 | 119 | } |
182 | 120 |
|
183 | | -SCResult CGameSpy_ATLAS::ReportEnd(SCReportPtr theReport, |
184 | | - gsi_bool isAuth, |
185 | | - SCGameStatus theStatus) |
| 121 | +SCResult CGameSpy_ATLAS::ReportEnd(SCReportPtr theReport, gsi_bool isAuth, SCGameStatus theStatus) |
186 | 122 | { |
187 | | - return scReportEnd(theReport, isAuth, theStatus); |
| 123 | + return scReportEnd(theReport, isAuth, theStatus); |
188 | 124 | } |
0 commit comments