17 |
#pragma library geoip |
#pragma library geoip |
18 |
#endif |
#endif |
19 |
|
|
20 |
//IP address can contain ports, the ports will be stripped out |
/// IP addresses passed to these natives can contain ports, the ports will be ignored. |
21 |
|
|
22 |
//get a two character country code (eg US, CA etc) |
/** |
23 |
|
* Lookup the two character country code for a given IP address. |
24 |
|
* e.g: "US", "CA", etc. |
25 |
|
* |
26 |
|
* @param ip The IP address to lookup. |
27 |
|
* @param result The result buffer. If the lookup does not succeed, the buffer is not modified. |
28 |
|
* @return true on a successful lookup, false on a failed lookup. |
29 |
|
*/ |
30 |
|
native bool:geoip_code2_ex(const ip[], result[3]); |
31 |
|
|
32 |
|
/** |
33 |
|
* Lookup the three character country code for a given IP address. |
34 |
|
* e.g: "USA", "cAN", etc. |
35 |
|
* |
36 |
|
* @param ip The IP address to lookup. |
37 |
|
* @param result The result buffer. If the lookup does not succeed, the buffer is not modified. |
38 |
|
* @return true on a successful lookup, false on a failed lookup. |
39 |
|
*/ |
40 |
|
native bool:geoip_code3_ex(const ip[], result[4]); |
41 |
|
|
42 |
|
/** |
43 |
|
* @deprecated |
44 |
|
* Lookup the two character country code for a given IP address. |
45 |
|
* |
46 |
|
* @note This native will overflow the buffer by one cell on an unknown ip lookup! |
47 |
|
* @note Use geoip_code2_ex instead! |
48 |
|
* |
49 |
|
* @param ip The IP address to lookup. |
50 |
|
* @param result The result buffer. |
51 |
|
*/ |
52 |
native geoip_code2(const ip[], ccode[3]); |
native geoip_code2(const ip[], ccode[3]); |
53 |
|
|
54 |
//get a three character country code (eg USA, cAN etc) |
/** |
55 |
|
* @deprecated |
56 |
|
* Lookup the three character country code for a given IP address. |
57 |
|
* |
58 |
|
* @note This native will overflow the buffer by one cell on an unknown ip lookup! |
59 |
|
* @note Use geoip_code3_ex instead! |
60 |
|
* |
61 |
|
* @param ip The IP address to lookup. |
62 |
|
* @param result The result buffer. |
63 |
|
*/ |
64 |
native geoip_code3(const ip[], result[4]); |
native geoip_code3(const ip[], result[4]); |
65 |
|
|
66 |
//get a full country name. max name is 45 chars |
/** |
67 |
|
* Lookup the full country name for the given IP address. Sets the buffer to "error" on |
68 |
|
* an unsuccessful lookup. |
69 |
|
* |
70 |
|
* @param ip The IP address to lookup. |
71 |
|
* @param result The result of the geoip lookup. |
72 |
|
* @param len The maximum length of the result buffer. |
73 |
|
*/ |
74 |
native geoip_country(const ip[], result[], len=45); |
native geoip_country(const ip[], result[], len=45); |