function amIHosting() {
if(serverConnection.isLocal()) return true;
%serverInfo = NPL_Window.getValue();
%serverName = getSubStr(%serverInfo, %start = strPos(%serverInfo, " - ")+3, strLen(%serverInfo)-%start);
if((%pos = strPos(%serverName, $Pref::Player::NetName)) == 0)
return getSubStr(%serverName, %pos + strLen($Pref::Player::NetName), 1) $= "\'";
return false;
}
This should work well enough. The only situation in which you'll be able to trick it is if a host sets their servername to something like 'Setro's Granny's House,' in which case someone could set their name to "Setro's Granny" to trick it.
Which shouldn't be an issue, allowing clients to see that they can do things shouldn't be that much of an issue as long as there are serverside hosting checks for when they actually do do something.
Also, if they were that dedicated, they could just replace the entire check with "return true;" in the code.