Compare commits

...

29 Commits

Author SHA1 Message Date
JustArchi
e8e393b320 Correct anti-captcha delay 2015-11-27 16:25:03 +01:00
JustArchi
84db370516 Try to implement some anty-captcha, #22 2015-11-26 01:22:56 +01:00
JustArchi
173148ce25 Add support for longer cd-keys 2015-11-25 16:49:01 +01:00
JustArchi
0fd0528fd0 Use global timeout 2015-11-25 16:35:09 +01:00
JustArchi
664a0e0758 Use new ArchiBoT's WebBrowser 2015-11-25 16:31:39 +01:00
JustArchi
6454e3ee12 Packages update 2015-11-25 05:35:14 +01:00
Łukasz Domeradzki
33f4a82dd5 Sometimes Git SHA1 hash is everything you need 2015-11-22 19:42:00 +01:00
Łukasz Domeradzki
9bd6532411 Update README.md 2015-11-22 01:50:17 +01:00
JustArchi
b89d2977f8 10 hours should be enough 2015-11-22 01:45:58 +01:00
JustArchi
25b557d5d1 Misc 2015-11-22 01:40:44 +01:00
JustArchi
3e34fabfaf Avoid possible steam network fuckups 2015-11-22 01:22:45 +01:00
Łukasz Domeradzki
fc49e8ffa7 Update README.md 2015-11-22 01:08:12 +01:00
JustArchi
48a5eeec29 Misc 2015-11-21 21:30:49 +01:00
JustArchi
7fa176ef7b Fix current status to match actual situation 2015-11-21 21:28:34 +01:00
JustArchi
bfaa99a8a9 Revolution is here 2015-11-21 21:00:46 +01:00
JustArchi
1ff4ed026e Prepare configs for future cards farm algorithms 2015-11-21 18:27:58 +01:00
JustArchi
1703bbfb68 Version bump 2015-11-20 19:08:55 +01:00
JustArchi
a6a2e1605d Misc 2015-11-20 14:47:16 +01:00
JustArchi
c0c61913c2 Fix crash related to trading 2015-11-19 18:34:18 +01:00
JustArchi
fb2437d75d Code cleanup & improvements of previous pull request 2015-11-18 22:10:24 +01:00
Łukasz Domeradzki
499e55c473 Merge pull request #15 from Ryzhehvost/statusplus
added extended !status syntax
2015-11-18 21:59:40 +01:00
jogger
dfd4513b16 added extended !status syntax 2015-11-18 22:15:10 +02:00
JustArchi
f873da7236 Packages update 2015-11-18 14:49:31 +01:00
JustArchi
59360c5b60 Formatting is killing me 2015-11-18 14:30:05 +01:00
JustArchi
750c34189a General code review 2015-11-18 14:28:46 +01:00
JustArchi
7c3f5beb3a Hopefully fix all farming deadlocks, thanks to @Ryzhehvost, closes #14 2015-11-18 14:12:29 +01:00
JustArchi
8dfe095dae Misc 2015-11-15 21:57:46 +01:00
JustArchi
53022632e0 Misc 2015-11-15 17:06:26 +01:00
Łukasz Domeradzki
29a916e5ad Update README.md 2015-11-14 18:04:46 +01:00
34 changed files with 984 additions and 338 deletions

View File

@@ -52,10 +52,12 @@ namespace ArchiSteamFarm {
PurchaseResult = (EPurchaseResult) body.purchase_result_details; PurchaseResult = (EPurchaseResult) body.purchase_result_details;
using (MemoryStream ms = new MemoryStream(body.purchase_receipt_info)) { using (MemoryStream ms = new MemoryStream(body.purchase_receipt_info)) {
if (ReceiptInfo.TryReadAsBinary(ms)) { if (!ReceiptInfo.TryReadAsBinary(ms)) {
foreach (KeyValue lineItem in ReceiptInfo["lineitems"].Children) { return;
Items.Add((uint) lineItem["PackageID"].AsUnsignedLong(), lineItem["ItemDescription"].AsString()); }
}
foreach (KeyValue lineItem in ReceiptInfo["lineitems"].Children) {
Items.Add((uint) lineItem["PackageID"].AsUnsignedLong(), lineItem["ItemDescription"].AsString());
} }
} }
} }
@@ -88,14 +90,30 @@ namespace ArchiSteamFarm {
Client.Send(request); Client.Send(request);
} }
internal void PlayGames(params ulong[] gameIDs) { internal void PlayGames(params uint[] gameIDs) {
var request = new ClientMsgProtobuf<CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed); var request = new ClientMsgProtobuf<CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed);
foreach (ulong gameID in gameIDs) { foreach (uint gameID in gameIDs) {
if (gameID != 0) { if (gameID == 0) {
request.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { continue;
game_id = new GameID(gameID),
});
} }
request.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed {
game_id = new GameID(gameID),
});
}
Client.Send(request);
}
internal void PlayGames(ICollection<uint> gameIDs) {
var request = new ClientMsgProtobuf<CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed);
foreach (uint gameID in gameIDs) {
if (gameID == 0) {
continue;
}
request.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed {
game_id = new GameID(gameID),
});
} }
Client.Send(request); Client.Send(request);
} }
@@ -108,15 +126,17 @@ namespace ArchiSteamFarm {
} }
public sealed override void HandleMsg(IPacketMsg packetMsg) { public sealed override void HandleMsg(IPacketMsg packetMsg) {
if (packetMsg != null) { if (packetMsg == null) {
switch (packetMsg.MsgType) { return;
case EMsg.ClientPurchaseResponse: }
HandlePurchaseResponse(packetMsg);
break; switch (packetMsg.MsgType) {
case EMsg.ClientUserNotifications: case EMsg.ClientPurchaseResponse:
HandleUserNotifications(packetMsg); HandlePurchaseResponse(packetMsg);
break; break;
} case EMsg.ClientUserNotifications:
HandleUserNotifications(packetMsg);
break;
} }
} }

View File

@@ -50,6 +50,8 @@
<DocumentationFile> <DocumentationFile>
</DocumentationFile> </DocumentationFile>
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>cirno.ico</ApplicationIcon> <ApplicationIcon>cirno.ico</ApplicationIcon>
@@ -63,7 +65,7 @@
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.1-beta1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.8.0.1-beta3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="protobuf-net, Version=2.0.0.668, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL"> <Reference Include="protobuf-net, Version=2.0.0.668, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
@@ -97,6 +99,7 @@
<Compile Include="SteamTradeOffer.cs" /> <Compile Include="SteamTradeOffer.cs" />
<Compile Include="Trading.cs" /> <Compile Include="Trading.cs" />
<Compile Include="Utilities.cs" /> <Compile Include="Utilities.cs" />
<Compile Include="WebBrowser.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />

View File

@@ -33,14 +33,15 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ArchiSteamFarm { namespace ArchiSteamFarm {
internal class ArchiWebHandler { internal sealed class ArchiWebHandler {
private const int Timeout = 1000 * 15; // In miliseconds private const int Timeout = 1000 * WebBrowser.HttpTimeout; // In miliseconds
private readonly Bot Bot; private readonly Bot Bot;
private readonly string ApiKey; private readonly string ApiKey;
private readonly Dictionary<string, string> SteamCookieDictionary = new Dictionary<string, string>();
private ulong SteamID; private ulong SteamID;
private string VanityURL; private string VanityURL;
private readonly Dictionary<string, string> SteamCookieDictionary = new Dictionary<string, string>();
// This is required because home_process request must be done on final URL // This is required because home_process request must be done on final URL
private string GetHomeProcess() { private string GetHomeProcess() {
@@ -130,7 +131,7 @@ namespace ArchiSteamFarm {
{"pin", parentalPin} {"pin", parentalPin}
}; };
HttpResponseMessage response = await Utilities.UrlPostRequestWithResponse("https://steamcommunity.com/parental/ajaxunlock", postData, SteamCookieDictionary, "https://steamcommunity.com/").ConfigureAwait(false); HttpResponseMessage response = await WebBrowser.UrlPost("https://steamcommunity.com/parental/ajaxunlock", postData, SteamCookieDictionary, "https://steamcommunity.com/").ConfigureAwait(false);
if (response != null && response.IsSuccessStatusCode) { if (response != null && response.IsSuccessStatusCode) {
Logging.LogGenericInfo(Bot.BotName, "Success!"); Logging.LogGenericInfo(Bot.BotName, "Success!");
@@ -240,7 +241,7 @@ namespace ArchiSteamFarm {
{"action", "join"} {"action", "join"}
}; };
await Utilities.UrlPostRequest(request, postData, SteamCookieDictionary).ConfigureAwait(false); await WebBrowser.UrlPost(request, postData, SteamCookieDictionary).ConfigureAwait(false);
} }
internal async Task LeaveClan(ulong clanID) { internal async Task LeaveClan(ulong clanID) {
@@ -259,7 +260,8 @@ namespace ArchiSteamFarm {
{"action", "leaveGroup"}, {"action", "leaveGroup"},
{"groupId", clanID.ToString()} {"groupId", clanID.ToString()}
}; };
await Utilities.UrlPostRequest(request, postData, SteamCookieDictionary).ConfigureAwait(false);
await WebBrowser.UrlPost(request, postData, SteamCookieDictionary).ConfigureAwait(false);
} }
internal async Task<bool> AcceptTradeOffer(ulong tradeID) { internal async Task<bool> AcceptTradeOffer(ulong tradeID) {
@@ -281,7 +283,11 @@ namespace ArchiSteamFarm {
{"tradeofferid", tradeID.ToString()} {"tradeofferid", tradeID.ToString()}
}; };
HttpResponseMessage result = await Utilities.UrlPostRequestWithResponse(request, postData, SteamCookieDictionary, referer).ConfigureAwait(false); HttpResponseMessage result = await WebBrowser.UrlPost(request, postData, SteamCookieDictionary, referer).ConfigureAwait(false);
if (result == null) {
return false;
}
bool success = result.IsSuccessStatusCode; bool success = result.IsSuccessStatusCode;
if (!success) { if (!success) {
@@ -333,7 +339,7 @@ namespace ArchiSteamFarm {
return null; return null;
} }
return await Utilities.UrlToHtmlDocument("http://steamcommunity.com/profiles/" + SteamID + "/badges?p=" + page, SteamCookieDictionary).ConfigureAwait(false); return await WebBrowser.UrlGetToHtmlDocument("http://steamcommunity.com/profiles/" + SteamID + "/badges?p=" + page, SteamCookieDictionary).ConfigureAwait(false);
} }
internal async Task<HtmlDocument> GetGameCardsPage(ulong appID) { internal async Task<HtmlDocument> GetGameCardsPage(ulong appID) {
@@ -341,7 +347,7 @@ namespace ArchiSteamFarm {
return null; return null;
} }
return await Utilities.UrlToHtmlDocument("http://steamcommunity.com/profiles/" + SteamID + "/gamecards/" + appID, SteamCookieDictionary).ConfigureAwait(false); return await WebBrowser.UrlGetToHtmlDocument("http://steamcommunity.com/profiles/" + SteamID + "/gamecards/" + appID, SteamCookieDictionary).ConfigureAwait(false);
} }
} }
} }

