【问题标题】:How do I change the universe of a Steam ID?如何更改 Steam ID 的宇宙?
【发布时间】:2017-06-23 14:42:26
【问题描述】:

我正在尝试使用 oauth2 从 Discord 获取用户的正确 Steam ID,但它返回的 ID 的全域设置为 0,而不是 1;这是公共帐户的正确宇宙,这意味着我的程序因此无法运行。

这是我目前从 $connections 变量中获取用户 ID 的代码。

$connections = $user->connections;
$item = null;
foreach($connections as $connection) {
if ($connection->type == "steam")  {
    $item = $connection;
    break;
   }
}

【问题讨论】:

    标签: php steam


    【解决方案1】:

    我需要这样做才能获得正确的 Steam ID

    $badsteamid = decbin(intval($item->id));
    
    $steamid = bindec(substr_replace($badsteamid,"1",strlen($badsteamid)-33,1));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-11
      • 2020-01-19
      • 1970-01-01
      相关资源
      最近更新 更多