View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 03-05-2021 , 14:42   Re: SourceMod extension: how to get server's IP?
Reply With Quote #6

Quote:
Originally Posted by root88 View Post
PHP Code:
    int ip g_pCvar->FindVar("hostip")->GetInt(); 
"hostip" may not always return the real (public) IP address, such as for example if your server runs behind a router/NAT. In these situations, you may actually see the RFC1918 IP address ranges, e.g. 10.xx.xx.xx, 172.16.xx.xx-172.31.xx.xx and/or 192.168.xx.xx (the one that your server actually listens to on the actual machine).
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline