SS1984 - Modules - TypesVar Details - Proc Details

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

cityCity.
countryCountry name (e.g. "Russia").
countryCodeTwo-letter ISO country code (e.g. "RU").
holderCkey of the client this lookup was performed for.
ipClient IP as reported by ip-api (the query field of the response).
ispThe client's ISP according to ip-api.
mobile"true"/"false" — whether ip-api considers the connection mobile.
proxyFinal 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).
regionRegion code.
regionNameHuman-readable region name.
statusRequest status: null before start, "pending" in flight, "updated" on success, otherwise an error string.
timezoneTimezone in the form "Europe/Moscow".

Procs

get_geoip_dataEntry 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_geoipKicks 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:

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:

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: