- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 SteamKit2 在 C# 中制作一个交易报价机器人,并且大部分时间它都能成功连接到 Steam。但有些时候,当我让它在 client.connect();
被调用之前输出“正在连接到 Steam...”时,它会卡住。它经常发生,需要修复,但我不知道问题出在哪里。这是我的代码(很多来自 SteamKit2 教程):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SteamKit2;
namespace ATO
{
class OfferSender
{
string username;
string password;
SteamClient client;
CallbackManager manager;
SteamUser user;
bool isRunning = false;
public OfferSender()
{
}
public void login()
{
Console.Write("Please enter your username: ");
username = Console.ReadLine();
Console.Write("Please enter your password: ");
password = Console.ReadLine();
client = new SteamClient();
manager = new CallbackManager(client);
user = client.GetHandler<SteamUser>();
new Callback<SteamClient.ConnectedCallback>(OnConnected, manager);
new Callback<SteamUser.LoggedOnCallback>(OnLoggedOn, manager);
isRunning = true;
Console.WriteLine("\nConnecting to Steam...\n");
client.Connect();
while(isRunning)
{
manager.RunWaitCallbacks(TimeSpan.FromSeconds(1));
}
Console.ReadKey();
}
public void OnConnected(SteamClient.ConnectedCallback callback)
{
if (callback.Result != EResult.OK)
{
Console.WriteLine("Error connecting to Steam: {0}", callback.Result);
isRunning = false;
return;
}
Console.WriteLine("Connected to steam.\nLogging in {0}...\n", username);
user.LogOn(new SteamUser.LogOnDetails {
Username = username,
Password = password
});
}
public void OnLoggedOn(SteamUser.LoggedOnCallback callback)
{
if (callback.Result == EResult.AccountLogonDenied)
{
Console.WriteLine("This account is SteamGuard protected.");
return;
}
if(callback.Result != EResult.OK)
{
Console.WriteLine("Unable to log in to steam {0}\n", callback.Result);
isRunning = false;
return;
}
Console.WriteLine("successfully logged in!");
Environment.Exit(0);
}
}
}
我该如何解决这个问题?
最佳答案
好吧,在用头敲击键盘后,我终于发现 Steam 会像任何其他新计算机或浏览器登录一样请求 AuthCode。
就是这样......
下面的代码处理 AuthCode 和 TwoFactor 身份验证: https://github.com/SteamRE/SteamKit/tree/master/Samples/5.SteamGuard
关于c# - 无法使用 SteamKit2 连接到 Steam,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30946313/
我一直在查看 Steam API 文档,并且有许多服务提供 Steam 网上商店中游戏的信息,但它们似乎都需要游戏的 Steam ID 作为参数。这可以通过用户 ID 来完成,如果给定用户名,API
我正在尝试获取用户游戏统计数据。首先,我正在尝试这样做: http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?
我正在尝试在 Steam 上找到该项目的名称。 这是我目前从 json 数组中得到的 [appid] => 730 [contextid] => 2 [assetid] => 4981322842 [
我正在开发一个使用公共(public) Steam API 来收集一些信息的应用程序。 目前我通过调用GetPlayerAchievements (v0001)检索成就和通话总时长 GetOwnedG
是否可以使用 Steam API 获取 Steam(753) 或 CsGo(730) 完整背包/库存? 我找到了一个 API,我可以在其中获取 Dota2(570) TF2(440) 的完整背包/元素
我正在尝试获取 JSON 格式的买卖订单,例如价格历史记录,但找不到任何信息。有没有办法做到这一点? Buy and Sell orders screenshot 我尝试过: https://stea
我搜索了论坛,找到了获取所有用户游戏的示例模式: http://steamcommunity.com/id//games?tab=all&xml=1 返回所有游戏。但是,如果用户尚未设置 Steam
我一直在阅读论坛并尝试 Steam API,我正在寻找提供所有 Steam 游戏的 API。 我找到了提供所有 SteamApps 的 API,以及提供应用程序信息的 Steam 商店 API(我正在
Steam 为我们提供了交易相关的API,但没有具体的地址示例:https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService#
Steam 为我们提供了交易相关的API,但没有具体的地址示例:https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService#
我正在尝试使用 Google 日历跟踪我的游戏时间/历史记录。 这是 Steam Web API在其中我找不到一种方法来获取关于我究竟在什么时候玩什么的详细信息,除了 GetRecentlyPlaye
如何使用 Steam API(已启动并运行)获取我的应用程序中当前使用(登录)帐户的 Steam 用户名。 Steam ID 可以(例如)通过以下方式获得: CSteamID id = SteamUs
有很多网站,例如www.tf2outpost.com和 www.bazaar.tf用户可以通过单击按钮添加其他 Steam 用户。你到底是如何做到这一点的? Web API 中没有任何内容向您展示如何
我使用此 URL 在 CS:GO 容器中一次获取 100 个结果。我用 {currency} 代替 3,用 {start} 代替 100 的倍数,我的问题是 currency=3 code> 似乎不是
我在 Steam API 中搜索发送 Steam 报价的方法,但找不到。可以使用 API 或者您知道其他方法吗?我想在 PHP/Symfony 中使用它。 最佳答案 您目前无法通过 API 创建交易报
我想知道有没有办法让用户输入他们的“Steam 用户名”,然后您就可以找到他们的“SteamID”。我一直在查看“Steam API”,但没有找到任何相关信息。 我的想法是让用户将他们的“Steam
是否有 API 可以获取用户的 Steam 集换式卡牌? 我对steam不太熟悉,但这个页面上好像没有。 https://developer.valvesoftware.com/wiki/Steam_
steam 桌面快捷方式 steam:// 实际如何工作? 它们的 URL/目标类似于:“steam://rungameid/717”我知道类似的东西,比如“ftp://mynetworkadress
是否有 API 可以获取用户的 Steam 集换式卡牌? 我对steam不是很熟悉,但是这个页面好像没有。 https://developer.valvesoftware.com/wiki/Steam
steam 桌面快捷方式 steam:// 实际如何工作? 它们的 URL/目标类似于:“steam://rungameid/717”我知道类似的东西,比如“ftp://mynetworkadress
我是一名优秀的程序员,十分优秀!