111
ArchiSteamFarm/Bot.cs Normal file → Executable file
View File

@@ -24,6 +24,7 @@
using SteamKit2; using SteamKit2;
using System; using System;
using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Security.Cryptography; using System.Security.Cryptography;
@@ -31,19 +32,18 @@ using System.Threading.Tasks;
using System.Xml; using System.Xml;
namespace ArchiSteamFarm { namespace ArchiSteamFarm {
internal class Bot { internal sealed class Bot {
private const ushort CallbackSleep = 500; // In miliseconds private const ushort CallbackSleep = 500; // In miliseconds
private static readonly Dictionary<string, Bot> Bots = new Dictionary<string, Bot>(); private static readonly ConcurrentDictionary<string, Bot> Bots = new ConcurrentDictionary<string, Bot>();
private readonly string ConfigFile; private readonly string ConfigFile, SentryFile;
private readonly string SentryFile;
internal readonly string BotName;
private bool IsRunning = false; private bool IsRunning = false;
private string AuthCode, TwoFactorAuth; private string AuthCode, TwoFactorAuth;
internal readonly string BotName;
internal ArchiHandler ArchiHandler { get; private set; } internal ArchiHandler ArchiHandler { get; private set; }
internal ArchiWebHandler ArchiWebHandler { get; private set; } internal ArchiWebHandler ArchiWebHandler { get; private set; }
internal CallbackManager CallbackManager { get; private set; } internal CallbackManager CallbackManager { get; private set; }
@@ -62,24 +62,37 @@ namespace ArchiSteamFarm {
internal string SteamParentalPIN { get; private set; } = "0"; internal string SteamParentalPIN { get; private set; } = "0";
internal ulong SteamMasterID { get; private set; } = 0; internal ulong SteamMasterID { get; private set; } = 0;
internal ulong SteamMasterClanID { get; private set; } = 0; internal ulong SteamMasterClanID { get; private set; } = 0;
internal bool CardDropsRestricted { get; private set; } = false;
internal bool ShutdownOnFarmingFinished { get; private set; } = false; internal bool ShutdownOnFarmingFinished { get; private set; } = false;
internal HashSet<uint> Blacklist { get; private set; } = new HashSet<uint> { 303700, 335590, 368020 }; internal HashSet<uint> Blacklist { get; private set; } = new HashSet<uint> { 303700, 335590, 368020 };
internal bool Statistics { get; private set; } = true; internal bool Statistics { get; private set; } = true;
internal static int GetRunningBotsCount() { private static bool IsValidCdKey(string key) {
int result; if (string.IsNullOrEmpty(key)) {
lock (Bots) { return false;
result = Bots.Count;
} }
return result;
if (key.Length != 17 && key.Length != 29) {
return false;
}
for (byte i = 5; i < key.Length; i += 6) {
if (key[i] != '-') {
return false;
}
}
return true;
}
internal static int GetRunningBotsCount() {
return Bots.Count;
} }
internal static async Task ShutdownAllBots() { internal static async Task ShutdownAllBots() {
List<Task> tasks = new List<Task>(); List<Task> tasks = new List<Task>();
lock (Bots) { foreach (Bot bot in Bots.Values) {
foreach (Bot bot in Bots.Values) { tasks.Add(Task.Run(async () => await bot.Shutdown().ConfigureAwait(false)));
tasks.Add(Task.Run(async () => await bot.Shutdown().ConfigureAwait(false)));
}
} }
await Task.WhenAll(tasks).ConfigureAwait(false); await Task.WhenAll(tasks).ConfigureAwait(false);
} }
@@ -102,9 +115,7 @@ namespace ArchiSteamFarm {
return; return;
} }
lock (Bots) { Bots.AddOrUpdate(BotName, this, (key, value) => this);
Bots.Add(BotName, this);
}
// Initialize // Initialize
SteamClient = new SteamClient(); SteamClient = new SteamClient();
@@ -119,7 +130,6 @@ namespace ArchiSteamFarm {
SteamFriends = SteamClient.GetHandler<SteamFriends>(); SteamFriends = SteamClient.GetHandler<SteamFriends>();
CallbackManager.Subscribe<SteamFriends.FriendsListCallback>(OnFriendsList); CallbackManager.Subscribe<SteamFriends.FriendsListCallback>(OnFriendsList);
CallbackManager.Subscribe<SteamFriends.FriendMsgCallback>(OnFriendMsg); CallbackManager.Subscribe<SteamFriends.FriendMsgCallback>(OnFriendMsg);
CallbackManager.Subscribe<SteamFriends.PersonaStateCallback>(OnPersonaState);
SteamUser = SteamClient.GetHandler<SteamUser>(); SteamUser = SteamClient.GetHandler<SteamUser>();
CallbackManager.Subscribe<SteamUser.AccountInfoCallback>(OnAccountInfo); CallbackManager.Subscribe<SteamUser.AccountInfoCallback>(OnAccountInfo);
@@ -185,6 +195,9 @@ namespace ArchiSteamFarm {
case "SteamMasterClanID": case "SteamMasterClanID":
SteamMasterClanID = ulong.Parse(value); SteamMasterClanID = ulong.Parse(value);
break; break;
case "CardDropsRestricted":
CardDropsRestricted = bool.Parse(value);
break;
case "ShutdownOnFarmingFinished": case "ShutdownOnFarmingFinished":
ShutdownOnFarmingFinished = bool.Parse(value); ShutdownOnFarmingFinished = bool.Parse(value);
break; break;
@@ -203,7 +216,7 @@ namespace ArchiSteamFarm {
} }
} }
} }
} catch (XmlException e) { } catch (Exception e) {
Logging.LogGenericException(BotName, e); Logging.LogGenericException(BotName, e);
Logging.LogGenericError(BotName, "Your config for this bot instance is invalid, it won't run!"); Logging.LogGenericError(BotName, "Your config for this bot instance is invalid, it won't run!");
return false; return false;
@@ -243,9 +256,7 @@ namespace ArchiSteamFarm {
} }
await botToShutdown.Stop().ConfigureAwait(false); await botToShutdown.Stop().ConfigureAwait(false);
lock (Bots) { Bots.TryRemove(botNameToShutdown, out botToShutdown);
Bots.Remove(botNameToShutdown);
}
Program.OnBotShutdown(botToShutdown); Program.OnBotShutdown(botToShutdown);
return true; return true;
@@ -261,10 +272,6 @@ namespace ArchiSteamFarm {
} }
} }
internal void PlayGame(params ulong[] gameIDs) {
ArchiHandler.PlayGames(gameIDs);
}
private void HandleCallbacks() { private void HandleCallbacks() {
TimeSpan timeSpan = TimeSpan.FromMilliseconds(CallbackSleep); TimeSpan timeSpan = TimeSpan.FromMilliseconds(CallbackSleep);
while (IsRunning) { while (IsRunning) {
@@ -281,12 +288,25 @@ namespace ArchiSteamFarm {
} }
private void ResponseStatus(ulong steamID, string botName = null) {
private void ResponseStatus(ulong steamID) {
if (steamID == 0) { if (steamID == 0) {
return; return;
} }
Bot bot;
if (string.IsNullOrEmpty(botName)) {
bot = this;
} else {
if (!Bots.TryGetValue(botName, out bot)) {
SendMessageToUser(steamID, "Couldn't find any bot named " + botName + "!");
return;
}
}
if (bot.CardsFarmer.CurrentGamesFarming.Count > 0) {
SendMessageToUser(steamID, "Bot " + bot.BotName + " is currently farming appIDs: " + string.Join(", ", bot.CardsFarmer.CurrentGamesFarming) + " and has a total of " + bot.CardsFarmer.GamesToFarm.Count + " games left to farm");
}
SendMessageToUser(steamID, "Currently " + Bots.Count + " bots are running"); SendMessageToUser(steamID, "Currently " + Bots.Count + " bots are running");
} }
@@ -395,7 +415,7 @@ namespace ArchiSteamFarm {
SteamID steamID = friend.SteamID; SteamID steamID = friend.SteamID;
switch (steamID.AccountType) { switch (steamID.AccountType) {
case EAccountType.Clan: case EAccountType.Clan:
//ArchiHandler.AcceptClanInvite(steamID); ArchiHandler.DeclineClanInvite(steamID);
break; break;
default: default:
if (steamID == SteamMasterID) { if (steamID == SteamMasterID) {
@@ -427,7 +447,7 @@ namespace ArchiSteamFarm {
return; return;
} }
if (message.Length == 17 && message[5] == '-' && message[11] == '-') { if (IsValidCdKey(message)) {
ArchiHandler.RedeemKey(message); ArchiHandler.RedeemKey(message);
return; return;
} }
@@ -442,6 +462,7 @@ namespace ArchiSteamFarm {
await ShutdownAllBots().ConfigureAwait(false); await ShutdownAllBots().ConfigureAwait(false);
break; break;
case "!farm": case "!farm":
SendMessageToUser(steamID, "Please wait...");
await CardsFarmer.StartFarming().ConfigureAwait(false); await CardsFarmer.StartFarming().ConfigureAwait(false);
SendMessageToUser(steamID, "Done!"); SendMessageToUser(steamID, "Done!");
break; break;
@@ -458,28 +479,22 @@ namespace ArchiSteamFarm {
} else { } else {
string[] args = message.Split(' '); string[] args = message.Split(' ');
switch (args[0]) { switch (args[0]) {
case "!redeem":
ArchiHandler.RedeemKey(args[1]);
break;
case "!start": case "!start":
ResponseStart(steamID, args[1]); ResponseStart(steamID, args[1]);
break; break;
case "!stop": case "!stop":
await ResponseStop(steamID, args[1]).ConfigureAwait(false); await ResponseStop(steamID, args[1]).ConfigureAwait(false);
break; break;
case "!status":
ResponseStatus(steamID, args[1]);
break;
} }
} }
} }
private void OnPersonaState(SteamFriends.PersonaStateCallback callback) {
if (callback == null) {
return;
}
SteamID steamID = callback.FriendID;
SteamID sourceSteamID = callback.SourceSteamID;
string steamNickname = callback.Name;
EPersonaState personaState = callback.State;
EClanRank clanRank = (EClanRank) callback.ClanRank;
}
private void OnAccountInfo(SteamUser.AccountInfoCallback callback) { private void OnAccountInfo(SteamUser.AccountInfoCallback callback) {
if (callback == null) { if (callback == null) {
return; return;
@@ -509,6 +524,12 @@ namespace ArchiSteamFarm {
case EResult.AccountLoginDeniedNeedTwoFactor: case EResult.AccountLoginDeniedNeedTwoFactor:
TwoFactorAuth = Program.GetUserInput(SteamLogin, Program.EUserInputType.TwoFactorAuthentication); TwoFactorAuth = Program.GetUserInput(SteamLogin, Program.EUserInputType.TwoFactorAuthentication);
break; break;
case EResult.InvalidPassword:
Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + result + ", will retry after a longer while");
await Stop().ConfigureAwait(false);
await Utilities.SleepAsync(25 * 1000).ConfigureAwait(false); // Steam removes requirement of captcha after around 20 minutes
await Start().ConfigureAwait(false);
break;
case EResult.OK: case EResult.OK:
Logging.LogGenericInfo(BotName, "Successfully logged on!"); Logging.LogGenericInfo(BotName, "Successfully logged on!");
@@ -536,12 +557,12 @@ namespace ArchiSteamFarm {
break; break;
case EResult.Timeout: case EResult.Timeout:
case EResult.TryAnotherCM: case EResult.TryAnotherCM:
Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + callback.Result + " / " + callback.ExtendedResult + ", retrying..."); Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + result + ", retrying...");
await Stop().ConfigureAwait(false); await Stop().ConfigureAwait(false);
await Start().ConfigureAwait(false); await Start().ConfigureAwait(false);
break; break;
default: default:
Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + callback.Result + " / " + callback.ExtendedResult); Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + result);
await Shutdown().ConfigureAwait(false); await Shutdown().ConfigureAwait(false);
break; break;
} }

View File

@@ -27,28 +27,21 @@ using SteamKit2.Internal;
using System.IO; using System.IO;
namespace ArchiSteamFarm { namespace ArchiSteamFarm {
/// <summary>
/// Message used to Accept or Decline a group(clan) invite.
/// </summary>
internal sealed class CMsgClientClanInviteAction : ISteamSerializableMessage, ISteamSerializable { internal sealed class CMsgClientClanInviteAction : ISteamSerializableMessage, ISteamSerializable {
EMsg ISteamSerializableMessage.GetEMsg() { EMsg ISteamSerializableMessage.GetEMsg() {
return EMsg.ClientAcknowledgeClanInvite; return EMsg.ClientAcknowledgeClanInvite;
} }
public CMsgClientClanInviteAction() {
}
/// <summary>
/// Group invited to.
/// </summary>
internal ulong GroupID = 0; internal ulong GroupID = 0;
/// <summary>
/// To accept or decline the invite.
/// </summary>
internal bool AcceptInvite = true; internal bool AcceptInvite = true;
public CMsgClientClanInviteAction() { }
void ISteamSerializable.Serialize(Stream stream) { void ISteamSerializable.Serialize(Stream stream) {
if (stream == null) {
return;
}
try { try {
BinaryWriter binaryWriter = new BinaryWriter(stream); BinaryWriter binaryWriter = new BinaryWriter(stream);
binaryWriter.Write(GroupID); binaryWriter.Write(GroupID);
@@ -59,6 +52,10 @@ namespace ArchiSteamFarm {
} }
void ISteamSerializable.Deserialize(Stream stream) { void ISteamSerializable.Deserialize(Stream stream) {
if (stream == null) {
return;
}
try { try {
BinaryReader binaryReader = new BinaryReader(stream); BinaryReader binaryReader = new BinaryReader(stream);
GroupID = binaryReader.ReadUInt64(); GroupID = binaryReader.ReadUInt64();

227
ArchiSteamFarm/CardsFarmer.cs Normal file → Executable file
View File

@@ -23,24 +23,106 @@
*/ */
using HtmlAgilityPack; using HtmlAgilityPack;
using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ArchiSteamFarm { namespace ArchiSteamFarm {
internal class CardsFarmer { internal sealed class CardsFarmer {
private const byte StatusCheckSleep = 5; // In minutes, how long to wait before checking the appID again private const byte StatusCheckSleep = 5; // In minutes, how long to wait before checking the appID again
private const ushort MaxFarmingTime = 600; // In minutes, how long ASF is allowed to farm one game in solo mode
private readonly ManualResetEvent FarmResetEvent = new ManualResetEvent(false); private readonly ManualResetEvent FarmResetEvent = new ManualResetEvent(false);
private readonly SemaphoreSlim Semaphore = new SemaphoreSlim(1); private readonly SemaphoreSlim Semaphore = new SemaphoreSlim(1);
private readonly Bot Bot; private readonly Bot Bot;
internal readonly ConcurrentDictionary<uint, double> GamesToFarm = new ConcurrentDictionary<uint, double>();
internal readonly List<uint> CurrentGamesFarming = new List<uint>();
private volatile bool NowFarming = false; private volatile bool NowFarming = false;
internal CardsFarmer(Bot bot) { internal CardsFarmer(Bot bot) {
Bot = bot; Bot = bot;
} }
internal static List<uint> GetGamesToFarmSolo(ConcurrentDictionary<uint, double> gamesToFarm) {
if (gamesToFarm == null) {
return null;
}
List<uint> result = new List<uint>();
foreach (KeyValuePair<uint, double> keyValue in gamesToFarm) {
if (keyValue.Value >= 2) {
result.Add(keyValue.Key);
}
}
return result;
}
internal static uint GetAnyGameToFarm(ConcurrentDictionary<uint, double> gamesToFarm) {
if (gamesToFarm == null) {
return 0;
}
foreach (uint appID in gamesToFarm.Keys) {
return appID;
}
return 0;
}
internal bool FarmMultiple() {
if (GamesToFarm == null || GamesToFarm.Count == 0) {
return true;
}
double maxHour = -1;
foreach (double hour in GamesToFarm.Values) {
if (hour > maxHour) {
maxHour = hour;
}
}
CurrentGamesFarming.Clear();
foreach (uint appID in GamesToFarm.Keys) {
CurrentGamesFarming.Add(appID);
}
Logging.LogGenericInfo(Bot.BotName, "Now farming: " + string.Join(", ", GamesToFarm.Keys));
if (Farm(maxHour, GamesToFarm.Keys)) {
return true;
} else {
CurrentGamesFarming.Clear();
NowFarming = false;
return false;
}
}
internal async Task<bool> FarmSolo(uint appID) {
if (appID == 0) {
return true;
}
CurrentGamesFarming.Clear();
CurrentGamesFarming.Add(appID);
Logging.LogGenericInfo(Bot.BotName, "Now farming: " + appID);
if (await Farm(appID).ConfigureAwait(false)) {
double hours;
GamesToFarm.TryRemove(appID, out hours);
return true;
} else {
CurrentGamesFarming.Clear();
NowFarming = false;
return false;
}
}
internal async Task StartFarming() { internal async Task StartFarming() {
await StopFarming().ConfigureAwait(false); await StopFarming().ConfigureAwait(false);
@@ -68,7 +150,6 @@ namespace ArchiSteamFarm {
} }
// Find APPIDs we need to farm // Find APPIDs we need to farm
List<uint> appIDs = new List<uint>();
for (var page = 1; page <= maxPages; page++) { for (var page = 1; page <= maxPages; page++) {
Logging.LogGenericInfo(Bot.BotName, "Checking page: " + page + "/" + maxPages); Logging.LogGenericInfo(Bot.BotName, "Checking page: " + page + "/" + maxPages);
@@ -84,16 +165,15 @@ namespace ArchiSteamFarm {
continue; continue;
} }
GamesToFarm.Clear();
foreach (HtmlNode badgesPageNode in badgesPageNodes) { foreach (HtmlNode badgesPageNode in badgesPageNodes) {
string steamLink = badgesPageNode.GetAttributeValue("href", null); string steamLink = badgesPageNode.GetAttributeValue("href", null);
if (steamLink == null) { if (steamLink == null) {
Logging.LogGenericError(Bot.BotName, "Couldn't get steamLink for one of the games: " + badgesPageNode.OuterHtml);
continue; continue;
} }
uint appID = (uint) Utilities.OnlyNumbers(steamLink); uint appID = (uint) Utilities.OnlyNumbers(steamLink);
if (appID == 0) { if (appID == 0) {
Logging.LogGenericError(Bot.BotName, "Couldn't get appID for one of the games: " + badgesPageNode.OuterHtml);
continue; continue;
} }
@@ -101,21 +181,90 @@ namespace ArchiSteamFarm {
continue; continue;
} }
appIDs.Add(appID); // We assume that every game has at least 2 hours played, until we actually check them
GamesToFarm.AddOrUpdate(appID, 2, (key, value) => 2);
} }
} }
// Start farming // If we have restricted card drops, actually do check all games that are left to farm
while (appIDs.Count > 0) { if (Bot.CardDropsRestricted) {
Logging.LogGenericInfo(Bot.BotName, "Farming in progress..."); foreach (uint appID in GamesToFarm.Keys) {
uint appID = appIDs[0]; Logging.LogGenericInfo(Bot.BotName, "Checking hours of appID: " + appID);
if (await Farm(appID).ConfigureAwait(false)) { HtmlDocument appPage = await Bot.ArchiWebHandler.GetGameCardsPage(appID).ConfigureAwait(false);
appIDs.Remove(appID); if (appPage == null) {
} else { continue;
return; }
HtmlNode appNode = appPage.DocumentNode.SelectSingleNode("//div[@class='badge_title_stats_playtime']");
if (appNode == null) {
continue;
}
string hoursString = appNode.InnerText;
if (string.IsNullOrEmpty(hoursString)) {
continue;
}
hoursString = Regex.Match(hoursString, @"[0-9\.,]+").Value;
double hours;
if (string.IsNullOrEmpty(hoursString)) {
hours = 0;
} else {
hours = double.Parse(hoursString, CultureInfo.InvariantCulture);
}
GamesToFarm[appID] = hours;
} }
} }
Logging.LogGenericInfo(Bot.BotName, "Farming in progress...");
NowFarming = GamesToFarm.Count > 0;
Semaphore.Release();
// Now the algorithm used for farming depends on whether account is restricted or not
if (Bot.CardDropsRestricted) {
// If we have restricted card drops, we use complex algorithm, which prioritizes farming solo titles >= 2 hours, then all at once, until any game hits mentioned 2 hours
Logging.LogGenericInfo(Bot.BotName, "Chosen farming algorithm: Complex");
while (GamesToFarm.Count > 0) {
List<uint> gamesToFarmSolo = GetGamesToFarmSolo(GamesToFarm);
if (gamesToFarmSolo.Count > 0) {
while (gamesToFarmSolo.Count > 0) {
uint appID = gamesToFarmSolo[0];
bool success = await FarmSolo(appID).ConfigureAwait(false);
if (success) {
Logging.LogGenericInfo(Bot.BotName, "Done farming: " + appID);
gamesToFarmSolo.Remove(appID);
} else {
return;
}
}
} else {
bool success = FarmMultiple();
if (success) {
Logging.LogGenericInfo(Bot.BotName, "Done farming: " + string.Join(", ", GamesToFarm.Keys));
} else {
return;
}
}
}
} else {
// If we have unrestricted card drops, we use simple algorithm and farm cards one-by-one
Logging.LogGenericInfo(Bot.BotName, "Chosen farming algorithm: Simple");
while (GamesToFarm.Count > 0) {
uint appID = GetAnyGameToFarm(GamesToFarm);
bool success = await FarmSolo(appID).ConfigureAwait(false);
if (success) {
Logging.LogGenericInfo(Bot.BotName, "Done farming: " + appID);
} else {
return;
}
}
}
CurrentGamesFarming.Clear();
NowFarming = false;
Logging.LogGenericInfo(Bot.BotName, "Farming finished!"); Logging.LogGenericInfo(Bot.BotName, "Farming finished!");
await Bot.OnFarmingFinished().ConfigureAwait(false); await Bot.OnFarmingFinished().ConfigureAwait(false);
} }
@@ -151,18 +300,14 @@ namespace ArchiSteamFarm {
return result; return result;
} }
private async Task<bool> Farm(ulong appID) { private async Task<bool> Farm(uint appID) {
Bot.ArchiHandler.PlayGames(appID);
bool success = true; bool success = true;
bool? keepFarming = await ShouldFarm(appID).ConfigureAwait(false); bool? keepFarming = await ShouldFarm(appID).ConfigureAwait(false);
while (keepFarming == null || keepFarming.Value) { for (ushort farmingTime = 0; farmingTime <= MaxFarmingTime && (!keepFarming.HasValue || keepFarming.Value); farmingTime += StatusCheckSleep) {
if (!NowFarming) { Logging.LogGenericInfo(Bot.BotName, "Still farming: " + appID);
NowFarming = true;
Logging.LogGenericInfo(Bot.BotName, "Now farming: " + appID);
Bot.PlayGame(appID);
Semaphore.Release(); // We're farming, allow other tasks to shut us down
} else {
Logging.LogGenericInfo(Bot.BotName, "Still farming: " + appID);
}
if (FarmResetEvent.WaitOne(1000 * 60 * StatusCheckSleep)) { if (FarmResetEvent.WaitOne(1000 * 60 * StatusCheckSleep)) {
success = false; success = false;
break; break;
@@ -170,10 +315,42 @@ namespace ArchiSteamFarm {
keepFarming = await ShouldFarm(appID).ConfigureAwait(false); keepFarming = await ShouldFarm(appID).ConfigureAwait(false);
} }
Bot.PlayGame(0); Bot.ArchiHandler.PlayGames(0);
NowFarming = false;
Logging.LogGenericInfo(Bot.BotName, "Stopped farming: " + appID); Logging.LogGenericInfo(Bot.BotName, "Stopped farming: " + appID);
return success; return success;
} }
private bool Farm(double maxHour, ICollection<uint> appIDs) {
if (maxHour >= 2) {
return true;
}
Bot.ArchiHandler.PlayGames(appIDs);
bool success = true;
while (maxHour < 2) {
Logging.LogGenericInfo(Bot.BotName, "Still farming: " + string.Join(", ", appIDs));
if (FarmResetEvent.WaitOne(1000 * 60 * StatusCheckSleep)) {
success = false;
break;
}
// Don't forget to update our GamesToFarm hours
double timePlayed = StatusCheckSleep / 60.0;
foreach (KeyValuePair<uint, double> keyValue in GamesToFarm) {
if (!appIDs.Contains(keyValue.Key)) {
continue;
}
GamesToFarm[keyValue.Key] = keyValue.Value + timePlayed;
}
maxHour += timePlayed;
}
Bot.ArchiHandler.PlayGames(0);
Logging.LogGenericInfo(Bot.BotName, "Stopped farming: " + string.Join(", ", appIDs));
return success;
}
} }
} }

View File

@@ -39,21 +39,23 @@ namespace ArchiSteamFarm {
TwoFactorAuthentication, TwoFactorAuthentication,
} }
internal const ulong ArchiSCFarmGroup = 103582791440160998;
internal const string ConfigDirectoryPath = "config";
private const string LatestGithubReleaseURL = "https://api.github.com/repos/JustArchi/ArchiSteamFarm/releases/latest"; private const string LatestGithubReleaseURL = "https://api.github.com/repos/JustArchi/ArchiSteamFarm/releases/latest";
internal static readonly object ConsoleLock = new object(); internal const ulong ArchiSCFarmGroup = 103582791440160998;
internal const string ConfigDirectoryPath = "config";
private static readonly SemaphoreSlim SteamSemaphore = new SemaphoreSlim(1); private static readonly SemaphoreSlim SteamSemaphore = new SemaphoreSlim(1);
private static readonly ManualResetEvent ShutdownResetEvent = new ManualResetEvent(false); private static readonly ManualResetEvent ShutdownResetEvent = new ManualResetEvent(false);
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly(); private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
private static readonly string ExecutablePath = Assembly.Location; private static readonly string ExecutablePath = Assembly.Location;
private static readonly AssemblyName AssemblyName = Assembly.GetName(); private static readonly AssemblyName AssemblyName = Assembly.GetName();
private static readonly string ExeName = AssemblyName.Name + ".exe"; //private static readonly string ExeName = AssemblyName.Name + ".exe";
private static readonly string Version = AssemblyName.Version.ToString();
internal static readonly string Version = AssemblyName.Version.ToString();
internal static readonly object ConsoleLock = new object();
private static async Task CheckForUpdate() { private static async Task CheckForUpdate() {
JObject response = await Utilities.UrlToJObject(LatestGithubReleaseURL).ConfigureAwait(false); JObject response = await WebBrowser.UrlGetToJObject(LatestGithubReleaseURL).ConfigureAwait(false);
if (response == null) { if (response == null) {
return; return;
} }
@@ -69,11 +71,11 @@ namespace ArchiSteamFarm {
Logging.LogGenericNotice("", "Remote version: " + remoteVersion); Logging.LogGenericNotice("", "Remote version: " + remoteVersion);
int comparisonResult = localVersion.CompareTo(remoteVersion); int comparisonResult = localVersion.CompareTo(remoteVersion);
if (localVersion.CompareTo(remoteVersion) < 0) { if (comparisonResult < 0) {
Logging.LogGenericNotice("", "New version is available!"); Logging.LogGenericNotice("", "New version is available!");
Logging.LogGenericNotice("", "Consider updating yourself!"); Logging.LogGenericNotice("", "Consider updating yourself!");
await Utilities.SleepAsync(5000).ConfigureAwait(false); await Utilities.SleepAsync(5000).ConfigureAwait(false);
} else if (localVersion.CompareTo(remoteVersion) > 0) { } else if (comparisonResult > 0) {
Logging.LogGenericNotice("", "You're currently using pre-release version!"); Logging.LogGenericNotice("", "You're currently using pre-release version!");
Logging.LogGenericNotice("", "Be careful!"); Logging.LogGenericNotice("", "Be careful!");
} }
@@ -131,9 +133,15 @@ namespace ArchiSteamFarm {
} }
} }
private static void InitServices() {
WebBrowser.Init();
}
private static void Main(string[] args) { private static void Main(string[] args) {
Logging.LogGenericInfo("Main", "Archi's Steam Farm, version " + Version); Logging.LogGenericInfo("Main", "Archi's Steam Farm, version " + Version);
InitServices();
Task.Run(async () => await CheckForUpdate().ConfigureAwait(false)).Wait(); Task.Run(async () => await CheckForUpdate().ConfigureAwait(false)).Wait();
// Allow loading configs from source tree if it's a debug build // Allow loading configs from source tree if it's a debug build

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.6.0.0")] [assembly: AssemblyVersion("0.8.0.0")]
[assembly: AssemblyFileVersion("0.6.0.0")] [assembly: AssemblyFileVersion("0.8.0.0")]

View File

@@ -22,14 +22,8 @@
*/ */
using HtmlAgilityPack;
using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -37,6 +31,14 @@ namespace ArchiSteamFarm {
internal static class Utilities { internal static class Utilities {
private static readonly Random Random = new Random(); private static readonly Random Random = new Random();
internal static int RandomNumber(int min, int max) {
return Random.Next(min, max + 1);
}
internal static byte RandomDice() {
return (byte) RandomNumber(1, 6);
}
internal static async Task SleepAsync(int miliseconds) { internal static async Task SleepAsync(int miliseconds) {
await Task.Delay(miliseconds).ConfigureAwait(false); await Task.Delay(miliseconds).ConfigureAwait(false);
} }
@@ -57,161 +59,5 @@ namespace ArchiSteamFarm {
return ulong.Parse(resultString, CultureInfo.InvariantCulture); return ulong.Parse(resultString, CultureInfo.InvariantCulture);
} }
internal static async Task<HttpResponseMessage> UrlToHttpResponse(string websiteAddress, Dictionary<string, string> cookieVariables = null) {
if (string.IsNullOrEmpty(websiteAddress)) {
return null;
}
HttpResponseMessage result = null;
try {
using (HttpClientHandler clientHandler = new HttpClientHandler { UseCookies = false }) {
using (HttpClient client = new HttpClient(clientHandler)) {
client.Timeout = TimeSpan.FromSeconds(10);
client.DefaultRequestHeaders.UserAgent.ParseAdd("ArchiSteamFarm/1.0");
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, websiteAddress);
if (cookieVariables != null) {
StringBuilder cookie = new StringBuilder();
foreach (KeyValuePair<string, string> cookieVariable in cookieVariables) {
cookie.Append(cookieVariable.Key + "=" + cookieVariable.Value + ";");
}
requestMessage.Headers.Add("Cookie", cookie.ToString());
}
HttpResponseMessage responseMessage = await client.SendAsync(requestMessage).ConfigureAwait(false);
if (responseMessage != null) {
responseMessage.EnsureSuccessStatusCode();
result = responseMessage;
}
}
}
} catch (Exception e) {
Logging.LogGenericException("Utilities", e);
}
return result;
}
internal static async Task<HtmlDocument> UrlToHtmlDocument(string websiteAddress, Dictionary<string, string> cookieVariables = null) {
if (string.IsNullOrEmpty(websiteAddress)) {
return null;
}
HtmlDocument result = null;
try {
HttpResponseMessage responseMessage = await UrlToHttpResponse(websiteAddress, cookieVariables).ConfigureAwait(false);
if (responseMessage != null) {
string source = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
if (!string.IsNullOrEmpty(source)) {
source = WebUtility.HtmlDecode(source);
result = new HtmlDocument();
result.LoadHtml(source);
}
}
} catch (Exception e) {
Logging.LogGenericException("Utilities", e);
}
return result;
}
internal static async Task<bool> UrlPostRequest(string request, Dictionary<string, string> postData, Dictionary<string, string> cookieVariables = null, string referer = null) {
if (string.IsNullOrEmpty(request) || postData == null) {
return false;
}
bool result = false;
try {
using (HttpClientHandler clientHandler = new HttpClientHandler { UseCookies = false }) {
using (HttpClient client = new HttpClient(clientHandler)) {
client.Timeout = TimeSpan.FromSeconds(10);
client.DefaultRequestHeaders.UserAgent.ParseAdd("ArchiSteamFarm/1.0");
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Post, request);
requestMessage.Content = new FormUrlEncodedContent(postData);
if (cookieVariables != null && cookieVariables.Count > 0) {
StringBuilder cookie = new StringBuilder();
foreach (KeyValuePair<string, string> cookieVariable in cookieVariables) {
cookie.Append(cookieVariable.Key + "=" + cookieVariable.Value + ";");
}
requestMessage.Headers.Add("Cookie", cookie.ToString());
}
if (referer != null) {
requestMessage.Headers.Referrer = new Uri(referer);
}
HttpResponseMessage responseMessage = await client.SendAsync(requestMessage).ConfigureAwait(false);
if (responseMessage != null) {
result = responseMessage.IsSuccessStatusCode;
}
}
}
} catch (Exception e) {
Logging.LogGenericException("Utilities", e);
}
return result;
}
internal static async Task<HttpResponseMessage> UrlPostRequestWithResponse(string request, Dictionary<string, string> postData, Dictionary<string, string> cookieVariables = null, string referer = null) {
if (string.IsNullOrEmpty(request) || postData == null) {
return null;
}
HttpResponseMessage result = null;
try {
using (HttpClientHandler clientHandler = new HttpClientHandler { UseCookies = false }) {
using (HttpClient client = new HttpClient(clientHandler)) {
client.Timeout = TimeSpan.FromSeconds(10);
client.DefaultRequestHeaders.UserAgent.ParseAdd("ArchiSteamFarm/1.0");
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Post, request);
requestMessage.Content = new FormUrlEncodedContent(postData);
if (cookieVariables != null && cookieVariables.Count > 0) {
StringBuilder cookie = new StringBuilder();
foreach (KeyValuePair<string, string> cookieVariable in cookieVariables) {
cookie.Append(cookieVariable.Key + "=" + cookieVariable.Value + ";");
}
requestMessage.Headers.Add("Cookie", cookie.ToString());
}
if (referer != null) {
requestMessage.Headers.Referrer = new Uri(referer);
}
HttpResponseMessage responseMessage = await client.SendAsync(requestMessage).ConfigureAwait(false);
if (responseMessage != null) {
result = responseMessage;
}
}
}
} catch (Exception e) {
Logging.LogGenericException("Utilities", e);
}
return result;
}
internal static async Task<JObject> UrlToJObject(string request) {
if (string.IsNullOrEmpty(request)) {
return null;
}
HttpResponseMessage httpResponseMessage = await UrlToHttpResponse(request, null).ConfigureAwait(false);
if (httpResponseMessage == null) {
return null;
}
string source = await httpResponseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
if (string.IsNullOrEmpty(source)) {
return null;
}
JObject result = null;
try {
result = JObject.Parse(source);
} catch {
}
return result;
}
} }
} }

View File

@@ -0,0 +1,220 @@
using HtmlAgilityPack;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace ArchiSteamFarm {
internal static class WebBrowser {
internal const byte HttpTimeout = 180; // In seconds
private static readonly HttpClientHandler HttpClientHandler = new HttpClientHandler { UseCookies = false };
private static readonly HttpClient HttpClient = new HttpClient(HttpClientHandler) { Timeout = TimeSpan.FromSeconds(HttpTimeout) };
internal static void Init() {
HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd("ArchiSteamFarm/" + Program.Version);
}
private static async Task<HttpResponseMessage> UrlRequest(string request, HttpMethod httpMethod, Dictionary<string, string> data = null, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request) || httpMethod == null) {
return null;
}
HttpRequestMessage requestMessage = new HttpRequestMessage(httpMethod, request);
if (httpMethod == HttpMethod.Post && data != null) {
requestMessage.Content = new FormUrlEncodedContent(data);
}
if (cookies != null && cookies.Count > 0) {
StringBuilder cookieHeader = new StringBuilder();
foreach (KeyValuePair<string, string> cookie in cookies) {
cookieHeader.Append(cookie.Key + "=" + cookie.Value + ";");
}
requestMessage.Headers.Add("Cookie", cookieHeader.ToString());
}
if (referer != null) {
requestMessage.Headers.Referrer = new Uri(referer);
}
HttpResponseMessage responseMessage;
try {
responseMessage = await HttpClient.SendAsync(requestMessage).ConfigureAwait(false);
} catch { // Request failed, we don't need to know the exact reason, swallow exception
return null;
}
if (responseMessage == null || !responseMessage.IsSuccessStatusCode) {
return null;
}
if (!responseMessage.IsSuccessStatusCode) {
return null;
}
return responseMessage;
}
internal static async Task<HttpResponseMessage> UrlGet(string request, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request)) {
return null;
}
return await UrlRequest(request, HttpMethod.Get, null, cookies, referer).ConfigureAwait(false);
}
internal static async Task<HttpResponseMessage> UrlPost(string request, Dictionary<string, string> postData = null, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request)) {
return null;
}
return await UrlRequest(request, HttpMethod.Post, postData, cookies, referer).ConfigureAwait(false);
}
internal static async Task<HtmlDocument> HttpResponseToHtmlDocument(HttpResponseMessage httpResponse) {
if (httpResponse == null || httpResponse.Content == null) {
return null;
}
string content = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
if (string.IsNullOrEmpty(content)) {
return null;
}
content = WebUtility.HtmlDecode(content);
HtmlDocument htmlDocument = new HtmlDocument();
htmlDocument.LoadHtml(content);
return htmlDocument;
}
internal static async Task<string> UrlGetToContent(string request, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request)) {
return null;
}
HttpResponseMessage responseMessage = await UrlGet(request, cookies, referer).ConfigureAwait(false);
if (responseMessage == null || responseMessage.Content == null) {
return null;
}
return await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
}
internal static async Task<string> UrlPostToContent(string request, Dictionary<string, string> postData = null, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request)) {
return null;
}
HttpResponseMessage responseMessage = await UrlPost(request, postData, cookies, referer).ConfigureAwait(false);
if (responseMessage == null || responseMessage.Content == null) {
return null;
}
return await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
}
internal static async Task<string> UrlGetToTitle(string request, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request)) {
return null;
}
HtmlDocument htmlDocument = await UrlGetToHtmlDocument(request, cookies, referer).ConfigureAwait(false);
if (htmlDocument == null) {
return null;
}
HtmlNode htmlNode = htmlDocument.DocumentNode.SelectSingleNode("//head/title");
if (htmlNode == null) {
return null;
}
return htmlNode.InnerText;
}
internal static async Task<HtmlDocument> UrlGetToHtmlDocument(string request, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request)) {
return null;
}
HttpResponseMessage httpResponse = await UrlGet(request, cookies, referer).ConfigureAwait(false);
if (httpResponse == null) {
return null;
}
return await HttpResponseToHtmlDocument(httpResponse).ConfigureAwait(false);
}
internal static async Task<JArray> UrlGetToJArray(string request, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request)) {
return null;
}
string content = await UrlGetToContent(request, cookies, referer).ConfigureAwait(false);
if (string.IsNullOrEmpty(content)) {
return null;
}
JArray jArray;
try {
jArray = JArray.Parse(content);
} catch (Exception e) {
Logging.LogGenericException("WebBrowser", e);
return null;
}
return jArray;
}
internal static async Task<JObject> UrlGetToJObject(string request, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request)) {
return null;
}
string content = await UrlGetToContent(request, cookies, referer).ConfigureAwait(false);
if (string.IsNullOrEmpty(content)) {
return null;
}
JObject jObject;
try {
jObject = JObject.Parse(content);
} catch (Exception e) {
Logging.LogGenericException("WebBrowser", e);
return null;
}
return jObject;
}
internal static async Task<XmlDocument> UrlGetToXML(string request, Dictionary<string, string> cookies = null, string referer = null) {
if (string.IsNullOrEmpty(request)) {
return null;
}
string content = await UrlGetToContent(request, cookies, referer).ConfigureAwait(false);
if (string.IsNullOrEmpty(content)) {
return null;
}
XmlDocument xmlDocument = new XmlDocument();
try {
xmlDocument.LoadXml(content);
} catch (XmlException e) {
Logging.LogGenericException("WebBrowser", e);
return null;
}
return xmlDocument;
}
}
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<!-- Every bot should have it's own unique .xml configuration file, this is example on which you can base on --> <!-- Every bot should have it's own unique .xml configuration file, this is example on which you can base on -->
<!-- Notice, if you use special characters reserved for XML, you should escape them --> <!-- Notice, if you use special characters reserved for XML, you should escape them -->
@@ -44,6 +43,12 @@
<!-- TIP: Most likely you don't want to change it --> <!-- TIP: Most likely you don't want to change it -->
<SteamMasterClanID type="ulong" value="0"/> <SteamMasterClanID type="ulong" value="0"/>
<!-- This switch defines if the account has card drops restricted -->
<!-- Restricted card drops means that the account doesn't receive any steam cards until it plays the game for at least 2 hours -->
<!-- As there is no magical way to detect it by ASF, I made this option config-based switch -->
<!-- TIP: Based on this parameter, ASF will try to choose the most optimized cards farming algorithm for this account -->
<CardDropsRestricted type="bool" value="false"/>
<!-- This switch defines if bot should disconnect once farming is finished --> <!-- This switch defines if bot should disconnect once farming is finished -->
<!-- When no bots are active, ASF will shutdown as well --> <!-- When no bots are active, ASF will shutdown as well -->
<!-- Some people may want to keep their bots 24/7, other disconnect them after job is done --> <!-- Some people may want to keep their bots 24/7, other disconnect them after job is done -->
@@ -58,5 +63,4 @@
<!-- Consider leaving it at "true", this way I can check how many running bots are active --> <!-- Consider leaving it at "true", this way I can check how many running bots are active -->
<!-- TIP: Group link is http://steamcommunity.com/groups/ascfarm --> <!-- TIP: Group link is http://steamcommunity.com/groups/ascfarm -->
<Statistics type="bool" value="true"/> <Statistics type="bool" value="true"/>
</configuration> </configuration>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net45" /> <package id="HtmlAgilityPack" version="1.4.9" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.1-beta1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="8.0.1-beta3" targetFramework="net45" />
<package id="protobuf-net" version="2.0.0.668" targetFramework="net45" /> <package id="protobuf-net" version="2.0.0.668" targetFramework="net45" />
<package id="SteamKit2" version="1.6.5" targetFramework="net45" /> <package id="SteamKit2" version="1.6.5" targetFramework="net45" />
</packages> </packages>

