PHP Code:
#include <SteamWorks>
// [... all your other code ...]
char sPublicIP[64];
int iPublicIP[4];
if (SteamWorks_GetPublicIP(iPublicIP)) {
Format(sPublicIP, sizeof(sPublicIP), "%d.%d.%d.%d:%d", iPublicIP[0], iPublicIP[1], iPublicIP[2], iPublicIP[3], GetConVarInt(FindConVar("hostport")));
} else {
LogError("Appears like we had an error on getting the Public IP address.");
}
// [... all your other code ...]
Now, the string variable "sPublicIP" holds the data "192.0.2.123:27015", assuming that the Steam network sees the public IP as "192.0.2.123", and the port is "27015".
PHP Code:
Format(sPublicIP, sizeof(sPublicIP), "%d.%d.%d.%d", iPublicIP[0], iPublicIP[1], iPublicIP[2], iPublicIP[3]));
can eventually be used, if you don't like the port number to be a part of it.
__________________