AMXX-BG.INFO authemu.inc Raw include

authemu.inc

Original include source with line numbers.

Back Download .inc
1 #if defined _authemu_included
2 #endinput
3 #endif
4
5 #define _authemu_included
6
7 #if AMXX_VERSION_NUM >= 175
8 #pragma reqlib authemu
9 #if !defined AMXMODX_NOAUTOLOAD
10 #pragma loadlib authemu
11 #endif
12 #else
13 #pragma library authemu
14 #endif
15
16 #include <authemu_version.inc>
17
18 #if (AMXX_VERSION_NUM >= 183)
19 #pragma deprecated Use aci_tag instead it.
20 #define aci_packname aci_tag
21 #endif
22
23 /**
24 * enum authemu_os_type
25 */
26 enum authemu_os_type
27 {
28 aos_unknown,
29 aos_win95,
30 aos_win98,
31 aos_winME,
32 aos_winNT_4,
33 aos_win2000,
34 aos_winXP,
35 aos_winXPx64Edition,
36 aos_winServer2003,
37 aos_winHomeServer,
38 aos_win2003R2,
39 aos_winVista,
40 aos_winServer2008,
41 aos_winServer2008R2,
42 aos_win7,
43 aos_winServer2012,
44 aos_win8,
45 aos_winServer2012R2,
46 aos_win81,
47 aos_winServer2016,
48 aos_win10
49 };
50
51 /**
52 * enum authemu_client_info
53 */
54 enum authemu_client_info
55 {
56 /*
57 * Description: The build number.
58 * Data type: int
59 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type);
60 */
61 aci_build = 0,
62
63 /*
64 * Description: The build hash. (NOTE: It's not unique ID of client)
65 * Data type: int
66 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type);
67 */
68 aci_hash,
69
70 /*
71 * Description: Last unix-time when the client was updated.
72 * Data type: int
73 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type);
74 */
75 aci_lasttime_upd,
76
77 /*
78 * Description: The tag name of the branch.
79 * Data type: char *
80 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type, dest[], const lenght);
81 */
82 aci_tag,
83
84 /*
85 * Description: This means that the client run on Steam.
86 * Data type: bool
87 * Get params: bool:aemu_get_clientinfo(const index, authemu_client_info:aci_type);
88 */
89 aci_steam,
90
91 /*
92 * Description: This means that the client run on '-beta'.
93 * Data type: bool
94 * Get params: bool:aemu_get_clientinfo(const index, authemu_client_info:aci_type);
95 */
96 aci_beta,
97
98 /*
99 * Description: This means that the client synchronized to depot.
100 * Data type: bool
101 * Get params: bool:aemu_get_clientinfo(const index, authemu_client_info:aci_type);
102 */
103 aci_synchronized,
104
105 /*
106 * Description: The unique hash ID of client.
107 * Data type: char [65]
108 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type);
109 */
110 aci_unique_id,
111
112 /*
113 * Description: Type of operating system that the client uses.
114 * Data type: enum authemu_os_type
115 * Get params: authemu_os_type:aemu_get_clientinfo(const index, authemu_client_info:aci_type);
116 */
117 aci_OS_type,
118
119 /*
120 * Description: Name of operating system that the client uses.
121 * Data type: char *
122 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type, dest[], const lenght);
123 */
124 aci_OS_name,
125
126 /*
127 * Description: The build OS number.
128 * Data type: int
129 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type);
130 */
131 aci_OS_build,
132
133 /*
134 * Description: The number of the major version OS.
135 * Data type: int
136 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type);
137 */
138 aci_OS_majorVersion,
139
140 /*
141 * Description: The number of the minor version OS.
142 * Data type: int
143 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type);
144 */
145 aci_OS_minorVersion,
146
147 /*
148 * Description: The brand name of the processor.
149 * Data type: char *
150 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type, dest[], const lenght);
151 */
152 aci_CPU_name,
153
154 /*
155 * Description: The ID of the processor 'AS IS'.
156 * Data type: char *
157 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type, dest[], const lenght);
158 */
159 aci_CPU_id,
160
161 /*
162 * Description: The brand name of the graphics processor.
163 * Data type: char *
164 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type, dest[], const lenght);
165 */
166 aci_GPU_name,
167
168 /*
169 * Description: The ID of the graphics processor 'AS IS'.
170 * Data type: char *
171 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type, dest[], const lenght);
172 */
173 aci_GPU_id,
174
175 /*
176 * Description: The name of the user agent who serves the client.
177 * Data type: char *
178 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type, dest[], const lenght);
179 */
180 aci_useragent,
181
182 /*
183 * Description: The branch name of the branch.
184 * Data type: char *
185 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type, dest[], const lenght);
186 */
187 aci_branch,
188
189 /*
190 * Description: The fork name of the branch if present.
191 * Data type: char *
192 * Get params: aemu_get_clientinfo(const index, authemu_client_info:aci_type, dest[], const lenght);
193 */
194 aci_fork
195 };
196
197 /*
198 * Check if the client is authemu
199 *
200 * @param index Client index
201 *
202 * @return return true if so, false otherwise
203 *
204 */
205 native bool:is_user_authemu(const index);
206
207 enum DAC_QueryType
208 {
209 DAC_QUERY_DETECT = 0,
210 };
211
212 forward aemu_dac_query(const id, const DAC_QueryType:type);
213
214 /*
215 * Get the client info.
216 * @note: Use the aci_* authemu_client_info enum
217 *
218 * @param index Client index
219 * @param type Use the aci_* authemu_client_info enum
220 *
221 */
222 native any:aemu_get_clientinfo(const index, const authemu_client_info:type, any:...);
223
224 /*
225 * Get the current game screen resolution of the client.
226 *
227 * @param index Client index
228 * @param wide Variable to store wide in
229 * @param tall Variable to store tall in
230 *
231 * @return return true if so, false otherwise
232 *
233 */
234 native bool:aemu_get_game_screeninfo(const index, &wide = 0, &tall = 0);
235
236 /*
237 * Get the current desktop screen resolution of the client.
238 *
239 * @param index Client index
240 * @param wide Variable to store wide in
241 * @param tall Variable to store tall in
242 *
243 * @return return true if so, false otherwise
244 *
245 */
246 native bool:aemu_get_desk_screeninfo(const index, &wide = 0, &tall = 0);
247
248 /*
249 * Gets the specified type of reason.
250 * @note: Use this native only inside the forward 'aemu_dac_query'
251 *
252 * @return type of reason
253 *
254 */
255 native aemu_dac_get_reason();
256
257 /*
258 * Gets the DAC name of the suspicious module.
259 * @note: Use this native only inside the forward 'aemu_dac_query' and for reason 2,3 only
260 *
261 * @param output Buffer to copy module name to
262 * @param lenght Maximum buffer size
263 * @param path Provides full path of the module name
264 *
265 * @return return true if so, false otherwise
266 *
267 */
268 native bool:aemu_dac_get_module(output[], const lenght, bool:path = false);
269
270 /*
271 * Gets the DAC hash of the suspicious module.
272 * @note: Use this native only inside the forward 'aemu_dac_query' and for reason 2,3 only
273 *
274 * @return return hash of the suspicious module
275 *
276 */
277 native aemu_dac_get_module_hash();
278
279 /*
280 * Set's CVar filter that a client obliged to adhere is specified.
281 *
282 * @param index Client index
283 * @note Set to 0 for use common filter
284 *
285 * @param name CVar name
286 * @param value CVar value
287 * @optional Use min/max params instead value param for the same purpose,
288 * but with clamp filter as 'aemu_set_filter_cvar(id, "ex_interp", 0.01, 0.1)'
289 *
290 * @param max The max threshold value of CVar
291 * @note If param is specified, then value param it's min threshold
292 *
293 *
294 * @noreturn
295 *
296 */
297 native aemu_set_filter_cvar(const index, const name[], const Float:value /*const Float:min*/, const Float:max = -999.0 /* unset */);
298
299 /*
300 * Unset CVar filter
301 *
302 * @param index Client index
303 * @note Set to 0 for use common filter
304 *
305 * @param name CVar name
306 *
307 * @noreturn
308 *
309 */
310 native aemu_unset_filter_cvar(const index, const name[]);
311
312 /**
313 * enum BranchType
314 */
315 enum BranchType
316 {
317 BRANCH_MASTER = 0,
318 BRANCH_BETA,
319 BRANCH_FORK,
320 };
321
322 /*
323 * Determine whether specified branch is in use.
324
325 * @param index Client index
326 * @param type Use the BRANCH_* BranchType enum
327 *
328 * @return return true if so, false otherwise
329 */
330 native bool:aemu_is_user_branch(const index, BranchType:type);
331
332 /*
333 * This is the callback from the module that gives major/minor versions for verifying compatibility for AuthEmu versions.
334 * If an AMXX plugin gets a failure, then you do need to upgrade to the latest version of the AuthEmu module or update the files included for AMXX plugins.
335 * Do not modify this!
336 */
337 public __authemu_version_check(const majorVersion, const minorVersion)
338 {
339 if (majorVersion != AUTHEMU_VERSION_MAJOR)
340 {
341 new temp[512];
342 formatex(temp, sizeof temp - 1, "[AuthEmu]: Api major version mismatch; expected %d, real %d", AUTHEMU_VERSION_MAJOR, majorVersion);
343 set_fail_state(temp);
344 return;
345 }
346
347 if (minorVersion < AUTHEMU_VERSION_MINOR)
348 {
349 new temp[512];
350 formatex(temp, sizeof temp - 1, "[AuthEmu]: Api minor version mismatch; expected at least %d, real %d", AUTHEMU_VERSION_MINOR, minorVersion);
351 set_fail_state(temp);
352 return;
353 }
354 }
355