【问题标题】:C# how can I accept a steam steam offer? [closed]C# 如何接受 Steam Steam 报价? [关闭]
【发布时间】:2016-01-18 11:46:14
【问题描述】:

我已经检查了 SteamBot 的来源,但由于我是一名新编码员,我似乎不太了解它。如果有人可以帮助我,那就太好了!提前致谢。

我在 SteamBot 上找到了方法 (https://github.com/Jessecar96/SteamBot/blob/master/SteamTrade/TradeOffer/OfferSession.cs#L30)

但我好像没看懂。

这里有一些可以帮助的东西 (https://www.reddit.com/r/SteamBot/comments/3a6rp6/who_to_accept_traiding_offers_with_c_steam/.compact)

【问题讨论】:

  • 您究竟需要什么帮助?
  • @Daemede 或接受使用 SteamKit2 或任何其他可能方式的 Steam 报价。在 C# 中
  • @Daemede 或者是的。但我认为那是做不到的。所以我需要一种方法来接受它们。github 上的 SteamBot 有一种方法,但我不明白。
  • 您能否更新您的描述以包含此信息,特别是哪一段代码,这样来这里的任何人都不必扫描 cmets

标签: c# steam steam-web-api trading


【解决方案1】:

在你的代码中你想引用类

//at the top of the file
using SteamTrade.TradeOffer;

//the later on in the file
Offersession newSteamSession = new OfferSession('yourApiKey', 'steamweb');

string convertedStringtradeId = String.Empty;
var isAccepted = newSteamSession.Accept(tradeOfferId, convertedStringtradeId);

if(isAccepted) 
{
    //do more logic here if the offer was good
    //you can use the convertedStringtradeId if you need something


}else
{
  //what happens when things go wrong
}

【讨论】:

  • 它如何知道使用哪个 api 密钥?
  • @TheNewGuy 查看更新...
  • Offersession newSteamSession = new OfferSession('yourApiKey', 'steamweb');参数 1 & 2 = 错误(不应该是字符串?)
  • 我要试试这个:webApi = new TradeOfferWebAPI(apiKey, steamWeb); 22 session = new OfferSession(webApi, steamWeb);
  • 好吧,如果你直接复制我的代码当然不是......你必须实际提供由steam和steamWeb对象提供的apikey......我不太确定在哪里它来自
猜你喜欢
  • 1970-01-01
  • 2015-06-01
  • 1970-01-01
  • 2021-09-03
  • 2016-01-07
  • 2017-05-10
  • 2015-04-04
  • 2021-01-26
  • 1970-01-01
相关资源
最近更新 更多