Konwersja SteamID na FriendsID

(Różnice między wersjami)
Skocz do: nawigacji, wyszukiwania
 
Linia 1: Linia 1:
 
Zaczerpniete z hlstatsX
 
Zaczerpniete z hlstatsX
  
<php>
+
<phpgeshi>
  
 
function GetFriendID($pszAuthID)
 
function GetFriendID($pszAuthID)
Linia 34: Linia 34:
 
}
 
}
  
</php>
+
</phpgeshi>

Wersja z 00:37, 10 mar 2008

Zaczerpniete z hlstatsX

function GetFriendID($pszAuthID)
{
 
    $iServer = "0";
    $iAuthID = "0";
 
    $szAuthID = $pszAuthID;
 
    $szTmp = strtok($szAuthID, ":");
 
    while(($szTmp = strtok(":")) !== false)
    {
        $szTmp2 = strtok(":");
        if($szTmp2 !== false)
        {
            $iServer = $szTmp;
            $iAuthID = $szTmp2;
        }
    }
    if($iAuthID == "0")
        return "0";
 
    $i64friendID = bcmul($iAuthID, "2");
 
    //Friend ID's with even numbers are the 0 auth server.
    //Friend ID's with odd numbers are the 1 auth server.
    $i64friendID = bcadd($i64friendID, bcadd("76561197960265728", $iServer));
 
    return $i64friendID;
}
Osobiste
Przestrzenie nazw
Warianty
Działania
HLDS.pl - Menu:
Inne
IRC
Inne sekcje:
Znajomi:
Narzędzia