local function GetIP() local hostip = GetConVar( "hostip" ):GetString() hostip = tonumber( hostip ) local ip = {} ip[ 1 ] = bit.rshift( bit.band( hostip, 0xFF000000 ), 24 ) ip[ 2 ] = bit.rshift( bit.band( hostip, 0x00FF0000 ), 16 ) ip[ 3 ] = bit.rshift( bit.band( hostip, 0x0000FF00 ), 8 ) ip[ 4 ] = bit.band( hostip, 0x000000FF ) return table.concat( ip, "." ) end function GM:AddToMaster() if(!game.IsDedicated())then print("Listen or singleplayer, not registering with master server!") return end local data = {} data["hostname"] = GetHostName() data["ip"] = "" + GetIP() + ":" + (GetConVar("wss_serverurlport"):GetString() or 27015) data["online"] = "true" http.Post(GetConVar("wss_wss_masterserverurl"):GetString(),data) end function GM:RemoveFromMaster() local data = {} data["online"] = "false" http.Post(GAMEMODE.masterurl,data) end