gmod_src: sv_loadingup can contain %s - which will be replac..
6 replies, posted
[B]Revision 787[/B]
[INDENT]sv_loadingup can contain %s - which will be replaced with the client's steamid[/INDENT][B]Changed Files:[/B]
[LIST]
[*]trunk/src_garrysmod/garrysmod/MenuSystem/gl_menusystem.cpp
[*]trunk/src_garrysmod/garrysmod/garrysmod.cpp
[/LIST]
Committed By [B]Garry Newman[/B]
Oh very awesome. So something like this should work?
[URL="http://example.com/loadingpage.php?steamid=%s"]http://example.com/loadingpage.php?steamid=%s[/URL]
-snip-
No, but
[php]$steamid = $_GET["steamid"];[/php]
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.
[php]
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);
}
[/php]
[QUOTE=Sassharkey;27950880]To convert their 64-bit SteamID to their 'normal' SteamID use this PHP function.
[php]
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);
}
[/php][/QUOTE]
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 [url=http://www.php.net/manual/en/book.bc.php]bcmath[/url]. It is installed already if you used the windows msi to install php. Not sure if the linux distributions come with it or not.
Sorry, you need to Log In to post a reply to this thread.