GeoIP data 
Cached GeoIP lookup result for a single /client.
Created on the client at login and populated asynchronously via [SShttp] and ip-api.com.
While the request is in flight [status] is "pending"; on success it becomes "updated",
otherwise it holds a diagnostic value: "admin", "local", "no address",
"limit reached", "export fail", or "api fail: <message>".
Vars | |
| city | City. |
|---|---|
| country | Country name (e.g. "Russia"). |
| countryCode | Two-letter ISO country code (e.g. "RU"). |
| holder | Ckey of the client this lookup was performed for. |
| ip | Client IP as reported by ip-api (the query field of the response). |
| isp | The client's ISP according to ip-api. |
| mobile | "true"/"false" — whether ip-api considers the connection mobile. |
| proxy | Final proxy/VPN flag. Initially "true"/"false" from ip-api, then corrected against
isp_whitelist/isp_blacklist, and finally for admin display it turns into an HTML
string ("whitelisted" in orange or "true" in red). |
| region | Region code. |
| regionName | Human-readable region name. |
| status | Request status: null before start, "pending" in flight, "updated" on success, otherwise an error string. |
| timezone | Timezone in the form "Europe/Moscow". |
Procs | |
| get_geoip_data | Entry point for the asynchronous GeoIP lookup. Handles short branches (no address, admin client) and delegates the network request to [try_update_geoip]. |
| on_geoip_response | [SShttp] callback for an ip-api response. Parses JSON, fills in the datum fields, applies the ISP whitelist/blacklist to [proxy] and, on a confirmed proxy, triggers the autoban path (if enabled in config). |
| try_update_geoip | Kicks off (if not already started) an async request to ip-api and returns. The datum fields are filled in by [on_geoip_response], invoked by [SShttp] once the request finishes. |
Var Details
city 
City.
country 
Country name (e.g. "Russia").
countryCode 
Two-letter ISO country code (e.g. "RU").
holder 
Ckey of the client this lookup was performed for.
ip 
Client IP as reported by ip-api (the query field of the response).
isp 
The client's ISP according to ip-api.
mobile 
"true"/"false" — whether ip-api considers the connection mobile.
proxy 
Final proxy/VPN flag. Initially "true"/"false" from ip-api, then corrected against
isp_whitelist/isp_blacklist, and finally for admin display it turns into an HTML
string ("whitelisted" in orange or "true" in red).
region 
Region code.
regionName 
Human-readable region name.
status 
Request status: null before start, "pending" in flight, "updated" on success, otherwise an error string.
timezone 
Timezone in the form "Europe/Moscow".
Proc Details
get_geoip_data
Entry point for the asynchronous GeoIP lookup. Handles short branches (no address, admin client) and delegates the network request to [try_update_geoip].
Arguments:
- client - the client we are collecting data for
- address - the client's IP address (usually
client.address)
on_geoip_response
[SShttp] callback for an ip-api response. Parses JSON, fills in the datum fields, applies the ISP whitelist/blacklist to [proxy] and, on a confirmed proxy, triggers the autoban path (if enabled in config).
Arguments:
- client - the client whose record we are updating. May be
nullif the client has already left. - response - the ip-api response, wrapped into a /datum/http_response by [SShttp].
try_update_geoip
Kicks off (if not already started) an async request to ip-api and returns. The datum fields are filled in by [on_geoip_response], invoked by [SShttp] once the request finishes.
Safe to call repeatedly — while status is "pending" or "updated" it is a no-op.
Returns FALSE when no request was dispatched (local address, limit exceeded, etc.).
Arguments:
- client - the client this record belongs to
- address - the IP address to query.
127.0.0.1is substituted withworld.internet_address.