View File

@@ -1,39 +1,53 @@
ArchiSteamFarm ArchiSteamFarm
=================== ===================
Big work-in-progress. This bot allows you to farm steam cards using multiple accounts simultaneously. Each account is defined by it's own XML config in `config` directory and you don´t need any steam-client running in the background. ASF is a C# application that allows you to farm steam cards using multiple steam accounts simultaneously. Unlike idle master which works only on one account at given time, requires steam client running in background, and launches additional processes imitiating "game playing" status, ASF doesn't require any steam client running in the background, doesn't launch any additional processes and is made to handle unlimited steam accounts at once. In addition to that, it's meant to be run on servers or other desktop-less machines, and features full Mono support, which makes it possible to launch on any Mono-supported operating system, such as Windows, Linux or OS X. ASF is based on, and possible, thanks to [SteamKit2](https://github.com/SteamRE/SteamKit).
**Current functions:** **Core features:**
- Automatically farm steam cards using any number of active accounts - Automatically farm available games using any number of active accounts
- Automatically accept friend requests sent from master - Automatically accept friend requests sent from master
- Automatically accept all trades coming from master - Automatically accept all trades coming from master
- Automatically accept all steam cd-keys sent via chat from master - Automatically accept all steam cd-keys sent via chat from master
- SteamGuard / 2-factor-authentication support - Possibility to choose the most efficient cards farming algorithm, based on given account
- Full Mono support, tested on Debian "9.0" Stretch (testing) - SteamGuard / SteamParental / 2FA support
- Update notifications
- Full Mono support, cross-OS compatibility
**Setting up:**
Each ASF bot is defined in it's own XML config file in `config` directory. ASF comes with included ```example.xml``` config file, on which you should base all of your bots. Simply copy ```example.xml``` to a new file, and edit properties inside. Don't forget to switch ```Enabled``` property to ```true``` once you're done, as this is the master switch which enables configured bot to launch.
ASF expects exclusive access to all steam accounts it's using, which means that you should not use the account which is currently being used by ASF at the same time. You may however ```!start``` and ```!stop``` bots during farming, as well as use config property such as ```ShutdownOnFarmingFinished``` which will automatically release account after farming is done.
After you set up all your bots (their configs), you should launch ```ASF.exe```. If your accounts require additional steps to unlock, such as Steam guard code, you'll need to enter those too after ASF tries to launch given bot. If everything ended properly, you should notice in the console output, as well as on your Steam, that all of your bots automatically started cards farming.
ASF doesn't require and doesn't interfere in any way with Steam client, which means that you can be logged in to Steam client as your primary account with e.g. Idle Master in the background, and launch ASF for all other accounts (your alts) at the same time.
**Current Commands:** **Current Commands:**
- `!farm` Restarts the bot and starts card-farming (again) - `!exit` Stops whole ASF
- `!exit` Stops the bot - `!farm` Restarts cards farming module. ASF automatically executes that if any cd-key is successfully claimed
- `!redeem <KEY>` Redeems cd-key on current bot instance. You can also paste cd-key directly to the chat
- `!start <BOT>` Starts given bot instance, after it was ```!stop```pped
- `!status` Prints current status of ASF
- `!stop` Stops current bot instance
- `!stop <BOT>` Stops given bot instance
> You can use chat-commands in group-chat or private-chat with your bot. > Commands can be executed via a private chat with your bot.
> The MasterID has to be set for this specific bot / config-file. > Remember that bot accepts commands only from ```SteamMasterID```. That property can be configured in the config.
**Supported / Tested Operating-Systems:** **Supported / Tested Operating-Systems:**
- Windows 10 Enterprise Edition - Windows 10 Professional/Enterprise Edition (Native)
- Windows 8.1 Professional (Native)
- Windows 7 Ultimate (Native)
- Debian 9.0 Stretch (Mono) - Debian 9.0 Stretch (Mono)
- Debian 8.1 Jessie (Mono) - Debian 8.1 Jessie (Mono)
- OS X 10.11.1 (Mono)
**TODO**: However, any operating system [listed here](http://www.mono-project.com/docs/about-mono/supported-platforms/) should run ASF flawlessly.
- Smart Multi-Game-Farming **Need help or more info?**
- Possible integration with SteamTradeMatcher, bot can detect dupes and trade them automatically. Backend-code is already here, just missing actual implementation.
- Automatic sending of steamtrades to master(after game is fully farmed)
- Probably much more
Head over to our [wiki](https://github.com/JustArchi/ArchiSteamFarm/wiki) then.
> This is big WIP, so feel free to send pull requests if you wish. I'll
> release some releases later, when everything is tested and code
> cleaned up.

View File

@@ -106,7 +106,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Bson.BsonReader.Read"> <member name="M:Newtonsoft.Json.Bson.BsonReader.Read">
<summary> <summary>
@@ -926,6 +926,25 @@
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings. Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
<summary>
Provides an interface for using pooled buffers.
</summary>
<typeparam name="T">The buffer type content.</typeparam>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
<summary>
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
</summary>
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
<returns>The rented buffer from the pool.</returns>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
<summary>
Return a buffer to the pool.
</summary>
<param name="buffer">The buffer that is being returned.</param>
</member>
<member name="T:Newtonsoft.Json.JsonConstructorAttribute"> <member name="T:Newtonsoft.Json.JsonConstructorAttribute">
<summary> <summary>
Instructs the <see cref="T:Newtonsoft.Json.JsonSerializer"/> to use the specified constructor when deserializing that object. Instructs the <see cref="T:Newtonsoft.Json.JsonSerializer"/> to use the specified constructor when deserializing that object.
@@ -1028,6 +1047,21 @@
Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>. Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.Linq.LineInfoHandling">
<summary>
Specifies how line information is handled when loading JSON.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Ignore">
<summary>
Ignore line information.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Load">
<summary>
Load line information.
</summary>
</member>
<member name="T:Newtonsoft.Json.Linq.JsonLoadSettings"> <member name="T:Newtonsoft.Json.Linq.JsonLoadSettings">
<summary> <summary>
Specifies the settings used when loading JSON. Specifies the settings used when loading JSON.
@@ -1039,6 +1073,12 @@
</summary> </summary>
<value>The JSON comment handling.</value> <value>The JSON comment handling.</value>
</member> </member>
<member name="P:Newtonsoft.Json.Linq.JsonLoadSettings.LineInfoHandling">
<summary>
Gets or sets how JSON line info is handled when loading JSON.
</summary>
<value>The JSON line info handling.</value>
</member>
<member name="T:Newtonsoft.Json.Linq.JsonMergeSettings"> <member name="T:Newtonsoft.Json.Linq.JsonMergeSettings">
<summary> <summary>
Specifies the settings used when merging JSON. Specifies the settings used when merging JSON.
@@ -2167,7 +2207,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Linq.JTokenReader.Read"> <member name="M:Newtonsoft.Json.Linq.JTokenReader.Read">
<summary> <summary>
@@ -6074,6 +6114,11 @@
The property must be defined in JSON and cannot be a null value. The property must be defined in JSON and cannot be a null value.
</summary> </summary>
</member> </member>
<member name="F:Newtonsoft.Json.Required.DisallowNull">
<summary>
The property is not required but it cannot be a null value.
</summary>
</member>
<member name="T:Newtonsoft.Json.PreserveReferencesHandling"> <member name="T:Newtonsoft.Json.PreserveReferencesHandling">
<summary> <summary>
Specifies reference handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>. Specifies reference handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
@@ -6620,7 +6665,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonValidatingReader.Read"> <member name="M:Newtonsoft.Json.JsonValidatingReader.Read">
<summary> <summary>
@@ -6685,6 +6730,11 @@
</summary> </summary>
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param> <param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
<summary>
Gets or sets the reader's character buffer pool.
</summary>
</member>
<member name="M:Newtonsoft.Json.JsonTextReader.Read"> <member name="M:Newtonsoft.Json.JsonTextReader.Read">
<summary> <summary>
Reads the next JSON token from the stream. Reads the next JSON token from the stream.
@@ -6723,7 +6773,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonTextReader.Close"> <member name="M:Newtonsoft.Json.JsonTextReader.Close">
<summary> <summary>
@@ -6871,6 +6921,11 @@
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
</summary> </summary>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
<summary>
Gets or sets the writer's character buffer pool.
</summary>
</member>
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation"> <member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
<summary> <summary>
Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>. Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>.
@@ -7470,7 +7525,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonReader.Skip"> <member name="M:Newtonsoft.Json.JsonReader.Skip">
<summary> <summary>

View File

@@ -89,7 +89,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -977,6 +977,25 @@
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings. Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
<summary>
Provides an interface for using pooled buffers.
</summary>
<typeparam name="T">The buffer type content.</typeparam>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
<summary>
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
</summary>
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
<returns>The rented buffer from the pool.</returns>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
<summary>
Return a buffer to the pool.
</summary>
<param name="buffer">The buffer that is being returned.</param>
</member>
<member name="T:Newtonsoft.Json.JsonConstructorAttribute"> <member name="T:Newtonsoft.Json.JsonConstructorAttribute">
<summary> <summary>
Instructs the <see cref="T:Newtonsoft.Json.JsonSerializer"/> to use the specified constructor when deserializing that object. Instructs the <see cref="T:Newtonsoft.Json.JsonSerializer"/> to use the specified constructor when deserializing that object.
@@ -1079,6 +1098,21 @@
Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>. Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.Linq.LineInfoHandling">
<summary>
Specifies how line information is handled when loading JSON.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Ignore">
<summary>
Ignore line information.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Load">
<summary>
Load line information.
</summary>
</member>
<member name="T:Newtonsoft.Json.Linq.JPropertyDescriptor"> <member name="T:Newtonsoft.Json.Linq.JPropertyDescriptor">
<summary> <summary>
Represents a view of a <see cref="T:Newtonsoft.Json.Linq.JProperty"/>. Represents a view of a <see cref="T:Newtonsoft.Json.Linq.JProperty"/>.
@@ -1179,6 +1213,12 @@
</summary> </summary>
<value>The JSON comment handling.</value> <value>The JSON comment handling.</value>
</member> </member>
<member name="P:Newtonsoft.Json.Linq.JsonLoadSettings.LineInfoHandling">
<summary>
Gets or sets how JSON line info is handled when loading JSON.
</summary>
<value>The JSON line info handling.</value>
</member>
<member name="T:Newtonsoft.Json.Linq.JsonMergeSettings"> <member name="T:Newtonsoft.Json.Linq.JsonMergeSettings">
<summary> <summary>
Specifies the settings used when merging JSON. Specifies the settings used when merging JSON.
@@ -2229,7 +2269,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -5124,6 +5164,11 @@
The property must be defined in JSON and cannot be a null value. The property must be defined in JSON and cannot be a null value.
</summary> </summary>
</member> </member>
<member name="F:Newtonsoft.Json.Required.DisallowNull">
<summary>
The property is not required but it cannot be a null value.
</summary>
</member>
<member name="T:Newtonsoft.Json.PreserveReferencesHandling"> <member name="T:Newtonsoft.Json.PreserveReferencesHandling">
<summary> <summary>
Specifies reference handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>. Specifies reference handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
@@ -5670,7 +5715,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -5741,6 +5786,11 @@
</summary> </summary>
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param> <param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
<summary>
Gets or sets the reader's character buffer pool.
</summary>
</member>
<member name="M:Newtonsoft.Json.JsonTextReader.Read"> <member name="M:Newtonsoft.Json.JsonTextReader.Read">
<summary> <summary>
Reads the next JSON token from the stream. Reads the next JSON token from the stream.
@@ -5779,7 +5829,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -5933,6 +5983,11 @@
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
</summary> </summary>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
<summary>
Gets or sets the writer's character buffer pool.
</summary>
</member>
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation"> <member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
<summary> <summary>
Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>. Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>.
@@ -6538,7 +6593,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset">
<summary> <summary>

View File

@@ -89,7 +89,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -973,6 +973,25 @@
Floating point numbers are parsed to <see cref="F:Newtonsoft.Json.FloatParseHandling.Decimal"/>. Floating point numbers are parsed to <see cref="F:Newtonsoft.Json.FloatParseHandling.Decimal"/>.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
<summary>
Provides an interface for using pooled buffers.
</summary>
<typeparam name="T">The buffer type content.</typeparam>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
<summary>
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
</summary>
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
<returns>The rented buffer from the pool.</returns>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
<summary>
Return a buffer to the pool.
</summary>
<param name="buffer">The buffer that is being returned.</param>
</member>
<member name="T:Newtonsoft.Json.JsonDictionaryAttribute"> <member name="T:Newtonsoft.Json.JsonDictionaryAttribute">
<summary> <summary>
Instructs the <see cref="T:Newtonsoft.Json.JsonSerializer"/> how to serialize the collection. Instructs the <see cref="T:Newtonsoft.Json.JsonSerializer"/> how to serialize the collection.
@@ -1151,6 +1170,21 @@
Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>. Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.Linq.LineInfoHandling">
<summary>
Specifies how line information is handled when loading JSON.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Ignore">
<summary>
Ignore line information.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Load">
<summary>
Load line information.
</summary>
</member>
<member name="T:Newtonsoft.Json.Linq.JsonLoadSettings"> <member name="T:Newtonsoft.Json.Linq.JsonLoadSettings">
<summary> <summary>
Specifies the settings used when loading JSON. Specifies the settings used when loading JSON.
@@ -1162,6 +1196,12 @@
</summary> </summary>
<value>The JSON comment handling.</value> <value>The JSON comment handling.</value>
</member> </member>
<member name="P:Newtonsoft.Json.Linq.JsonLoadSettings.LineInfoHandling">
<summary>
Gets or sets how JSON line info is handled when loading JSON.
</summary>
<value>The JSON line info handling.</value>
</member>
<member name="T:Newtonsoft.Json.Linq.JsonMergeSettings"> <member name="T:Newtonsoft.Json.Linq.JsonMergeSettings">
<summary> <summary>
Specifies the settings used when merging JSON. Specifies the settings used when merging JSON.
@@ -2321,7 +2361,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -5332,6 +5372,11 @@
The property must be defined in JSON and cannot be a null value. The property must be defined in JSON and cannot be a null value.
</summary> </summary>
</member> </member>
<member name="F:Newtonsoft.Json.Required.DisallowNull">
<summary>
The property is not required but it cannot be a null value.
</summary>
</member>
<member name="T:Newtonsoft.Json.PreserveReferencesHandling"> <member name="T:Newtonsoft.Json.PreserveReferencesHandling">
<summary> <summary>
Specifies reference handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>. Specifies reference handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
@@ -5878,7 +5923,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -5949,6 +5994,11 @@
</summary> </summary>
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param> <param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
<summary>
Gets or sets the reader's character buffer pool.
</summary>
</member>
<member name="M:Newtonsoft.Json.JsonTextReader.Read"> <member name="M:Newtonsoft.Json.JsonTextReader.Read">
<summary> <summary>
Reads the next JSON token from the stream. Reads the next JSON token from the stream.
@@ -5987,7 +6037,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -6141,6 +6191,11 @@
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
</summary> </summary>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
<summary>
Gets or sets the writer's character buffer pool.
</summary>
</member>
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation"> <member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
<summary> <summary>
Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>. Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>.
@@ -6746,7 +6801,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset">
<summary> <summary>

View File

@@ -106,7 +106,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -1084,6 +1084,25 @@
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings. Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
<summary>
Provides an interface for using pooled buffers.
</summary>
<typeparam name="T">The buffer type content.</typeparam>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
<summary>
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
</summary>
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
<returns>The rented buffer from the pool.</returns>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
<summary>
Return a buffer to the pool.
</summary>
<param name="buffer">The buffer that is being returned.</param>
</member>
<member name="T:Newtonsoft.Json.IJsonLineInfo"> <member name="T:Newtonsoft.Json.IJsonLineInfo">
<summary> <summary>
Provides an interface to enable a class to return line and position information. Provides an interface to enable a class to return line and position information.
@@ -2386,7 +2405,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -3030,6 +3049,11 @@
</summary> </summary>
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param> <param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
<summary>
Gets or sets the reader's character buffer pool.
</summary>
</member>
<member name="M:Newtonsoft.Json.JsonTextReader.Read"> <member name="M:Newtonsoft.Json.JsonTextReader.Read">
<summary> <summary>
Reads the next JSON token from the stream. Reads the next JSON token from the stream.
@@ -3068,7 +3092,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -3110,6 +3134,11 @@
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
</summary> </summary>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
<summary>
Gets or sets the writer's character buffer pool.
</summary>
</member>
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation"> <member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
<summary> <summary>
Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>. Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>.
@@ -3557,7 +3586,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -4080,6 +4109,21 @@
Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>. Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.Linq.LineInfoHandling">
<summary>
Specifies how line information is handled when loading JSON.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Ignore">
<summary>
Ignore line information.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Load">
<summary>
Load line information.
</summary>
</member>
<member name="T:Newtonsoft.Json.Linq.Extensions"> <member name="T:Newtonsoft.Json.Linq.Extensions">
<summary> <summary>
Contains the LINQ to JSON extension methods. Contains the LINQ to JSON extension methods.
@@ -6199,7 +6243,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -6782,6 +6826,12 @@
</summary> </summary>
<value>The JSON comment handling.</value> <value>The JSON comment handling.</value>
</member> </member>
<member name="P:Newtonsoft.Json.Linq.JsonLoadSettings.LineInfoHandling">
<summary>
Gets or sets how JSON line info is handled when loading JSON.
</summary>
<value>The JSON line info handling.</value>
</member>
<member name="T:Newtonsoft.Json.Linq.MergeArrayHandling"> <member name="T:Newtonsoft.Json.Linq.MergeArrayHandling">
<summary> <summary>
Specifies how JSON arrays are merged together. Specifies how JSON arrays are merged together.
@@ -6966,6 +7016,11 @@
The property must be defined in JSON and cannot be a null value. The property must be defined in JSON and cannot be a null value.
</summary> </summary>
</member> </member>
<member name="F:Newtonsoft.Json.Required.DisallowNull">
<summary>
The property is not required but it cannot be a null value.
</summary>
</member>
<member name="T:Newtonsoft.Json.Schema.Extensions"> <member name="T:Newtonsoft.Json.Schema.Extensions">
<summary> <summary>
<para> <para>

View File

@@ -106,7 +106,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -857,6 +857,25 @@
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings. Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
<summary>
Provides an interface for using pooled buffers.
</summary>
<typeparam name="T">The buffer type content.</typeparam>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
<summary>
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
</summary>
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
<returns>The rented buffer from the pool.</returns>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
<summary>
Return a buffer to the pool.
</summary>
<param name="buffer">The buffer that is being returned.</param>
</member>
<member name="T:Newtonsoft.Json.IJsonLineInfo"> <member name="T:Newtonsoft.Json.IJsonLineInfo">
<summary> <summary>
Provides an interface to enable a class to return line and position information. Provides an interface to enable a class to return line and position information.
@@ -1947,7 +1966,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -2573,6 +2592,11 @@
</summary> </summary>
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param> <param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
<summary>
Gets or sets the reader's character buffer pool.
</summary>
</member>
<member name="M:Newtonsoft.Json.JsonTextReader.Read"> <member name="M:Newtonsoft.Json.JsonTextReader.Read">
<summary> <summary>
Reads the next JSON token from the stream. Reads the next JSON token from the stream.
@@ -2611,7 +2635,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -2653,6 +2677,11 @@
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
</summary> </summary>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
<summary>
Gets or sets the writer's character buffer pool.
</summary>
</member>
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation"> <member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
<summary> <summary>
Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>. Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>.
@@ -3100,7 +3129,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -3614,6 +3643,21 @@
Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>. Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.Linq.LineInfoHandling">
<summary>
Specifies how line information is handled when loading JSON.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Ignore">
<summary>
Ignore line information.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Load">
<summary>
Load line information.
</summary>
</member>
<member name="T:Newtonsoft.Json.Linq.Extensions"> <member name="T:Newtonsoft.Json.Linq.Extensions">
<summary> <summary>
Contains the LINQ to JSON extension methods. Contains the LINQ to JSON extension methods.
@@ -4517,6 +4561,12 @@
</summary> </summary>
<value>The JSON comment handling.</value> <value>The JSON comment handling.</value>
</member> </member>
<member name="P:Newtonsoft.Json.Linq.JsonLoadSettings.LineInfoHandling">
<summary>
Gets or sets how JSON line info is handled when loading JSON.
</summary>
<value>The JSON line info handling.</value>
</member>
<member name="T:Newtonsoft.Json.Linq.JsonMergeSettings"> <member name="T:Newtonsoft.Json.Linq.JsonMergeSettings">
<summary> <summary>
Specifies the settings used when merging JSON. Specifies the settings used when merging JSON.
@@ -5484,7 +5534,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -6231,6 +6281,11 @@
The property must be defined in JSON and cannot be a null value. The property must be defined in JSON and cannot be a null value.
</summary> </summary>
</member> </member>
<member name="F:Newtonsoft.Json.Required.DisallowNull">
<summary>
The property is not required but it cannot be a null value.
</summary>
</member>
<member name="T:Newtonsoft.Json.Schema.Extensions"> <member name="T:Newtonsoft.Json.Schema.Extensions">
<summary> <summary>
<para> <para>

View File

@@ -106,7 +106,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -956,6 +956,25 @@
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings. Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
<summary>
Provides an interface for using pooled buffers.
</summary>
<typeparam name="T">The buffer type content.</typeparam>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
<summary>
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
</summary>
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
<returns>The rented buffer from the pool.</returns>
</member>
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
<summary>
Return a buffer to the pool.
</summary>
<param name="buffer">The buffer that is being returned.</param>
</member>
<member name="T:Newtonsoft.Json.IJsonLineInfo"> <member name="T:Newtonsoft.Json.IJsonLineInfo">
<summary> <summary>
Provides an interface to enable a class to return line and position information. Provides an interface to enable a class to return line and position information.
@@ -2197,7 +2216,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -2823,6 +2842,11 @@
</summary> </summary>
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param> <param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
<summary>
Gets or sets the reader's character buffer pool.
</summary>
</member>
<member name="M:Newtonsoft.Json.JsonTextReader.Read"> <member name="M:Newtonsoft.Json.JsonTextReader.Read">
<summary> <summary>
Reads the next JSON token from the stream. Reads the next JSON token from the stream.
@@ -2861,7 +2885,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -2903,6 +2927,11 @@
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
</summary> </summary>
</member> </member>
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
<summary>
Gets or sets the writer's character buffer pool.
</summary>
</member>
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation"> <member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
<summary> <summary>
Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>. Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref="T:Newtonsoft.Json.Formatting"/> is set to <c>Formatting.Indented</c>.
@@ -3350,7 +3379,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -3864,6 +3893,21 @@
Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>. Load comments as a <see cref="T:Newtonsoft.Json.Linq.JValue"/> with type <see cref="F:Newtonsoft.Json.Linq.JTokenType.Comment"/>.
</summary> </summary>
</member> </member>
<member name="T:Newtonsoft.Json.Linq.LineInfoHandling">
<summary>
Specifies how line information is handled when loading JSON.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Ignore">
<summary>
Ignore line information.
</summary>
</member>
<member name="F:Newtonsoft.Json.Linq.LineInfoHandling.Load">
<summary>
Load line information.
</summary>
</member>
<member name="T:Newtonsoft.Json.Linq.Extensions"> <member name="T:Newtonsoft.Json.Linq.Extensions">
<summary> <summary>
Contains the LINQ to JSON extension methods. Contains the LINQ to JSON extension methods.
@@ -4787,6 +4831,12 @@
</summary> </summary>
<value>The JSON comment handling.</value> <value>The JSON comment handling.</value>
</member> </member>
<member name="P:Newtonsoft.Json.Linq.JsonLoadSettings.LineInfoHandling">
<summary>
Gets or sets how JSON line info is handled when loading JSON.
</summary>
<value>The JSON line info handling.</value>
</member>
<member name="T:Newtonsoft.Json.Linq.JsonMergeSettings"> <member name="T:Newtonsoft.Json.Linq.JsonMergeSettings">
<summary> <summary>
Specifies the settings used when merging JSON. Specifies the settings used when merging JSON.
@@ -5772,7 +5822,7 @@
<summary> <summary>
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>. Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
</summary> </summary>
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns> <returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
</member> </member>
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset"> <member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
<summary> <summary>
@@ -6528,6 +6578,11 @@
The property must be defined in JSON and cannot be a null value. The property must be defined in JSON and cannot be a null value.
</summary> </summary>
</member> </member>
<member name="F:Newtonsoft.Json.Required.DisallowNull">
<summary>
The property is not required but it cannot be a null value.
</summary>
</member>
<member name="T:Newtonsoft.Json.Schema.Extensions"> <member name="T:Newtonsoft.Json.Schema.Extensions">
<summary> <summary>
<para> <para>