Konwersja SteamID na FriendsID

Od HLDS.pl
Wersja KaszpiR (dyskusja | edycje) z dnia 00:35, 10 mar 2008
(różn.) ← poprzednia wersja | zobacz aktualną wersję (różn.) | następna wersja → (różn.)
Skocz do: nawigacji, wyszukiwania

Zaczerpniete z hlstatsX

<php>

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;

}

</php>

Osobiste
Przestrzenie nazw
Warianty
Działania
HLDS.pl - Menu:
Inne
IRC
Inne sekcje:
Znajomi:
Narzędzia