Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void gsc_player_getip(scr_entref_t id)
- {
- if (id.entnum >= MAX_CLIENTS)
- {
- stackError("gsc_player_getip() entity %i is not a player", id.entnum);
- stackPushUndefined();
- return;
- }
- client_t *client = &svs.clients[id.entnum];
- char tmp[16];
- snprintf(tmp, sizeof(tmp), "%d.%d.%d.%d", client->netchan.remoteAddress.ip[0], client->netchan.remoteAddress.ip[1], client->netchan.remoteAddress.ip[2], client->netchan.remoteAddress.ip[3]);
- //dvar_t *ip;
- char localip[16] = "127.0.0.1";
- //ip = Dvar_RegisterString( "net_ip", "localhost", DVAR_LATCH );
- if (strcmp(localip, tmp) == 0)
- {
- extern char proxy_realip[MAX_CLIENTS][16];
- snprintf(tmp, sizeof(tmp), "%s", proxy_realip[id.entnum]);
- }
- stackPushString(tmp);
- }
Advertisement
Add Comment
Please, Sign In to add comment