Konwersja SteamID na FriendsID
Od HLDS.pl
(Różnice między wersjami)
(+Kat.) |
|||
| (Nie pokazano 1 wersji utworzonej przez jednego użytkownika) | |||
| Linia 1: | Linia 1: | ||
| − | + | Zaczerpnięte z HLStatsX | |
| − | + | <phpgeshi> | |
| − | < | + | |
function GetFriendID($pszAuthID) | function GetFriendID($pszAuthID) | ||
| Linia 33: | Linia 32: | ||
return $i64friendID; | return $i64friendID; | ||
} | } | ||
| + | </phpgeshi> | ||
| − | + | [[Kategoria:Steam]] | |
Aktualna wersja na dzień 14:00, 20 paź 2008
Zaczerpnięte 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; }