gmod_src: sv_loadingup can contain %s - which will be replac..

Revision 787
sv_loadingup can contain %s - which will be replaced with the client’s steamidChanged Files:
[ul]
[li]trunk/src_garrysmod/garrysmod/MenuSystem/gl_menusystem.cpp[/li][li]trunk/src_garrysmod/garrysmod/garrysmod.cpp[/li][/ul]
Committed By Garry Newman

Oh very awesome. So something like this should work?
http://example.com/loadingpage.php?steamid=%s
-snip-

No, but

$steamid = $_GET["steamid"];

would

Yeah, right, of course. Realised that a few minutes ago.

Thanks =)

It uses the community-id rather than the actual steamid incase anyone was wondering.

To convert their 64-bit SteamID to their ‘normal’ SteamID use this PHP function.


function GetAuthID($i64friendID)
{
	$tmpfriendID = $i64friendID;
	$iServer = "1";
	if(bcmod($i64friendID, "2") == "0")
	{
		$iServer = "0";
	}
	$tmpfriendID = bcsub($tmpfriendID,$iServer);
	if(bccomp("76561197960265728",$tmpfriendID) == -1)
		$tmpfriendID = bcsub($tmpfriendID,"76561197960265728");
	$tmpfriendID = bcdiv($tmpfriendID, "2");
	return ("STEAM_0:" . $iServer . ":" . $tmpfriendID);
}

You actually only need to use bcsub to remove 76561197960265728 then you can use regular math and modulus or bitwise comparison to do the rest since it will then fit into a 32 bit signed integer. For those who dont know bcsub requires you to install bcmath. It is installed already if you used the windows msi to install php. Not sure if the linux distributions come with it or not.