问题描述
如何使用PHP / javascript将steamid64(例如:76561198074259974)转换为steamid(STEAM_0:0:56997123)(我想在加载屏幕上显示一个steamid,而不是在steamid64上显示)
How would someone convert steamid64 (example: 76561198074259974) into a steamid (STEAM_0:0:56997123) using PHP/javascript (I would like to display a steamid on a loading screen, but not the steamid64)
推荐答案
看看这里将steamID转换为steamID64的代码:
Have a look at the code here for converting steamID to steamID64: https://forums.alliedmods.net/showthread.php?t=60899?t=60899
你可以将它转换为将steamID64转换为steamID,为此公式为:
(steamID64 - (76561197960265728 +(steamID64%2)))/ 2
You can reverse it for converting steamID64 to steamID, for this the formula would be: (steamID64 - (76561197960265728 + (steamID64 % 2)))/2
这会给你第二个冒号(:)之后的数字。如果steamID64为odd(steamID64%2),则第一个冒号后的数字为1,否则为0。
This would give you the numbers after the second colon (:). If steamID64 is odd (steamID64 % 2) the number after the first colon would be 1 otherwise a 0.
这篇关于Steam:使用PHP将SteamID64转换为SteamID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!