Gra*_*an0 14 java login shared-libraries steam-web-api steam
由于项目似乎不知何故被弃用,还有其他解决方案吗?
Paul van Assen写了一个库(https://github.com/pvanassen/steam-api),它有助于登录和使用Steam进行其他交互.
唯一对我不起作用的是登录部分.我的登录方式:
public void login(String cookies) {
this.steamService = StoreFactory.getSteamStore(cookies, "[Username]");
try {
steamService.getLoginService().login("[Username]", "[Password]");
} catch (SteamGuardException ex) {
String steamGuard = JOptionPane.showInputDialog("SteamGuardCode:");
steamService.getLoginService().loginSteamGuard("[Username]",
"[Password]", ex.getEmailSteamId(), "[NameOfDeviceInSteamGuard]",
steamGuard);
} catch (CapchaException ex) {
System.out.println(ex.getCapchaUrl());
String captcha = JOptionPane.showInputDialog("CaptchaCode:");
steamService.getLoginService().loginCapcha("[Username]",
"[Password]", ex.getCapchaGid(), captcha);
} catch (VerificationException e) {
System.out.println("Not working ... \n " + e.toString());
}
}
Run Code Online (Sandbox Code Playgroud)
我的cookie字符串如下所示:
"Steam_Language=english; steamCountry=[XYZ]; steamLogin=[XYZ]; steamLoginSecure=[XYZ]; sessionid=[XYZ]; webTradeEligibility=[XYZ]; steamRememberLogin=[XYZ]";
Run Code Online (Sandbox Code Playgroud)
如果我尝试打印错误消息,我得到的只是一个空字符串.
我现在启用了Mobile Authenticator,如果这有帮助的话!
但其他事情,例如列出来自社区市场的可购买产品,正在使用此API.
//很长一段时间后仍然没有解决方案=( - 我还能做什么D:?
小智 3
您没有使用 cookie。我假设您正在尝试使用此处的 cookie:
this.steamService = StoreFactory.getSteamStore(addCookies, "[Username]");。这里调用的是变量addCookies而不是cookies.