mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-30 21:20:46 +00:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85dea3ab70 | ||
|
|
aa9d78af95 | ||
|
|
550effd7c1 | ||
|
|
548146cb65 | ||
|
|
4ca39da1f2 | ||
|
|
f406034c63 | ||
|
|
2b5b38aa07 | ||
|
|
b8dbddd6f4 | ||
|
|
8ce70889d7 | ||
|
|
93d235c1b2 | ||
|
|
73af6b369a | ||
|
|
2d91a1ed26 | ||
|
|
7af0027c66 | ||
|
|
2ce54d9d0a | ||
|
|
88d722c14b | ||
|
|
5c46069c67 | ||
|
|
c2a1c160e0 | ||
|
|
ff971f7615 | ||
|
|
cdcaa9b06c | ||
|
|
9403985b14 | ||
|
|
a0215d2ac4 | ||
|
|
2ef99461d6 | ||
|
|
8e91031510 | ||
|
|
254cd3843e | ||
|
|
450fc579f7 | ||
|
|
98f9e716d2 | ||
|
|
86c8aa9b74 | ||
|
|
33e0675177 | ||
|
|
f840f28657 | ||
|
|
64eb4a51b6 | ||
|
|
97affa7b54 | ||
|
|
65f1d790da | ||
|
|
0107185f2a | ||
|
|
b8e98f58ac | ||
|
|
be9217f493 |
@@ -105,6 +105,19 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class PlayingSessionStateCallback : CallbackMsg {
|
||||
internal readonly bool PlayingBlocked;
|
||||
|
||||
internal PlayingSessionStateCallback(JobID jobID, CMsgClientPlayingSessionState msg) {
|
||||
if ((jobID == null) || (msg == null)) {
|
||||
throw new ArgumentNullException(nameof(jobID) + " || " + nameof(msg));
|
||||
}
|
||||
|
||||
JobID = jobID;
|
||||
PlayingBlocked = msg.playing_blocked;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class PurchaseResponseCallback : CallbackMsg {
|
||||
internal enum EPurchaseResult : sbyte {
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
@@ -136,6 +149,7 @@ namespace ArchiSteamFarm {
|
||||
KeyValue receiptInfo = new KeyValue();
|
||||
using (MemoryStream ms = new MemoryStream(msg.purchase_receipt_info)) {
|
||||
if (!receiptInfo.TryReadAsBinary(ms)) {
|
||||
Logging.LogNullError(nameof(ms));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -189,7 +203,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
internal void PlayGames(ICollection<uint> gameIDs) {
|
||||
if ((gameIDs == null) || !Client.IsConnected) {
|
||||
if (gameIDs == null) {
|
||||
Logging.LogNullError(nameof(gameIDs), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Client.IsConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -204,7 +223,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
internal async Task<PurchaseResponseCallback> RedeemKey(string key) {
|
||||
if (string.IsNullOrEmpty(key) || !Client.IsConnected) {
|
||||
if (string.IsNullOrEmpty(key)) {
|
||||
Logging.LogNullError(nameof(key), Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!Client.IsConnected) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -268,6 +292,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
public override void HandleMsg(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
Logging.LogNullError(nameof(packetMsg), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -278,6 +303,9 @@ namespace ArchiSteamFarm {
|
||||
case EMsg.ClientItemAnnouncements:
|
||||
HandleItemAnnouncements(packetMsg);
|
||||
break;
|
||||
case EMsg.ClientPlayingSessionState:
|
||||
HandlePlayingSessionState(packetMsg);
|
||||
break;
|
||||
case EMsg.ClientPurchaseResponse:
|
||||
HandlePurchaseResponse(packetMsg);
|
||||
break;
|
||||
@@ -289,6 +317,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private void HandleFSOfflineMessageNotification(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
Logging.LogNullError(nameof(packetMsg), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -298,6 +327,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private void HandleItemAnnouncements(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
Logging.LogNullError(nameof(packetMsg), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -305,8 +335,19 @@ namespace ArchiSteamFarm {
|
||||
Client.PostCallback(new NotificationsCallback(packetMsg.TargetJobID, response.Body));
|
||||
}
|
||||
|
||||
private void HandlePlayingSessionState(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
Logging.LogNullError(nameof(packetMsg), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
ClientMsgProtobuf<CMsgClientPlayingSessionState> response = new ClientMsgProtobuf<CMsgClientPlayingSessionState>(packetMsg);
|
||||
Client.PostCallback(new PlayingSessionStateCallback(packetMsg.TargetJobID, response.Body));
|
||||
}
|
||||
|
||||
private void HandlePurchaseResponse(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
Logging.LogNullError(nameof(packetMsg), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -316,6 +357,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private void HandleUserNotifications(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
Logging.LogNullError(nameof(packetMsg), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.4.9\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1-beta1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="protobuf-net, Version=2.0.0.668, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
|
||||
@@ -170,7 +170,7 @@
|
||||
cp "$(TargetDir)config/ASF.json" "$(SolutionDir)out/config"
|
||||
cp "$(TargetDir)config/example.json" "$(SolutionDir)out/config"
|
||||
cp "$(TargetDir)config/minimal.json" "$(SolutionDir)out/config"
|
||||
mono -O=all "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
|
||||
mono --llvm --server -O=all "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
|
||||
rm "$(SolutionDir)out/ASF.exe.config"
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -27,6 +27,7 @@ using HtmlAgilityPack;
|
||||
using SteamKit2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -55,20 +56,28 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static uint GetAppIDFromMarketHashName(string hashName) {
|
||||
if (string.IsNullOrEmpty(hashName)) {
|
||||
Logging.LogNullError(nameof(hashName));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int index = hashName.IndexOf('-');
|
||||
if (index < 1) {
|
||||
Logging.LogNullError(nameof(index));
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint appID;
|
||||
return !uint.TryParse(hashName.Substring(0, index), out appID) ? 0 : appID;
|
||||
if (uint.TryParse(hashName.Substring(0, index), out appID)) {
|
||||
return appID;
|
||||
}
|
||||
|
||||
Logging.LogNullError(nameof(appID));
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static Steam.Item.EType GetItemType(string name) {
|
||||
if (string.IsNullOrEmpty(name)) {
|
||||
Logging.LogNullError(nameof(name));
|
||||
return Steam.Item.EType.Unknown;
|
||||
}
|
||||
|
||||
@@ -110,6 +119,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal bool Init(SteamClient steamClient, string webAPIUserNonce, string parentalPin) {
|
||||
if ((steamClient == null) || string.IsNullOrEmpty(webAPIUserNonce)) {
|
||||
Logging.LogNullError(nameof(steamClient) + " || " + nameof(webAPIUserNonce), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -158,6 +168,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
if (authResult == null) {
|
||||
Logging.LogNullError(nameof(authResult), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -181,6 +192,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal async Task<bool> AcceptGift(ulong gid) {
|
||||
if (gid == 0) {
|
||||
Logging.LogNullError(nameof(gid), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -190,7 +202,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string sessionID = WebBrowser.CookieContainer.GetCookieValue(SteamCommunityURL, "sessionid");
|
||||
if (string.IsNullOrEmpty(sessionID)) {
|
||||
Logging.LogNullError("sessionID");
|
||||
Logging.LogNullError(nameof(sessionID), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -199,21 +211,12 @@ namespace ArchiSteamFarm {
|
||||
{ "sessionid", sessionID }
|
||||
};
|
||||
|
||||
bool result = false;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && !result; i++) {
|
||||
result = await WebBrowser.UrlPost(request, data).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
return await WebBrowser.UrlPostRetry(request, data).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal async Task<bool> JoinGroup(ulong groupID) {
|
||||
if (groupID == 0) {
|
||||
Logging.LogNullError(nameof(groupID), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -223,7 +226,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string sessionID = WebBrowser.CookieContainer.GetCookieValue(SteamCommunityURL, "sessionid");
|
||||
if (string.IsNullOrEmpty(sessionID)) {
|
||||
Logging.LogNullError("sessionID");
|
||||
Logging.LogNullError(nameof(sessionID), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -233,17 +236,7 @@ namespace ArchiSteamFarm {
|
||||
{ "action", "join" }
|
||||
};
|
||||
|
||||
bool result = false;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && !result; i++) {
|
||||
result = await WebBrowser.UrlPost(request, data).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
return await WebBrowser.UrlPostRetry(request, data).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal async Task<Dictionary<uint, string>> GetOwnedGames() {
|
||||
@@ -253,13 +246,8 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string request = SteamCommunityURL + "/my/games/?xml=1";
|
||||
|
||||
XmlDocument response = null;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && (response == null); i++) {
|
||||
response = await WebBrowser.UrlGetToXML(request).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
XmlDocument response = await WebBrowser.UrlGetToXMLRetry(request).ConfigureAwait(false);
|
||||
if (response == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -272,16 +260,19 @@ namespace ArchiSteamFarm {
|
||||
foreach (XmlNode xmlNode in xmlNodeList) {
|
||||
XmlNode appNode = xmlNode.SelectSingleNode("appID");
|
||||
if (appNode == null) {
|
||||
Logging.LogNullError(nameof(appNode), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint appID;
|
||||
if (!uint.TryParse(appNode.InnerText, out appID)) {
|
||||
Logging.LogNullError(nameof(appID), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
XmlNode nameNode = xmlNode.SelectSingleNode("name");
|
||||
if (nameNode == null) {
|
||||
Logging.LogNullError(nameof(nameNode), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -293,6 +284,9 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal Dictionary<uint, string> GetOwnedGames(ulong steamID) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(Bot.BotConfig.SteamApiKey)) {
|
||||
// TODO: Correct this when Mono 4.4+ will be a latest stable one | https://bugzilla.xamarin.com/show_bug.cgi?id=39455
|
||||
Logging.LogNullError("steamID || SteamApiKey", Bot.BotName);
|
||||
//Logging.LogNullError(nameof(steamID) + " || " + nameof(Bot.BotConfig.SteamApiKey), Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -308,7 +302,7 @@ namespace ArchiSteamFarm {
|
||||
secure: !Program.GlobalConfig.ForceHttp
|
||||
);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
Logging.LogGenericException(e, Bot.BotName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -322,6 +316,7 @@ namespace ArchiSteamFarm {
|
||||
foreach (KeyValue game in response["games"].Children) {
|
||||
uint appID = (uint) game["appid"].AsUnsignedLong();
|
||||
if (appID == 0) {
|
||||
Logging.LogNullError(nameof(appID));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -333,6 +328,9 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal HashSet<Steam.TradeOffer> GetTradeOffers() {
|
||||
if (string.IsNullOrEmpty(Bot.BotConfig.SteamApiKey)) {
|
||||
// TODO: Correct this when Mono 4.4+ will be a latest stable one | https://bugzilla.xamarin.com/show_bug.cgi?id=39455
|
||||
Logging.LogNullError("SteamApiKey", Bot.BotName);
|
||||
//Logging.LogNullError(nameof(Bot.BotConfig.SteamApiKey), Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -359,17 +357,15 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
Dictionary<Tuple<ulong, ulong>, Tuple<uint, Steam.Item.EType>> descriptions = new Dictionary<Tuple<ulong, ulong>, Tuple<uint, Steam.Item.EType>>();
|
||||
Dictionary<ulong, Tuple<uint, Steam.Item.EType>> descriptions = new Dictionary<ulong, Tuple<uint, Steam.Item.EType>>();
|
||||
foreach (KeyValue description in response["descriptions"].Children) {
|
||||
ulong classID = description["classid"].AsUnsignedLong();
|
||||
if (classID == 0) {
|
||||
Logging.LogNullError(nameof(classID), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
ulong instanceID = description["instanceid"].AsUnsignedLong();
|
||||
|
||||
Tuple<ulong, ulong> key = new Tuple<ulong, ulong>(classID, instanceID);
|
||||
if (descriptions.ContainsKey(key)) {
|
||||
if (descriptions.ContainsKey(classID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -386,7 +382,7 @@ namespace ArchiSteamFarm {
|
||||
type = GetItemType(descriptionType);
|
||||
}
|
||||
|
||||
descriptions[key] = new Tuple<uint, Steam.Item.EType>(appID, type);
|
||||
descriptions[classID] = new Tuple<uint, Steam.Item.EType>(appID, type);
|
||||
}
|
||||
|
||||
HashSet<Steam.TradeOffer> result = new HashSet<Steam.TradeOffer>();
|
||||
@@ -407,10 +403,8 @@ namespace ArchiSteamFarm {
|
||||
Amount = (uint) item["amount"].AsUnsignedLong()
|
||||
};
|
||||
|
||||
Tuple<ulong, ulong> key = new Tuple<ulong, ulong>(steamItem.ClassID, steamItem.InstanceID);
|
||||
|
||||
Tuple<uint, Steam.Item.EType> description;
|
||||
if (descriptions.TryGetValue(key, out description)) {
|
||||
if (descriptions.TryGetValue(steamItem.ClassID, out description)) {
|
||||
steamItem.RealAppID = description.Item1;
|
||||
steamItem.Type = description.Item2;
|
||||
}
|
||||
@@ -428,10 +422,8 @@ namespace ArchiSteamFarm {
|
||||
Amount = (uint) item["amount"].AsUnsignedLong()
|
||||
};
|
||||
|
||||
Tuple<ulong, ulong> key = new Tuple<ulong, ulong>(steamItem.ClassID, steamItem.InstanceID);
|
||||
|
||||
Tuple<uint, Steam.Item.EType> description;
|
||||
if (descriptions.TryGetValue(key, out description)) {
|
||||
if (descriptions.TryGetValue(steamItem.ClassID, out description)) {
|
||||
steamItem.RealAppID = description.Item1;
|
||||
steamItem.Type = description.Item2;
|
||||
}
|
||||
@@ -447,6 +439,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal async Task<bool> AcceptTradeOffer(ulong tradeID) {
|
||||
if (tradeID == 0) {
|
||||
Logging.LogNullError(nameof(tradeID), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -456,7 +449,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string sessionID = WebBrowser.CookieContainer.GetCookieValue(SteamCommunityURL, "sessionid");
|
||||
if (string.IsNullOrEmpty(sessionID)) {
|
||||
Logging.LogNullError("sessionID");
|
||||
Logging.LogNullError(nameof(sessionID), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -468,17 +461,7 @@ namespace ArchiSteamFarm {
|
||||
{ "tradeofferid", tradeID.ToString() }
|
||||
};
|
||||
|
||||
bool result = false;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && !result; i++) {
|
||||
result = await WebBrowser.UrlPost(request, data, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
return await WebBrowser.UrlPostRetry(request, data, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal async Task<HashSet<Steam.Item>> GetMyTradableInventory() {
|
||||
@@ -492,45 +475,31 @@ namespace ArchiSteamFarm {
|
||||
while (true) {
|
||||
string request = SteamCommunityURL + "/my/inventory/json/" + Steam.Item.SteamAppID + "/" + Steam.Item.SteamContextID + "?trading=1&start=" + nextPage;
|
||||
|
||||
JObject jObject = null;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && (jObject == null); i++) {
|
||||
jObject = await WebBrowser.UrlGetToJObject(request).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
JObject jObject = await WebBrowser.UrlGetToJObjectRetry(request).ConfigureAwait(false);
|
||||
if (jObject == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
IEnumerable<JToken> descriptions = jObject.SelectTokens("$.rgDescriptions.*");
|
||||
if (descriptions == null) {
|
||||
return null;
|
||||
return null; // OK, empty inventory
|
||||
}
|
||||
|
||||
Dictionary<Tuple<ulong, ulong>, Tuple<uint, Steam.Item.EType>> descriptionMap = new Dictionary<Tuple<ulong, ulong>, Tuple<uint, Steam.Item.EType>>();
|
||||
Dictionary<ulong, Tuple<uint, Steam.Item.EType>> descriptionMap = new Dictionary<ulong, Tuple<uint, Steam.Item.EType>>();
|
||||
foreach (JToken description in descriptions) {
|
||||
string classIDString = description["classid"].ToString();
|
||||
if (string.IsNullOrEmpty(classIDString)) {
|
||||
Logging.LogNullError(nameof(classIDString), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
ulong classID;
|
||||
if (!ulong.TryParse(classIDString, out classID) || (classID == 0)) {
|
||||
Logging.LogNullError(nameof(classID), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
string instanceIDString = description["instanceid"].ToString();
|
||||
if (string.IsNullOrEmpty(instanceIDString)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ulong instanceID;
|
||||
if (!ulong.TryParse(instanceIDString, out instanceID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Tuple<ulong, ulong> key = new Tuple<ulong, ulong>(classID, instanceID);
|
||||
if (descriptionMap.ContainsKey(key)) {
|
||||
if (descriptionMap.ContainsKey(classID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -547,11 +516,12 @@ namespace ArchiSteamFarm {
|
||||
type = GetItemType(descriptionType);
|
||||
}
|
||||
|
||||
descriptionMap[key] = new Tuple<uint, Steam.Item.EType>(appID, type);
|
||||
descriptionMap[classID] = new Tuple<uint, Steam.Item.EType>(appID, type);
|
||||
}
|
||||
|
||||
IEnumerable<JToken> items = jObject.SelectTokens("$.rgInventory.*");
|
||||
if (items == null) {
|
||||
Logging.LogNullError(nameof(items), Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -567,13 +537,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
if (steamItem == null) {
|
||||
Logging.LogNullError(nameof(steamItem), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
Tuple<ulong, ulong> key = new Tuple<ulong, ulong>(steamItem.ClassID, steamItem.InstanceID);
|
||||
|
||||
Tuple<uint, Steam.Item.EType> description;
|
||||
if (descriptionMap.TryGetValue(key, out description)) {
|
||||
if (descriptionMap.TryGetValue(steamItem.ClassID, out description)) {
|
||||
steamItem.RealAppID = description.Item1;
|
||||
steamItem.Type = description.Item2;
|
||||
}
|
||||
@@ -583,12 +552,15 @@ namespace ArchiSteamFarm {
|
||||
|
||||
bool more;
|
||||
if (!bool.TryParse(jObject["more"].ToString(), out more) || !more) {
|
||||
break;
|
||||
break; // OK, last page
|
||||
}
|
||||
|
||||
if (!ushort.TryParse(jObject["more_start"].ToString(), out nextPage)) {
|
||||
break;
|
||||
if (ushort.TryParse(jObject["more_start"].ToString(), out nextPage)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Logging.LogNullError(nameof(nextPage), Bot.BotName);
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -596,6 +568,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal async Task<bool> SendTradeOffer(HashSet<Steam.Item> inventory, ulong partnerID, string token = null) {
|
||||
if ((inventory == null) || (inventory.Count == 0) || (partnerID == 0)) {
|
||||
Logging.LogNullError(nameof(inventory) + " || " + nameof(inventory.Count) + " || " + nameof(partnerID), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -605,7 +578,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string sessionID = WebBrowser.CookieContainer.GetCookieValue(SteamCommunityURL, "sessionid");
|
||||
if (string.IsNullOrEmpty(sessionID)) {
|
||||
Logging.LogNullError("sessionID");
|
||||
Logging.LogNullError(nameof(sessionID), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -636,27 +609,17 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string referer = SteamCommunityURL + "/tradeoffer/new";
|
||||
string request = referer + "/send";
|
||||
foreach (Steam.TradeOfferRequest trade in trades) {
|
||||
Dictionary<string, string> data = new Dictionary<string, string>(6) {
|
||||
{ "sessionid", sessionID },
|
||||
{ "serverid", "1" },
|
||||
{ "partner", partnerID.ToString() },
|
||||
{ "tradeoffermessage", "Sent by ASF" },
|
||||
{ "json_tradeoffer", JsonConvert.SerializeObject(trade) },
|
||||
{ "trade_offer_create_params", string.IsNullOrEmpty(token) ? "" : $"{{\"trade_offer_access_token\":\"{token}\"}}" }
|
||||
};
|
||||
|
||||
bool result = false;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && !result; i++) {
|
||||
result = await WebBrowser.UrlPost(request, data, referer).ConfigureAwait(false);
|
||||
foreach (Dictionary<string, string> data in trades.Select(trade => new Dictionary<string, string>(6) {
|
||||
{ "sessionid", sessionID },
|
||||
{ "serverid", "1" },
|
||||
{ "partner", partnerID.ToString() },
|
||||
{ "tradeoffermessage", "Sent by ASF" },
|
||||
{ "json_tradeoffer", JsonConvert.SerializeObject(trade) },
|
||||
{ "trade_offer_create_params", string.IsNullOrEmpty(token) ? "" : $"{{\"trade_offer_access_token\":\"{token}\"}}" }
|
||||
})) {
|
||||
if (!await WebBrowser.UrlPostRetry(request, data, referer).ConfigureAwait(false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (result) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -664,6 +627,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal async Task<HtmlDocument> GetBadgePage(byte page) {
|
||||
if (page == 0) {
|
||||
Logging.LogNullError(nameof(page), Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -673,21 +637,12 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string request = SteamCommunityURL + "/my/badges?p=" + page;
|
||||
|
||||
HtmlDocument htmlDocument = null;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && (htmlDocument == null); i++) {
|
||||
htmlDocument = await WebBrowser.UrlGetToHtmlDocument(request).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (htmlDocument != null) {
|
||||
return htmlDocument;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
return await WebBrowser.UrlGetToHtmlDocumentRetry(request).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal async Task<HtmlDocument> GetGameCardsPage(ulong appID) {
|
||||
if (appID == 0) {
|
||||
Logging.LogNullError(nameof(appID), Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -697,17 +652,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string request = SteamCommunityURL + "/my/gamecards/" + appID;
|
||||
|
||||
HtmlDocument htmlDocument = null;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && (htmlDocument == null); i++) {
|
||||
htmlDocument = await WebBrowser.UrlGetToHtmlDocument(request).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (htmlDocument != null) {
|
||||
return htmlDocument;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
return await WebBrowser.UrlGetToHtmlDocumentRetry(request).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal async Task<bool> MarkInventory() {
|
||||
@@ -717,33 +662,20 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string request = SteamCommunityURL + "/my/inventory";
|
||||
|
||||
bool result = false;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && !result; i++) {
|
||||
result = await WebBrowser.UrlHead(request).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
return await WebBrowser.UrlHeadRetry(request).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<bool?> IsLoggedIn() {
|
||||
string request = SteamCommunityURL + "/my/profile";
|
||||
// It would make sense to use /my/profile here, but it dismisses notifications related to profile comments
|
||||
// So instead, we'll use some less intrusive link, such as /my/videos
|
||||
string request = SteamCommunityURL + "/my/videos";
|
||||
|
||||
Uri uri = null;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && (uri == null); i++) {
|
||||
uri = await WebBrowser.UrlHeadToUri(request).ConfigureAwait(false);
|
||||
Uri uri = await WebBrowser.UrlHeadToUriRetry(request).ConfigureAwait(false);
|
||||
if (uri == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (uri != null) {
|
||||
return !uri.AbsolutePath.StartsWith("/login", StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
return !uri.AbsolutePath.StartsWith("/login", StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private async Task<bool> RefreshSessionIfNeeded() {
|
||||
@@ -774,7 +706,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task<bool> UnlockParentalAccount(string parentalPin) {
|
||||
if (string.IsNullOrEmpty(parentalPin) || parentalPin.Equals("0")) {
|
||||
if (string.IsNullOrEmpty(parentalPin)) {
|
||||
Logging.LogNullError(nameof(parentalPin), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parentalPin.Equals("0")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -785,13 +722,9 @@ namespace ArchiSteamFarm {
|
||||
{ "pin", parentalPin }
|
||||
};
|
||||
|
||||
bool result = false;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && !result; i++) {
|
||||
result = await WebBrowser.UrlPost(request, data, SteamCommunityURL).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
bool result = await WebBrowser.UrlPostRetry(request, data, SteamCommunityURL).ConfigureAwait(false);
|
||||
if (!result) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
Logging.LogGenericInfo("Failed!", Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ using SteamKit2;
|
||||
using SteamKit2.Internal;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
@@ -67,8 +66,9 @@ namespace ArchiSteamFarm {
|
||||
private readonly Trading Trading;
|
||||
|
||||
internal bool KeepRunning { get; private set; }
|
||||
internal bool PlayingBlocked { get; private set; }
|
||||
|
||||
private bool InvalidPassword, LoggedInElsewhere, FirstTradeSent;
|
||||
private bool FirstTradeSent, InvalidPassword, SkipFirstShutdown;
|
||||
private string AuthCode, TwoFactorCode;
|
||||
|
||||
internal static async Task RefreshCMs(uint cellID) {
|
||||
@@ -92,14 +92,22 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private static bool IsOwner(ulong steamID) {
|
||||
if (steamID == 0) {
|
||||
return false;
|
||||
if (steamID != 0) {
|
||||
return steamID == Program.GlobalConfig.SteamOwnerID;
|
||||
}
|
||||
|
||||
return steamID == Program.GlobalConfig.SteamOwnerID;
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsValidCdKey(string key) => !string.IsNullOrEmpty(key) && Regex.IsMatch(key, @"[0-9A-Z]{4,5}-[0-9A-Z]{4,5}-[0-9A-Z]{4,5}-?(?:(?:[0-9A-Z]{4,5}-?)?(?:[0-9A-Z]{4,5}))?");
|
||||
private static bool IsValidCdKey(string key) {
|
||||
if (!string.IsNullOrEmpty(key)) {
|
||||
return Regex.IsMatch(key, @"[0-9A-Z]{4,5}-[0-9A-Z]{4,5}-[0-9A-Z]{4,5}-?(?:(?:[0-9A-Z]{4,5}-?)?(?:[0-9A-Z]{4,5}))?");
|
||||
}
|
||||
|
||||
Logging.LogNullError(nameof(key));
|
||||
return false;
|
||||
}
|
||||
|
||||
private static async Task LimitLoginRequestsAsync() {
|
||||
await LoginSemaphore.WaitAsync().ConfigureAwait(false);
|
||||
@@ -125,6 +133,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
if (!BotConfig.Enabled) {
|
||||
Logging.LogGenericInfo("Not starting this instance because it's disabled in config file", botName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -192,6 +201,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
CallbackManager.Subscribe<ArchiHandler.NotificationsCallback>(OnNotifications);
|
||||
CallbackManager.Subscribe<ArchiHandler.OfflineMessageCallback>(OnOfflineMessage);
|
||||
CallbackManager.Subscribe<ArchiHandler.PlayingSessionStateCallback>(OnPlayingSessionState);
|
||||
CallbackManager.Subscribe<ArchiHandler.PurchaseResponseCallback>(OnPurchaseResponse);
|
||||
|
||||
ArchiWebHandler = new ArchiWebHandler(this);
|
||||
@@ -277,14 +287,6 @@ namespace ArchiSteamFarm {
|
||||
return false;
|
||||
}
|
||||
|
||||
internal void ResetGamesPlayed() {
|
||||
if (!string.IsNullOrEmpty(BotConfig.CustomGamePlayedWhileIdle)) {
|
||||
ArchiHandler.PlayGame(BotConfig.CustomGamePlayedWhileIdle);
|
||||
} else {
|
||||
ArchiHandler.PlayGames(BotConfig.GamesPlayedWhileIdle);
|
||||
}
|
||||
}
|
||||
|
||||
internal async Task<bool> RefreshSession() {
|
||||
if (!SteamClient.IsConnected) {
|
||||
return false;
|
||||
@@ -320,17 +322,25 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
if (BotConfig.ShutdownOnFarmingFinished) {
|
||||
Stop();
|
||||
if (SkipFirstShutdown) {
|
||||
SkipFirstShutdown = false;
|
||||
} else {
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ResetGamesPlayed();
|
||||
}
|
||||
|
||||
internal async Task<string> Response(ulong steamID, string message) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(message), BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (message[0] != '!') {
|
||||
return await ResponseRedeem(steamID, message.Replace(",", Environment.NewLine), true).ConfigureAwait(false);
|
||||
return await ResponseRedeem(steamID, message, true).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (message.IndexOf(' ') < 0) {
|
||||
@@ -406,10 +416,10 @@ namespace ArchiSteamFarm {
|
||||
return await ResponsePlay(steamID, BotName, args[1]).ConfigureAwait(false);
|
||||
case "!redeem":
|
||||
if (args.Length > 2) {
|
||||
return await ResponseRedeem(steamID, args[1], args[2].Replace(",", Environment.NewLine), false).ConfigureAwait(false);
|
||||
return await ResponseRedeem(steamID, args[1], args[2], false).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return await ResponseRedeem(steamID, BotName, args[1].Replace(",", Environment.NewLine), false).ConfigureAwait(false);
|
||||
return await ResponseRedeem(steamID, BotName, args[1], false).ConfigureAwait(false);
|
||||
case "!start":
|
||||
return await ResponseStart(steamID, args[1]).ConfigureAwait(false);
|
||||
case "!status":
|
||||
@@ -448,11 +458,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private bool IsMaster(ulong steamID) {
|
||||
if (steamID == 0) {
|
||||
return false;
|
||||
if (steamID != 0) {
|
||||
return (steamID == BotConfig.SteamMasterID) || IsOwner(steamID);
|
||||
}
|
||||
|
||||
return (steamID == BotConfig.SteamMasterID) || IsOwner(steamID);
|
||||
Logging.LogNullError(nameof(steamID), BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
private void ImportAuthenticator(string maFilePath) {
|
||||
@@ -461,6 +472,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Converting SDA .maFile into ASF format...", BotName);
|
||||
|
||||
try {
|
||||
BotDatabase.SteamGuardAccount = JsonConvert.DeserializeObject<SteamGuardAccount>(File.ReadAllText(maFilePath));
|
||||
File.Delete(maFilePath);
|
||||
@@ -521,7 +533,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task<string> ResponsePause(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -536,6 +553,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static async Task<string> ResponsePause(ulong steamID, string botName) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -552,31 +570,37 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private string ResponseStatus(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (CardsFarmer.CurrentGamesFarming.Count > 0) {
|
||||
return "Bot " + BotName + " is farming appIDs: " + string.Join(", ", CardsFarmer.CurrentGamesFarming) + " and has a total of " + CardsFarmer.GamesToFarm.Count + " games left to farm.";
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected) {
|
||||
if (KeepRunning) {
|
||||
return "Bot " + BotName + " is not connected.";
|
||||
}
|
||||
|
||||
return "Bot " + BotName + " is not running.";
|
||||
}
|
||||
|
||||
if (CardsFarmer.ManualMode) {
|
||||
return "Bot " + BotName + " is running in manual mode.";
|
||||
}
|
||||
|
||||
if (SteamClient.IsConnected) {
|
||||
return "Bot " + BotName + " is not farming anything.";
|
||||
if (CardsFarmer.CurrentGamesFarming.Count > 0) {
|
||||
return "Bot " + BotName + " is farming appIDs: " + string.Join(", ", CardsFarmer.CurrentGamesFarming) + " and has a total of " + CardsFarmer.GamesToFarm.Count + " games left to farm.";
|
||||
}
|
||||
|
||||
if (KeepRunning) {
|
||||
return "Bot " + BotName + " is not connected.";
|
||||
}
|
||||
|
||||
return "Bot " + BotName + " is not running.";
|
||||
return "Bot " + BotName + " is not farming anything.";
|
||||
}
|
||||
|
||||
private static string ResponseStatus(ulong steamID, string botName) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -594,6 +618,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static string ResponseStatusAll(ulong steamID) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -616,7 +641,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task<string> ResponseSendTrade(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -649,6 +679,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static async Task<string> ResponseSendTrade(ulong steamID, string botName) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -665,7 +696,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private string Response2FA(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -679,6 +715,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static string Response2FA(ulong steamID, string botName) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -695,7 +732,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private string Response2FAOff(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -708,6 +750,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static string Response2FAOff(ulong steamID, string botName) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -724,7 +767,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task<string> Response2FAConfirm(ulong steamID, bool confirm) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -738,6 +786,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static async Task<string> Response2FAConfirm(ulong steamID, string botName, bool confirm) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -755,6 +804,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static string ResponseExit(ulong steamID) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -772,7 +822,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private string ResponseFarm(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -786,6 +841,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static string ResponseFarm(ulong steamID, string botName) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -802,7 +858,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private string ResponseHelp(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -810,10 +871,17 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task<string> ResponseRedeem(ulong steamID, string message, bool validate) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message) || !IsMaster(steamID)) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(message));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
message = message.Replace(",", Environment.NewLine);
|
||||
|
||||
StringBuilder response = new StringBuilder();
|
||||
using (StringReader reader = new StringReader(message))
|
||||
using (IEnumerator<Bot> iterator = Bots.Values.GetEnumerator()) {
|
||||
@@ -903,6 +971,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static async Task<string> ResponseRedeem(ulong steamID, string botName, string message, bool validate) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName) || string.IsNullOrEmpty(message)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName) + " || " + nameof(message));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -919,6 +988,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static string ResponseRejoinChat(ulong steamID) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -935,6 +1005,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static string ResponseRestart(ulong steamID) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -952,7 +1023,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task<string> ResponseAddLicense(ulong steamID, ICollection<uint> gameIDs) {
|
||||
if ((steamID == 0) || (gameIDs == null) || (gameIDs.Count == 0) || !SteamClient.IsConnected || !IsMaster(steamID)) {
|
||||
if ((steamID == 0) || (gameIDs == null) || (gameIDs.Count == 0)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(gameIDs) + " || " + nameof(gameIDs.Count));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected || !IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -971,6 +1047,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static async Task<string> ResponseAddLicense(ulong steamID, string botName, string games) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName) || string.IsNullOrEmpty(games)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName) + " || " + nameof(games));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1003,7 +1080,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task<string> ResponseOwns(ulong steamID, string query) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(query) || !IsMaster(steamID)) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(query)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(query));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1050,6 +1132,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static async Task<string> ResponseOwns(ulong steamID, string botName, string query) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName) || string.IsNullOrEmpty(query)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName) + " || " + nameof(query));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1066,7 +1149,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task<string> ResponsePlay(ulong steamID, HashSet<uint> gameIDs) {
|
||||
if ((steamID == 0) || (gameIDs == null) || (gameIDs.Count == 0) || !IsMaster(steamID)) {
|
||||
if ((steamID == 0) || (gameIDs == null) || (gameIDs.Count == 0)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(gameIDs) + " || " + nameof(gameIDs.Count));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1075,7 +1163,6 @@ namespace ArchiSteamFarm {
|
||||
return "Done!";
|
||||
}
|
||||
|
||||
ResetGamesPlayed();
|
||||
await CardsFarmer.SwitchToManualMode(false).ConfigureAwait(false);
|
||||
} else {
|
||||
if (!CardsFarmer.ManualMode) {
|
||||
@@ -1090,6 +1177,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static async Task<string> ResponsePlay(ulong steamID, string botName, string games) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName) || string.IsNullOrEmpty(games)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName) + " || " + nameof(games));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1122,7 +1210,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task<string> ResponseStart(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1130,12 +1223,14 @@ namespace ArchiSteamFarm {
|
||||
return "That bot instance is already running!";
|
||||
}
|
||||
|
||||
SkipFirstShutdown = true;
|
||||
await Start().ConfigureAwait(false);
|
||||
return "Done!";
|
||||
}
|
||||
|
||||
private static async Task<string> ResponseStart(ulong steamID, string botName) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1152,7 +1247,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private string ResponseStop(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1166,6 +1266,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static string ResponseStop(ulong steamID, string botName) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(botName));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1182,15 +1283,17 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private string ResponseUnknown(ulong steamID) {
|
||||
if ((steamID == 0) || !IsMaster(steamID)) {
|
||||
return null;
|
||||
if (steamID != 0) {
|
||||
return !IsMaster(steamID) ? null : "ERROR: Unknown command!";
|
||||
}
|
||||
|
||||
return "ERROR: Unknown command!";
|
||||
Logging.LogNullError(nameof(steamID), BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static async Task<string> ResponseUpdate(ulong steamID) {
|
||||
if (steamID == 0) {
|
||||
Logging.LogNullError(nameof(steamID));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1198,7 +1301,7 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
await Program.CheckForUpdate().ConfigureAwait(false);
|
||||
await Program.CheckForUpdate(true).ConfigureAwait(false);
|
||||
return "Done!";
|
||||
}
|
||||
|
||||
@@ -1215,14 +1318,21 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private async Task HandleMessage(ulong chatID, ulong steamID, string message) {
|
||||
if ((chatID == 0) || (steamID == 0) || string.IsNullOrEmpty(message)) {
|
||||
Logging.LogNullError(nameof(chatID) + " || " + nameof(steamID) + " || " + nameof(message), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessage(chatID, await Response(steamID, message).ConfigureAwait(false));
|
||||
string response = await Response(steamID, message).ConfigureAwait(false);
|
||||
if (string.IsNullOrEmpty(response)) { // We respond with null when user is not authorized (and similar)
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessage(chatID, response);
|
||||
}
|
||||
|
||||
private void SendMessage(ulong steamID, string message) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(message), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1234,7 +1344,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private void SendMessageToChannel(ulong steamID, string message) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message) || !SteamClient.IsConnected) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(message), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1245,7 +1360,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private void SendMessageToUser(ulong steamID, string message) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message) || !SteamClient.IsConnected) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(message), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1366,8 +1486,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(BotConfig.SteamPassword) ||
|
||||
(!requiresPassword && !string.IsNullOrEmpty(BotDatabase.LoginKey))) {
|
||||
if (!string.IsNullOrEmpty(BotConfig.SteamPassword) || (!requiresPassword && !string.IsNullOrEmpty(BotDatabase.LoginKey))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1375,8 +1494,21 @@ namespace ArchiSteamFarm {
|
||||
return !string.IsNullOrEmpty(BotConfig.SteamPassword);
|
||||
}
|
||||
|
||||
private void ResetGamesPlayed() {
|
||||
if (PlayingBlocked) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(BotConfig.CustomGamePlayedWhileIdle)) {
|
||||
ArchiHandler.PlayGame(BotConfig.CustomGamePlayedWhileIdle);
|
||||
} else {
|
||||
ArchiHandler.PlayGames(BotConfig.GamesPlayedWhileIdle);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnConnected(SteamClient.ConnectedCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1447,6 +1579,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private async void OnDisconnected(SteamClient.DisconnectedCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1469,16 +1602,6 @@ namespace ArchiSteamFarm {
|
||||
Logging.LogGenericInfo("Will retry after 25 minutes...", BotName);
|
||||
await Utilities.SleepAsync(25 * 60 * 1000).ConfigureAwait(false); // Captcha disappears after around 20 minutes, so we make it 25
|
||||
}
|
||||
} else if (LoggedInElsewhere) {
|
||||
LoggedInElsewhere = false;
|
||||
|
||||
if (Program.GlobalConfig.AccountPlayingDelay == 0) {
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Account is being used elsewhere, ASF will try to resume farming in " + Program.GlobalConfig.AccountPlayingDelay + " minutes...", BotName);
|
||||
await Utilities.SleepAsync(Program.GlobalConfig.AccountPlayingDelay * 60 * 1000).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (!KeepRunning || SteamClient.IsConnected) {
|
||||
@@ -1495,11 +1618,19 @@ namespace ArchiSteamFarm {
|
||||
SteamClient.Connect();
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBeMadeStatic.Local")]
|
||||
private void OnFreeLicense(SteamApps.FreeLicenseCallback callback) { }
|
||||
private void OnFreeLicense(SteamApps.FreeLicenseCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnGuestPassList(SteamApps.GuestPassListCallback callback) {
|
||||
if ((callback == null) || (callback.Result != EResult.OK) || (callback.CountGuestPassesToRedeem == 0) || (callback.GuestPasses.Count == 0) || !BotConfig.AcceptGifts) {
|
||||
if ((callback == null) || (callback.GuestPasses == null)) {
|
||||
Logging.LogNullError(nameof(callback) + " || " + nameof(callback.GuestPasses), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((callback.CountGuestPassesToRedeem == 0) || (callback.GuestPasses.Count == 0) || !BotConfig.AcceptGifts) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1520,7 +1651,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private void OnChatInvite(SteamFriends.ChatInviteCallback callback) {
|
||||
if ((callback == null) || !IsMaster(callback.PatronID)) {
|
||||
if ((callback == null) || (callback.ChatRoomID == null) || (callback.PatronID == null)) {
|
||||
Logging.LogNullError(nameof(callback) + " || " + nameof(callback.ChatRoomID) + " || " + nameof(callback.PatronID), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsMaster(callback.PatronID)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1528,7 +1664,17 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async void OnChatMsg(SteamFriends.ChatMsgCallback callback) {
|
||||
if ((callback == null) || (callback.ChatMsgType != EChatEntryType.ChatMsg)) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (callback.ChatMsgType != EChatEntryType.ChatMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((callback.ChatRoomID == null) || (callback.ChatterID == null) || string.IsNullOrEmpty(callback.Message)) {
|
||||
Logging.LogNullError(nameof(callback.ChatRoomID) + " || " + nameof(callback.ChatterID) + " || " + nameof(callback.Message), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1547,7 +1693,8 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private void OnFriendsList(SteamFriends.FriendsListCallback callback) {
|
||||
if (callback == null) {
|
||||
if ((callback == null) || (callback.FriendList == null)) {
|
||||
Logging.LogNullError(nameof(callback) + " || " + nameof(callback.FriendList), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1568,7 +1715,17 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async void OnFriendMsg(SteamFriends.FriendMsgCallback callback) {
|
||||
if ((callback == null) || (callback.EntryType != EChatEntryType.ChatMsg)) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (callback.EntryType != EChatEntryType.ChatMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((callback.Sender == null) || string.IsNullOrEmpty(callback.Message)) {
|
||||
Logging.LogNullError(nameof(callback.Sender) + " || " + nameof(callback.Message), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1576,7 +1733,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async void OnFriendMsgHistory(SteamFriends.FriendMsgHistoryCallback callback) {
|
||||
if ((callback == null) || (callback.Result != EResult.OK) || (callback.Messages.Count == 0) || !IsMaster(callback.SteamID)) {
|
||||
if ((callback == null) || (callback.Messages == null) || (callback.SteamID == null)) {
|
||||
Logging.LogNullError(nameof(callback) + " || " + nameof(callback.Messages) + " || " + nameof(callback.SteamID), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((callback.Messages.Count == 0) || !IsMaster(callback.SteamID)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1599,6 +1761,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private void OnAccountInfo(SteamUser.AccountInfoCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1609,22 +1772,16 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private void OnLoggedOff(SteamUser.LoggedOffCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Logged off of Steam: " + callback.Result, BotName);
|
||||
|
||||
switch (callback.Result) {
|
||||
case EResult.AlreadyLoggedInElsewhere:
|
||||
case EResult.LoggedInElsewhere:
|
||||
case EResult.LogonSessionReplaced:
|
||||
LoggedInElsewhere = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnLoggedOn(SteamUser.LoggedOnCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1654,6 +1811,8 @@ namespace ArchiSteamFarm {
|
||||
case EResult.OK:
|
||||
Logging.LogGenericInfo("Successfully logged on!", BotName);
|
||||
|
||||
PlayingBlocked = false; // If playing is really blocked, we'll be notified in a callback, old status doesn't matter
|
||||
|
||||
if (callback.CellID != 0) {
|
||||
Program.GlobalDatabase.CellID = callback.CellID;
|
||||
}
|
||||
@@ -1671,8 +1830,6 @@ namespace ArchiSteamFarm {
|
||||
// Reset one-time-only access tokens
|
||||
AuthCode = TwoFactorCode = null;
|
||||
|
||||
ResetGamesPlayed();
|
||||
|
||||
if (string.IsNullOrEmpty(BotConfig.SteamParentalPIN)) {
|
||||
BotConfig.SteamParentalPIN = Program.GetUserInput(Program.EUserInputType.SteamParentalPIN, BotName);
|
||||
if (string.IsNullOrEmpty(BotConfig.SteamParentalPIN)) {
|
||||
@@ -1707,6 +1864,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
Task.Run(() => Trading.CheckTrades()).Forget();
|
||||
|
||||
await Utilities.SleepAsync(1000).ConfigureAwait(false); // Wait a second for eventual PlayingSessionStateCallback
|
||||
CardsFarmer.StartFarming().Forget();
|
||||
break;
|
||||
case EResult.NoConnection:
|
||||
@@ -1723,7 +1881,8 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private void OnLoginKey(SteamUser.LoginKeyCallback callback) {
|
||||
if (callback == null) {
|
||||
if ((callback == null) || string.IsNullOrEmpty(callback.LoginKey)) {
|
||||
Logging.LogNullError(nameof(callback) + " || " + nameof(callback.LoginKey), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1733,21 +1892,27 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private void OnMachineAuth(SteamUser.UpdateMachineAuthCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
int fileSize;
|
||||
byte[] sentryHash;
|
||||
|
||||
using (FileStream fileStream = File.Open(SentryFile, FileMode.OpenOrCreate, FileAccess.ReadWrite)) {
|
||||
fileStream.Seek(callback.Offset, SeekOrigin.Begin);
|
||||
fileStream.Write(callback.Data, 0, callback.BytesToWrite);
|
||||
fileSize = (int) fileStream.Length;
|
||||
try {
|
||||
using (FileStream fileStream = File.Open(SentryFile, FileMode.OpenOrCreate, FileAccess.ReadWrite)) {
|
||||
fileStream.Seek(callback.Offset, SeekOrigin.Begin);
|
||||
fileStream.Write(callback.Data, 0, callback.BytesToWrite);
|
||||
fileSize = (int) fileStream.Length;
|
||||
|
||||
fileStream.Seek(0, SeekOrigin.Begin);
|
||||
using (SHA1CryptoServiceProvider sha = new SHA1CryptoServiceProvider()) {
|
||||
sentryHash = sha.ComputeHash(fileStream);
|
||||
fileStream.Seek(0, SeekOrigin.Begin);
|
||||
using (SHA1CryptoServiceProvider sha = new SHA1CryptoServiceProvider()) {
|
||||
sentryHash = sha.ComputeHash(fileStream);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e, BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
// Inform the steam servers that we're accepting this sentry file
|
||||
@@ -1764,11 +1929,19 @@ namespace ArchiSteamFarm {
|
||||
});
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBeMadeStatic.Local")]
|
||||
private void OnWebAPIUserNonce(SteamUser.WebAPIUserNonceCallback callback) { }
|
||||
private void OnWebAPIUserNonce(SteamUser.WebAPIUserNonceCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnNotifications(ArchiHandler.NotificationsCallback callback) {
|
||||
if ((callback == null) || (callback.Notifications == null)) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((callback.Notifications == null) || (callback.Notifications.Count == 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1795,19 +1968,41 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private void OnOfflineMessage(ArchiHandler.OfflineMessageCallback callback) {
|
||||
if ((callback == null) || (callback.OfflineMessagesCount == 0)) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!BotConfig.HandleOfflineMessages) {
|
||||
if ((callback.OfflineMessagesCount == 0) || !BotConfig.HandleOfflineMessages) {
|
||||
return;
|
||||
}
|
||||
|
||||
SteamFriends.RequestOfflineMessages();
|
||||
}
|
||||
|
||||
private void OnPlayingSessionState(ArchiHandler.PlayingSessionStateCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback));
|
||||
return;
|
||||
}
|
||||
|
||||
if (callback.PlayingBlocked == PlayingBlocked) {
|
||||
return; // No status update, we're not interested
|
||||
}
|
||||
|
||||
if (callback.PlayingBlocked) {
|
||||
PlayingBlocked = true;
|
||||
Logging.LogGenericInfo("Account is currently being used, ASF will resume farming when it's free...", BotName);
|
||||
} else {
|
||||
PlayingBlocked = false;
|
||||
Logging.LogGenericInfo("Account is no longer occupied, farming process resumed!", BotName);
|
||||
CardsFarmer.StartFarming().Forget();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPurchaseResponse(ArchiHandler.PurchaseResponseCallback callback) {
|
||||
if (callback == null) {
|
||||
Logging.LogNullError(nameof(callback), BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,11 +105,17 @@ namespace ArchiSteamFarm {
|
||||
|
||||
|
||||
internal static BotConfig Load(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath)) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
Logging.LogNullError(nameof(filePath));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!File.Exists(filePath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
BotConfig botConfig;
|
||||
|
||||
try {
|
||||
botConfig = JsonConvert.DeserializeObject<BotConfig>(File.ReadAllText(filePath));
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal static BotDatabase Load(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
Logging.LogNullError(nameof(filePath));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -76,6 +77,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
BotDatabase botDatabase;
|
||||
|
||||
try {
|
||||
botDatabase = JsonConvert.DeserializeObject<BotDatabase>(File.ReadAllText(filePath));
|
||||
} catch (Exception e) {
|
||||
@@ -84,6 +86,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
if (botDatabase == null) {
|
||||
Logging.LogNullError(nameof(botDatabase));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,13 +80,13 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
internal async Task StartFarming() {
|
||||
if (NowFarming || ManualMode) {
|
||||
if (NowFarming || ManualMode || Bot.PlayingBlocked) {
|
||||
return;
|
||||
}
|
||||
|
||||
await FarmingSemaphore.WaitAsync().ConfigureAwait(false);
|
||||
|
||||
if (NowFarming || ManualMode) {
|
||||
if (NowFarming || ManualMode || Bot.PlayingBlocked) {
|
||||
FarmingSemaphore.Release(); // We have nothing to do, don't forget to release semaphore
|
||||
return;
|
||||
}
|
||||
@@ -99,6 +99,14 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("We have a total of " + GamesToFarm.Count + " games to farm on this account...", Bot.BotName);
|
||||
|
||||
// This is the last moment for final check if we can farm
|
||||
if (Bot.PlayingBlocked) {
|
||||
Logging.LogGenericInfo("But account is currently occupied, so farming is stopped!");
|
||||
FarmingSemaphore.Release(); // We have nothing to do, don't forget to release semaphore
|
||||
return;
|
||||
}
|
||||
|
||||
NowFarming = true;
|
||||
FarmingSemaphore.Release(); // From this point we allow other calls to shut us down
|
||||
|
||||
@@ -185,6 +193,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static HashSet<uint> GetGamesToFarmSolo(ConcurrentDictionary<uint, float> gamesToFarm) {
|
||||
if (gamesToFarm == null) {
|
||||
Logging.LogNullError(nameof(gamesToFarm));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -241,11 +250,13 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private void CheckPage(HtmlDocument htmlDocument) {
|
||||
if (htmlDocument == null) {
|
||||
Logging.LogNullError(nameof(htmlDocument), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
HtmlNodeCollection htmlNodes = htmlDocument.DocumentNode.SelectNodes("//div[@class='badge_title_stats']");
|
||||
if (htmlNodes == null) {
|
||||
Logging.LogNullError(nameof(htmlNodes), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -257,32 +268,27 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string steamLink = farmingNode.GetAttributeValue("href", null);
|
||||
if (string.IsNullOrEmpty(steamLink)) {
|
||||
Logging.LogNullError("steamLink", Bot.BotName);
|
||||
Logging.LogNullError(nameof(steamLink), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
int index = steamLink.LastIndexOf('/');
|
||||
if (index < 0) {
|
||||
Logging.LogNullError("index", Bot.BotName);
|
||||
Logging.LogNullError(nameof(index), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
index++;
|
||||
if (steamLink.Length <= index) {
|
||||
Logging.LogNullError("length", Bot.BotName);
|
||||
Logging.LogNullError(nameof(steamLink.Length), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
steamLink = steamLink.Substring(index);
|
||||
|
||||
uint appID;
|
||||
if (!uint.TryParse(steamLink, out appID)) {
|
||||
Logging.LogNullError("appID", Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (appID == 0) {
|
||||
Logging.LogNullError("appID", Bot.BotName);
|
||||
if (!uint.TryParse(steamLink, out appID) || (appID == 0)) {
|
||||
Logging.LogNullError(nameof(appID), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -292,13 +298,13 @@ namespace ArchiSteamFarm {
|
||||
|
||||
HtmlNode timeNode = htmlNode.SelectSingleNode(".//div[@class='badge_title_stats_playtime']");
|
||||
if (timeNode == null) {
|
||||
Logging.LogNullError("timeNode", Bot.BotName);
|
||||
Logging.LogNullError(nameof(timeNode), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
string hoursString = timeNode.InnerText;
|
||||
if (string.IsNullOrEmpty(hoursString)) {
|
||||
Logging.LogNullError("hoursString", Bot.BotName);
|
||||
Logging.LogNullError(nameof(hoursString), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -306,7 +312,10 @@ namespace ArchiSteamFarm {
|
||||
|
||||
Match match = Regex.Match(hoursString, @"[0-9\.,]+");
|
||||
if (match.Success) {
|
||||
float.TryParse(match.Value, NumberStyles.Number, CultureInfo.InvariantCulture, out hours);
|
||||
if (!float.TryParse(match.Value, NumberStyles.Number, CultureInfo.InvariantCulture, out hours)) {
|
||||
Logging.LogNullError(nameof(hours), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
GamesToFarm[appID] = hours;
|
||||
@@ -315,6 +324,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private async Task CheckPage(byte page) {
|
||||
if (page == 0) {
|
||||
Logging.LogNullError(nameof(page), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -336,6 +346,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private async Task<bool?> ShouldFarm(uint appID) {
|
||||
if (appID == 0) {
|
||||
Logging.LogNullError(nameof(appID), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -345,11 +356,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
HtmlNode htmlNode = htmlDocument.DocumentNode.SelectSingleNode("//span[@class='progress_info_bold']");
|
||||
if (htmlNode == null) {
|
||||
return null;
|
||||
if (htmlNode != null) {
|
||||
return !htmlNode.InnerText.Contains("No card drops");
|
||||
}
|
||||
|
||||
return !htmlNode.InnerText.Contains("No card drops");
|
||||
Logging.LogNullError(nameof(htmlNode), Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
private bool FarmMultiple() {
|
||||
@@ -379,6 +391,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private async Task<bool> FarmSolo(uint appID) {
|
||||
if (appID == 0) {
|
||||
Logging.LogNullError(nameof(appID), Bot.BotName);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -405,6 +418,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private async Task<bool> Farm(uint appID) {
|
||||
if (appID == 0) {
|
||||
Logging.LogNullError(nameof(appID), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -427,13 +441,13 @@ namespace ArchiSteamFarm {
|
||||
Logging.LogGenericInfo("Still farming: " + appID, Bot.BotName);
|
||||
}
|
||||
|
||||
Bot.ResetGamesPlayed();
|
||||
Logging.LogGenericInfo("Stopped farming: " + appID, Bot.BotName);
|
||||
return success;
|
||||
}
|
||||
|
||||
private bool FarmHours(float maxHour, ConcurrentHashSet<uint> appIDs) {
|
||||
if ((maxHour < 0) || (appIDs == null) || (appIDs.Count == 0)) {
|
||||
Logging.LogNullError(nameof(maxHour) + " || " + nameof(appIDs) + " || " + nameof(appIDs.Count), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -460,7 +474,6 @@ namespace ArchiSteamFarm {
|
||||
Logging.LogGenericInfo("Still farming: " + string.Join(", ", appIDs), Bot.BotName);
|
||||
}
|
||||
|
||||
Bot.ResetGamesPlayed();
|
||||
Logging.LogGenericInfo("Stopped farming: " + string.Join(", ", appIDs), Bot.BotName);
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal DebugListener(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
return;
|
||||
throw new ArgumentNullException(nameof(filePath));
|
||||
}
|
||||
|
||||
FilePath = filePath;
|
||||
|
||||
@@ -79,9 +79,6 @@ namespace ArchiSteamFarm {
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal byte FarmingDelay { get; private set; } = DefaultFarmingDelay;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal byte AccountPlayingDelay { get; private set; } = 5;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal byte LoginLimiterDelay { get; private set; } = 7;
|
||||
|
||||
@@ -115,6 +112,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal static GlobalConfig Load(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
Logging.LogNullError(nameof(filePath));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -123,6 +121,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
GlobalConfig globalConfig;
|
||||
|
||||
try {
|
||||
globalConfig = JsonConvert.DeserializeObject<GlobalConfig>(File.ReadAllText(filePath));
|
||||
} catch (Exception e) {
|
||||
@@ -131,6 +130,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
if (globalConfig == null) {
|
||||
Logging.LogNullError(nameof(globalConfig));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal static GlobalDatabase Load(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
Logging.LogNullError(nameof(filePath));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -58,6 +59,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
GlobalDatabase globalDatabase;
|
||||
|
||||
try {
|
||||
globalDatabase = JsonConvert.DeserializeObject<GlobalDatabase>(File.ReadAllText(filePath));
|
||||
} catch (Exception e) {
|
||||
@@ -66,6 +68,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
if (globalDatabase == null) {
|
||||
Logging.LogNullError(nameof(globalDatabase));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal static void LogGenericWTF(string message, string botName = "Main", [CallerMemberName] string previousMethodName = null) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message), botName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,6 +66,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal static void LogGenericError(string message, string botName = "Main", [CallerMemberName] string previousMethodName = null) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message), botName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,6 +76,7 @@ namespace ArchiSteamFarm {
|
||||
internal static void LogGenericException(Exception exception, string botName = "Main", [CallerMemberName] string previousMethodName = null) {
|
||||
while (true) {
|
||||
if (exception == null) {
|
||||
LogNullError(nameof(exception), botName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -91,6 +94,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal static void LogGenericWarning(string message, string botName = "Main", [CallerMemberName] string previousMethodName = null) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message), botName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -99,6 +103,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal static void LogGenericInfo(string message, string botName = "Main", [CallerMemberName] string previousMethodName = null) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message), botName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -107,16 +112,21 @@ namespace ArchiSteamFarm {
|
||||
|
||||
[SuppressMessage("ReSharper", "ExplicitCallerInfoArgument")]
|
||||
internal static void LogNullError(string nullObjectName, string botName = "Main", [CallerMemberName] string previousMethodName = null) {
|
||||
if (string.IsNullOrEmpty(nullObjectName)) {
|
||||
return;
|
||||
}
|
||||
while (true) {
|
||||
if (string.IsNullOrEmpty(nullObjectName)) {
|
||||
nullObjectName = nameof(nullObjectName);
|
||||
continue;
|
||||
}
|
||||
|
||||
LogGenericError(nullObjectName + " is null!", botName, previousMethodName);
|
||||
LogGenericError(nullObjectName + " is null!", botName, previousMethodName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[Conditional("DEBUG"), SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
internal static void LogGenericDebug(string message, string botName = "Main", [CallerMemberName] string previousMethodName = null) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message), botName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -125,6 +135,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static void Log(string message) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -134,8 +145,7 @@ namespace ArchiSteamFarm {
|
||||
if (!Program.ConsoleIsBusy) {
|
||||
try {
|
||||
Console.Write(loggedMessage);
|
||||
}
|
||||
catch {
|
||||
} catch {
|
||||
// Ignored
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace ArchiSteamFarm {
|
||||
private static EMode Mode = EMode.Normal;
|
||||
private static WebBrowser WebBrowser;
|
||||
|
||||
internal static async Task CheckForUpdate() {
|
||||
internal static async Task CheckForUpdate(bool updateOverride = false) {
|
||||
string oldExeFile = ExecutableFile + ".old";
|
||||
|
||||
// We booted successfully so we can now remove old exe file
|
||||
@@ -110,12 +110,9 @@ namespace ArchiSteamFarm {
|
||||
releaseURL += "/latest";
|
||||
}
|
||||
|
||||
string response = null;
|
||||
Logging.LogGenericInfo("Checking new version...");
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && string.IsNullOrEmpty(response); i++) {
|
||||
response = await WebBrowser.UrlGetToContent(releaseURL).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
string response = await WebBrowser.UrlGetToContentRetry(releaseURL).ConfigureAwait(false);
|
||||
if (string.IsNullOrEmpty(response)) {
|
||||
Logging.LogGenericWarning("Could not check latest version!");
|
||||
return;
|
||||
@@ -172,7 +169,7 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GlobalConfig.AutoUpdates) {
|
||||
if (!updateOverride && !GlobalConfig.AutoUpdates) {
|
||||
Logging.LogGenericInfo("New version is available!");
|
||||
Logging.LogGenericInfo("Consider updating yourself!");
|
||||
await Utilities.SleepAsync(5000).ConfigureAwait(false);
|
||||
@@ -202,14 +199,8 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
byte[] result = null;
|
||||
for (byte i = 0; (i < WebBrowser.MaxRetries) && (result == null); i++) {
|
||||
Logging.LogGenericInfo("Downloading new version...");
|
||||
result = await WebBrowser.UrlGetToBytes(binaryAsset.DownloadURL).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
byte[] result = await WebBrowser.UrlGetToBytesRetry(binaryAsset.DownloadURL).ConfigureAwait(false);
|
||||
if (result == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -280,7 +271,7 @@ namespace ArchiSteamFarm {
|
||||
Exit();
|
||||
}
|
||||
|
||||
internal static string GetUserInput(EUserInputType userInputType, string botName = null, string extraInformation = null) {
|
||||
internal static string GetUserInput(EUserInputType userInputType, string botName = "Main", string extraInformation = null) {
|
||||
if (userInputType == EUserInputType.Unknown) {
|
||||
return null;
|
||||
}
|
||||
@@ -295,49 +286,51 @@ namespace ArchiSteamFarm {
|
||||
ConsoleIsBusy = true;
|
||||
switch (userInputType) {
|
||||
case EUserInputType.DeviceID:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter your Device ID (including \"android:\"): ");
|
||||
Console.Write("<" + botName + "> Please enter your Device ID (including \"android:\"): ");
|
||||
break;
|
||||
case EUserInputType.Login:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter your login: ");
|
||||
Console.Write("<" + botName + "> Please enter your login: ");
|
||||
break;
|
||||
case EUserInputType.Password:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter your password: ");
|
||||
Console.Write("<" + botName + "> Please enter your password: ");
|
||||
break;
|
||||
case EUserInputType.PhoneNumber:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter your full phone number (e.g. +1234567890): ");
|
||||
Console.Write("<" + botName + "> Please enter your full phone number (e.g. +1234567890): ");
|
||||
break;
|
||||
case EUserInputType.SMS:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter SMS code sent on your mobile: ");
|
||||
Console.Write("<" + botName + "> Please enter SMS code sent on your mobile: ");
|
||||
break;
|
||||
case EUserInputType.SteamGuard:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter the auth code sent to your email: ");
|
||||
Console.Write("<" + botName + "> Please enter the auth code sent to your email: ");
|
||||
break;
|
||||
case EUserInputType.SteamParentalPIN:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter steam parental PIN: ");
|
||||
Console.Write("<" + botName + "> Please enter steam parental PIN: ");
|
||||
break;
|
||||
case EUserInputType.RevocationCode:
|
||||
Console.WriteLine((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "PLEASE WRITE DOWN YOUR REVOCATION CODE: " + extraInformation);
|
||||
Console.Write("Hit enter once ready...");
|
||||
Console.WriteLine("<" + botName + "> PLEASE WRITE DOWN YOUR REVOCATION CODE: " + extraInformation);
|
||||
Console.Write("<" + botName + "> Hit enter once ready...");
|
||||
break;
|
||||
case EUserInputType.TwoFactorAuthentication:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter your 2 factor auth code from your authenticator app: ");
|
||||
Console.Write("<" + botName + "> Please enter your 2 factor auth code from your authenticator app: ");
|
||||
break;
|
||||
case EUserInputType.WCFHostname:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter your WCF hostname: ");
|
||||
Console.Write("<" + botName + "> Please enter your WCF hostname: ");
|
||||
break;
|
||||
default:
|
||||
Console.Write((string.IsNullOrEmpty(botName) ? "" : "<" + botName + "> ") + "Please enter not documented yet value of \"" + userInputType + "\": ");
|
||||
Console.Write("<" + botName + "> Please enter not documented yet value of \"" + userInputType + "\": ");
|
||||
break;
|
||||
}
|
||||
|
||||
result = Console.ReadLine();
|
||||
|
||||
if (!Console.IsOutputRedirected) {
|
||||
Console.Clear(); // For security purposes
|
||||
}
|
||||
|
||||
ConsoleIsBusy = false;
|
||||
}
|
||||
|
||||
return string.IsNullOrEmpty(result) ? null : result.Trim();
|
||||
return !string.IsNullOrEmpty(result) ? result.Trim() : null;
|
||||
}
|
||||
|
||||
internal static void OnBotShutdown() {
|
||||
@@ -378,11 +371,14 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static void ParseArgs(IEnumerable<string> args) {
|
||||
if (args == null) {
|
||||
Logging.LogNullError(nameof(args));
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string arg in args) {
|
||||
switch (arg) {
|
||||
case "":
|
||||
break;
|
||||
case "--client":
|
||||
Mode = EMode.Client;
|
||||
break;
|
||||
@@ -416,7 +412,8 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs args) {
|
||||
if ((sender == null) || (args == null)) {
|
||||
if ((sender == null) || (args == null) || (args.ExceptionObject == null)) {
|
||||
Logging.LogNullError(nameof(sender) + " || " + nameof(args) + " || " + nameof(args.ExceptionObject));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -424,7 +421,8 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private static void UnobservedTaskExceptionHandler(object sender, UnobservedTaskExceptionEventArgs args) {
|
||||
if ((sender == null) || (args == null)) {
|
||||
if ((sender == null) || (args == null) || (args.Exception == null)) {
|
||||
Logging.LogNullError(nameof(sender) + " || " + nameof(args) + " || " + nameof(args.Exception));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -469,7 +467,9 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
// Parse args
|
||||
ParseArgs(args);
|
||||
if (args != null) {
|
||||
ParseArgs(args);
|
||||
}
|
||||
|
||||
// If we ran ASF as a client, we're done by now
|
||||
if (Mode == EMode.Client) {
|
||||
@@ -501,12 +501,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
Bot bot = new Bot(botName);
|
||||
if ((bot.BotConfig != null) && bot.BotConfig.Enabled) {
|
||||
if (bot.BotConfig.StartOnLaunch) {
|
||||
isRunning = true;
|
||||
}
|
||||
} else {
|
||||
Logging.LogGenericInfo("Not starting this instance because it's disabled in config file", botName);
|
||||
if ((bot.BotConfig == null) || !bot.BotConfig.Enabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bot.BotConfig.StartOnLaunch) {
|
||||
isRunning = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.0.4.6")]
|
||||
[assembly: AssemblyFileVersion("2.0.4.6")]
|
||||
[assembly: AssemblyVersion("2.0.5.0")]
|
||||
[assembly: AssemblyFileVersion("2.0.5.0")]
|
||||
|
||||
@@ -83,12 +83,24 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
tradeOffers.RemoveWhere(tradeoffer => tradeoffer.State != Steam.TradeOffer.ETradeOfferState.Active);
|
||||
tradeOffers.TrimExcess();
|
||||
|
||||
if (tradeOffers.Count == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
await tradeOffers.ForEachAsync(ParseTrade).ConfigureAwait(false);
|
||||
await Bot.AcceptConfirmations(true, Confirmation.ConfirmationType.Trade).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task ParseTrade(Steam.TradeOffer tradeOffer) {
|
||||
if ((tradeOffer == null) || (tradeOffer.State != Steam.TradeOffer.ETradeOfferState.Active)) {
|
||||
if (tradeOffer == null) {
|
||||
Logging.LogNullError(nameof(tradeOffer), Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tradeOffer.State != Steam.TradeOffer.ETradeOfferState.Active) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -102,6 +114,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private async Task<bool> ShouldAcceptTrade(Steam.TradeOffer tradeOffer) {
|
||||
if (tradeOffer == null) {
|
||||
Logging.LogNullError(nameof(tradeOffer), Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -139,10 +152,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
// Get appIDs we're interested in
|
||||
HashSet<uint> appIDs = new HashSet<uint>();
|
||||
foreach (Steam.Item item in tradeOffer.ItemsToGive) {
|
||||
appIDs.Add(item.RealAppID);
|
||||
}
|
||||
HashSet<uint> appIDs = new HashSet<uint>(tradeOffer.ItemsToGive.Select(item => item.RealAppID));
|
||||
|
||||
// Now remove from our inventory all items we're NOT interested in
|
||||
inventory.RemoveWhere(item => !appIDs.Contains(item.RealAppID));
|
||||
@@ -154,21 +164,19 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
// Now let's create a map which maps items to their amount in our EQ
|
||||
Dictionary<Tuple<ulong, ulong>, uint> amountMap = new Dictionary<Tuple<ulong, ulong>, uint>();
|
||||
Dictionary<ulong, uint> amountMap = new Dictionary<ulong, uint>();
|
||||
foreach (Steam.Item item in inventory) {
|
||||
Tuple<ulong, ulong> key = new Tuple<ulong, ulong>(item.ClassID, item.InstanceID);
|
||||
|
||||
uint amount;
|
||||
if (amountMap.TryGetValue(key, out amount)) {
|
||||
amountMap[key] = amount + item.Amount;
|
||||
if (amountMap.TryGetValue(item.ClassID, out amount)) {
|
||||
amountMap[item.ClassID] = amount + item.Amount;
|
||||
} else {
|
||||
amountMap[key] = item.Amount;
|
||||
amountMap[item.ClassID] = item.Amount;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate our value of items to give
|
||||
List<uint> amountsToGive = new List<uint>(tradeOffer.ItemsToGive.Count);
|
||||
foreach (Tuple<ulong, ulong> key in tradeOffer.ItemsToGive.Select(item => new Tuple<ulong, ulong>(item.ClassID, item.InstanceID))) {
|
||||
foreach (ulong key in tradeOffer.ItemsToGive.Select(item => item.ClassID)) {
|
||||
uint amount;
|
||||
if (!amountMap.TryGetValue(key, out amount)) {
|
||||
amountsToGive.Add(0);
|
||||
@@ -183,7 +191,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
// Calculate our value of items to receive
|
||||
List<uint> amountsToReceive = new List<uint>(tradeOffer.ItemsToReceive.Count);
|
||||
foreach (Tuple<ulong, ulong> key in tradeOffer.ItemsToReceive.Select(item => new Tuple<ulong, ulong>(item.ClassID, item.InstanceID))) {
|
||||
foreach (ulong key in tradeOffer.ItemsToReceive.Select(item => item.ClassID)) {
|
||||
uint amount;
|
||||
if (!amountMap.TryGetValue(key, out amount)) {
|
||||
amountsToReceive.Add(0);
|
||||
|
||||
@@ -34,17 +34,41 @@ namespace ArchiSteamFarm {
|
||||
[SuppressMessage("ReSharper", "UnusedParameter.Global")]
|
||||
internal static void Forget(this Task task) { }
|
||||
|
||||
internal static Task ForEachAsync<T>(this IEnumerable<T> sequence, Func<T, Task> action) => action == null ? Task.FromResult(true) : Task.WhenAll(sequence.Select(action));
|
||||
internal static Task ForEachAsync<T>(this IEnumerable<T> sequence, Func<T, Task> action) {
|
||||
if (action != null) {
|
||||
return Task.WhenAll(sequence.Select(action));
|
||||
}
|
||||
|
||||
Logging.LogNullError(nameof(action));
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
internal static string GetCookieValue(this CookieContainer cookieContainer, string url, string name) {
|
||||
if (string.IsNullOrEmpty(url) || string.IsNullOrEmpty(name)) {
|
||||
Logging.LogNullError(nameof(url) + " || " + nameof(name));
|
||||
return null;
|
||||
}
|
||||
|
||||
CookieCollection cookies = cookieContainer.GetCookies(new Uri(url));
|
||||
return cookies.Count == 0 ? null : (from Cookie cookie in cookies where cookie.Name.Equals(name, StringComparison.Ordinal) select cookie.Value).FirstOrDefault();
|
||||
Uri uri;
|
||||
|
||||
try {
|
||||
uri = new Uri(url);
|
||||
} catch (UriFormatException e) {
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
CookieCollection cookies = cookieContainer.GetCookies(uri);
|
||||
return cookies.Count == 0 ? null : (from Cookie cookie in cookies where cookie.Name.Equals(name) select cookie.Value).FirstOrDefault();
|
||||
}
|
||||
|
||||
internal static Task SleepAsync(int miliseconds) => miliseconds < 0 ? Task.FromResult(true) : Task.Delay(miliseconds);
|
||||
internal static Task SleepAsync(int miliseconds) {
|
||||
if (miliseconds >= 0) {
|
||||
return Task.Delay(miliseconds);
|
||||
}
|
||||
|
||||
Logging.LogNullError(nameof(miliseconds));
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,11 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
internal string SendCommand(string input) {
|
||||
if (string.IsNullOrEmpty(input)) {
|
||||
Logging.LogNullError(nameof(input));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Client == null) {
|
||||
Client = new Client(new BasicHttpBinding(), new EndpointAddress(URL));
|
||||
}
|
||||
@@ -96,6 +101,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
public string HandleCommand(string input) {
|
||||
if (string.IsNullOrEmpty(input)) {
|
||||
Logging.LogNullError(nameof(input));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -120,6 +126,11 @@ namespace ArchiSteamFarm {
|
||||
internal Client(Binding binding, EndpointAddress address) : base(binding, address) { }
|
||||
|
||||
public string HandleCommand(string input) {
|
||||
if (string.IsNullOrEmpty(input)) {
|
||||
Logging.LogNullError(nameof(input));
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return Channel.HandleCommand(input);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -82,42 +82,161 @@ namespace ArchiSteamFarm {
|
||||
HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd(DefaultUserAgent);
|
||||
}
|
||||
|
||||
internal async Task<bool> UrlHead(string request, string referer = null) {
|
||||
internal async Task<bool> UrlHeadRetry(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return false;
|
||||
}
|
||||
|
||||
using (HttpResponseMessage response = await UrlHeadToResponse(request, referer).ConfigureAwait(false)) {
|
||||
return response != null;
|
||||
bool result = false;
|
||||
for (byte i = 0; (i < MaxRetries) && !result; i++) {
|
||||
result = await UrlHead(request, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + MaxRetries + " tries", Identifier);
|
||||
return false;
|
||||
}
|
||||
|
||||
internal async Task<Uri> UrlHeadToUri(string request, string referer = null) {
|
||||
internal async Task<Uri> UrlHeadToUriRetry(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
using (HttpResponseMessage response = await UrlHeadToResponse(request, referer).ConfigureAwait(false)) {
|
||||
return response == null ? null : response.RequestMessage.RequestUri;
|
||||
Uri result = null;
|
||||
for (byte i = 0; (i < MaxRetries) && (result == null); i++) {
|
||||
result = await UrlHeadToUri(request, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + MaxRetries + " tries", Identifier);
|
||||
return null;
|
||||
}
|
||||
|
||||
internal async Task<string> UrlGetToContent(string request, string referer = null) {
|
||||
internal async Task<byte[]> UrlGetToBytesRetry(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
using (HttpResponseMessage httpResponse = await UrlGetToResponse(request, referer).ConfigureAwait(false)) {
|
||||
if (httpResponse == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
byte[] result = null;
|
||||
for (byte i = 0; (i < MaxRetries) && (result == null); i++) {
|
||||
result = await UrlGetToBytes(request, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + MaxRetries + " tries", Identifier);
|
||||
return null;
|
||||
}
|
||||
|
||||
internal async Task<byte[]> UrlGetToBytes(string request, string referer = null) {
|
||||
internal async Task<string> UrlGetToContentRetry(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
string result = null;
|
||||
for (byte i = 0; (i < MaxRetries) && string.IsNullOrEmpty(result); i++) {
|
||||
result = await UrlGetToContent(request, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + MaxRetries + " tries", Identifier);
|
||||
return null;
|
||||
}
|
||||
|
||||
internal async Task<HtmlDocument> UrlGetToHtmlDocumentRetry(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
HtmlDocument result = null;
|
||||
for (byte i = 0; (i < MaxRetries) && (result == null); i++) {
|
||||
result = await UrlGetToHtmlDocument(request, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + MaxRetries + " tries", Identifier);
|
||||
return null;
|
||||
}
|
||||
|
||||
internal async Task<JObject> UrlGetToJObjectRetry(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
JObject result = null;
|
||||
for (byte i = 0; (i < MaxRetries) && (result == null); i++) {
|
||||
result = await UrlGetToJObject(request, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + MaxRetries + " tries", Identifier);
|
||||
return null;
|
||||
}
|
||||
|
||||
internal async Task<XmlDocument> UrlGetToXMLRetry(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
XmlDocument result = null;
|
||||
for (byte i = 0; (i < MaxRetries) && (result == null); i++) {
|
||||
result = await UrlGetToXML(request, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + MaxRetries + " tries", Identifier);
|
||||
return null;
|
||||
}
|
||||
|
||||
internal async Task<bool> UrlPostRetry(string request, Dictionary<string, string> data = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = false;
|
||||
for (byte i = 0; (i < MaxRetries) && !result; i++) {
|
||||
result = await UrlPost(request, data, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Logging.LogGenericWTF("Request failed even after " + MaxRetries + " tries", Identifier);
|
||||
return false;
|
||||
}
|
||||
|
||||
private async Task<byte[]> UrlGetToBytes(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -130,8 +249,24 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
internal async Task<HtmlDocument> UrlGetToHtmlDocument(string request, string referer = null) {
|
||||
private async Task<string> UrlGetToContent(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
using (HttpResponseMessage httpResponse = await UrlGetToResponse(request, referer).ConfigureAwait(false)) {
|
||||
if (httpResponse == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<HtmlDocument> UrlGetToHtmlDocument(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -145,8 +280,9 @@ namespace ArchiSteamFarm {
|
||||
return htmlDocument;
|
||||
}
|
||||
|
||||
internal async Task<JObject> UrlGetToJObject(string request, string referer = null) {
|
||||
private async Task<JObject> UrlGetToJObject(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -167,8 +303,18 @@ namespace ArchiSteamFarm {
|
||||
return jObject;
|
||||
}
|
||||
|
||||
internal async Task<XmlDocument> UrlGetToXML(string request, string referer = null) {
|
||||
private async Task<HttpResponseMessage> UrlGetToResponse(string request, string referer = null) {
|
||||
if (!string.IsNullOrEmpty(request)) {
|
||||
return await UrlRequest(request, HttpMethod.Get, null, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task<XmlDocument> UrlGetToXML(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -189,8 +335,40 @@ namespace ArchiSteamFarm {
|
||||
return xmlDocument;
|
||||
}
|
||||
|
||||
internal async Task<bool> UrlPost(string request, Dictionary<string, string> data = null, string referer = null) {
|
||||
private async Task<bool> UrlHead(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return false;
|
||||
}
|
||||
|
||||
using (HttpResponseMessage response = await UrlHeadToResponse(request, referer).ConfigureAwait(false)) {
|
||||
return response != null;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<HttpResponseMessage> UrlHeadToResponse(string request, string referer = null) {
|
||||
if (!string.IsNullOrEmpty(request)) {
|
||||
return await UrlRequest(request, HttpMethod.Head, null, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task<Uri> UrlHeadToUri(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
using (HttpResponseMessage response = await UrlHeadToResponse(request, referer).ConfigureAwait(false)) {
|
||||
return response == null ? null : response.RequestMessage.RequestUri;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<bool> UrlPost(string request, Dictionary<string, string> data = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
Logging.LogNullError(nameof(request));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -199,32 +377,18 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<HttpResponseMessage> UrlGetToResponse(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await UrlRequest(request, HttpMethod.Get, null, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<HttpResponseMessage> UrlHeadToResponse(string request, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await UrlRequest(request, HttpMethod.Head, null, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<HttpResponseMessage> UrlPostToResponse(string request, Dictionary<string, string> data = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
return null;
|
||||
if (!string.IsNullOrEmpty(request)) {
|
||||
return await UrlRequest(request, HttpMethod.Post, data, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return await UrlRequest(request, HttpMethod.Post, data, referer).ConfigureAwait(false);
|
||||
Logging.LogNullError(nameof(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task<HttpResponseMessage> UrlRequest(string request, HttpMethod httpMethod, Dictionary<string, string> data = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request) || (httpMethod == null)) {
|
||||
Logging.LogNullError(nameof(request) + " || " + nameof(httpMethod));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
"MaxFarmingTime": 10,
|
||||
"IdleFarmingPeriod": 3,
|
||||
"FarmingDelay": 5,
|
||||
"AccountPlayingDelay": 5,
|
||||
"LoginLimiterDelay": 7,
|
||||
"InventoryLimiterDelay": 3,
|
||||
"ForceHttp": false,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net451" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1-beta1" targetFramework="net451" />
|
||||
<package id="protobuf-net" version="2.0.0.668" targetFramework="net45" />
|
||||
<package id="SteamKit2" version="1.7.0" targetFramework="net452" />
|
||||
</packages>
|
||||
@@ -72,6 +72,7 @@ namespace ConfigGenerator {
|
||||
|
||||
internal void Rename(string botName) {
|
||||
if (string.IsNullOrEmpty(botName)) {
|
||||
Logging.LogNullError(nameof(botName));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ namespace ConfigGenerator {
|
||||
|
||||
internal static BotConfig Load(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
Logging.LogNullError(nameof(filePath));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -114,6 +115,7 @@ namespace ConfigGenerator {
|
||||
}
|
||||
|
||||
BotConfig botConfig;
|
||||
|
||||
try {
|
||||
botConfig = JsonConvert.DeserializeObject<BotConfig>(File.ReadAllText(filePath));
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
<ApplicationIcon>cirno.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1-beta1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
@@ -109,7 +109,7 @@
|
||||
del "$(SolutionDir)out\ASF-ConfigGenerator.exe.config"
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent Condition=" '$(OS)' == 'Unix' AND '$(ConfigurationName)' == 'Release' ">
|
||||
mono -O=all "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-ConfigGenerator.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
|
||||
mono --llvm --server -O=all "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-ConfigGenerator.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
|
||||
rm "$(SolutionDir)out/ASF-ConfigGenerator.exe.config"
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -31,7 +32,7 @@ namespace ConfigGenerator {
|
||||
|
||||
internal ConfigPage(ASFConfig config) {
|
||||
if (config == null) {
|
||||
return;
|
||||
throw new ArgumentNullException(nameof(config));
|
||||
}
|
||||
|
||||
ASFConfig = config;
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace ConfigGenerator {
|
||||
internal static class DialogBox {
|
||||
internal static DialogResult InputBox(string title, string promptText, out string value) {
|
||||
if (string.IsNullOrEmpty(title) || string.IsNullOrEmpty(promptText)) {
|
||||
Logging.LogNullError(nameof(title) + " || " + nameof(promptText));
|
||||
value = null;
|
||||
return DialogResult.Abort;
|
||||
}
|
||||
@@ -80,6 +81,7 @@ namespace ConfigGenerator {
|
||||
|
||||
internal static DialogResult YesNoBox(string title, string promptText) {
|
||||
if (string.IsNullOrEmpty(title) || string.IsNullOrEmpty(promptText)) {
|
||||
Logging.LogNullError(nameof(title) + " || " + nameof(promptText));
|
||||
return DialogResult.Abort;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,12 +43,13 @@ namespace ConfigGenerator {
|
||||
ToolbarVisible = false;
|
||||
}
|
||||
|
||||
protected override void OnPropertyValueChanged(PropertyValueChangedEventArgs e) {
|
||||
if (e == null) {
|
||||
protected override void OnPropertyValueChanged(PropertyValueChangedEventArgs args) {
|
||||
if (args == null) {
|
||||
Logging.LogNullError(nameof(args));
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnPropertyValueChanged(e);
|
||||
base.OnPropertyValueChanged(args);
|
||||
ASFConfig.Save();
|
||||
|
||||
BotConfig botConfig = ASFConfig as BotConfig;
|
||||
@@ -74,12 +75,13 @@ namespace ConfigGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnGotFocus(EventArgs e) {
|
||||
if (e == null) {
|
||||
protected override void OnGotFocus(EventArgs args) {
|
||||
if (args == null) {
|
||||
Logging.LogNullError(nameof(args));
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnGotFocus(e);
|
||||
base.OnGotFocus(args);
|
||||
ASFConfig.Save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,9 +78,6 @@ namespace ConfigGenerator {
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
public byte FarmingDelay { get; set; } = DefaultFarmingDelay;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
public byte AccountPlayingDelay { get; set; } = 5;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
public byte LoginLimiterDelay { get; set; } = 7;
|
||||
|
||||
@@ -113,6 +110,7 @@ namespace ConfigGenerator {
|
||||
|
||||
internal static GlobalConfig Load(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
Logging.LogNullError(nameof(filePath));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -121,6 +119,7 @@ namespace ConfigGenerator {
|
||||
}
|
||||
|
||||
GlobalConfig globalConfig;
|
||||
|
||||
try {
|
||||
globalConfig = JsonConvert.DeserializeObject<GlobalConfig>(File.ReadAllText(filePath));
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -23,31 +23,35 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows.Forms;
|
||||
using ConfigGenerator.Properties;
|
||||
|
||||
namespace ConfigGenerator {
|
||||
internal static class Logging {
|
||||
internal static void LogGenericInfo(string message) {
|
||||
internal static void LogGenericInfoWithoutStacktrace(string message) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message));
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show(message, Resources.Information, MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
internal static void LogGenericError(string message, [CallerMemberName] string previousMethodName = null) {
|
||||
internal static void LogGenericErrorWithoutStacktrace(string message) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message));
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show(previousMethodName + @"() " + message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
MessageBox.Show(message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
internal static void LogGenericException(Exception exception, [CallerMemberName] string previousMethodName = null) {
|
||||
while (true) {
|
||||
if (exception == null) {
|
||||
LogNullError(nameof(exception));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -64,10 +68,33 @@ namespace ConfigGenerator {
|
||||
|
||||
internal static void LogGenericWarning(string message, [CallerMemberName] string previousMethodName = null) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message));
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show(previousMethodName + @"() " + message, Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "ExplicitCallerInfoArgument")]
|
||||
internal static void LogNullError(string nullObjectName, [CallerMemberName] string previousMethodName = null) {
|
||||
while (true) {
|
||||
if (string.IsNullOrEmpty(nullObjectName)) {
|
||||
nullObjectName = nameof(nullObjectName);
|
||||
continue;
|
||||
}
|
||||
|
||||
LogGenericError(nullObjectName + " is null!", previousMethodName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void LogGenericError(string message, [CallerMemberName] string previousMethodName = null) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
LogNullError(nameof(message));
|
||||
return;
|
||||
}
|
||||
|
||||
LogGenericErrorWithoutStacktrace(previousMethodName + @"() " + message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,8 +45,9 @@ namespace ConfigGenerator {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e) {
|
||||
if ((sender == null) || (e == null)) {
|
||||
private void MainForm_Load(object sender, EventArgs args) {
|
||||
if ((sender == null) || (args == null)) {
|
||||
Logging.LogNullError(nameof(sender) + " || " + nameof(args));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,12 +72,13 @@ namespace ConfigGenerator {
|
||||
Tutorial.OnAction(Tutorial.EPhase.Start);
|
||||
}
|
||||
|
||||
private void MainTab_Selected(object sender, TabControlEventArgs e) {
|
||||
if ((sender == null) || (e == null)) {
|
||||
private void MainTab_Selected(object sender, TabControlEventArgs args) {
|
||||
if ((sender == null) || (args == null)) {
|
||||
Logging.LogNullError(nameof(sender) + " || " + nameof(args));
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.TabPage == RemoveTab) {
|
||||
if (args.TabPage == RemoveTab) {
|
||||
ConfigPage configPage = OldTab as ConfigPage;
|
||||
if (configPage == null) {
|
||||
MainTab.SelectedIndex = -1;
|
||||
@@ -85,7 +87,7 @@ namespace ConfigGenerator {
|
||||
|
||||
if (configPage == ASFTab) {
|
||||
MainTab.SelectedTab = ASFTab;
|
||||
Logging.LogGenericError("You can't remove global config!");
|
||||
Logging.LogGenericErrorWithoutStacktrace("You can't remove global config!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -98,7 +100,7 @@ namespace ConfigGenerator {
|
||||
MainTab.SelectedIndex = 0;
|
||||
configPage.ASFConfig.Remove();
|
||||
MainTab.TabPages.Remove(configPage);
|
||||
} else if (e.TabPage == RenameTab) {
|
||||
} else if (args.TabPage == RenameTab) {
|
||||
ConfigPage configPage = OldTab as ConfigPage;
|
||||
if (configPage == null) {
|
||||
MainTab.SelectedIndex = -1;
|
||||
@@ -107,7 +109,7 @@ namespace ConfigGenerator {
|
||||
|
||||
if (configPage == ASFTab) {
|
||||
MainTab.SelectedTab = ASFTab;
|
||||
Logging.LogGenericError("You can't rename global config!");
|
||||
Logging.LogGenericErrorWithoutStacktrace("You can't rename global config!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,7 +121,7 @@ namespace ConfigGenerator {
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(input)) {
|
||||
Logging.LogGenericError("Your bot name is empty!");
|
||||
Logging.LogGenericErrorWithoutStacktrace("Your bot name is empty!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -128,7 +130,7 @@ namespace ConfigGenerator {
|
||||
|
||||
configPage.ASFConfig.Rename(input);
|
||||
configPage.RefreshText();
|
||||
} else if (e.TabPage == NewTab) {
|
||||
} else if (args.TabPage == NewTab) {
|
||||
ConfigPage configPage = OldTab as ConfigPage;
|
||||
if (configPage == null) {
|
||||
MainTab.SelectedIndex = -1;
|
||||
@@ -145,7 +147,7 @@ namespace ConfigGenerator {
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(input)) {
|
||||
Logging.LogGenericError("Your bot name is empty!");
|
||||
Logging.LogGenericErrorWithoutStacktrace("Your bot name is empty!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,7 +155,7 @@ namespace ConfigGenerator {
|
||||
input = Regex.Replace(input, @"\s+", "");
|
||||
|
||||
if (ASFConfig.ASFConfigs.Select(config => Path.GetFileNameWithoutExtension(config.FilePath)).Any(fileNameWithoutExtension => (fileNameWithoutExtension == null) || fileNameWithoutExtension.Equals(input))) {
|
||||
Logging.LogGenericError("Bot with such name exists already!");
|
||||
Logging.LogGenericErrorWithoutStacktrace("Bot with such name exists already!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -163,33 +165,36 @@ namespace ConfigGenerator {
|
||||
MainTab.TabPages.Insert(MainTab.TabPages.Count - ReservedTabs, newConfigPage);
|
||||
MainTab.SelectedTab = newConfigPage;
|
||||
Tutorial.OnAction(Tutorial.EPhase.BotNicknameFinished);
|
||||
} else if (e.TabPage == ASFTab) {
|
||||
} else if (args.TabPage == ASFTab) {
|
||||
Tutorial.OnAction(Tutorial.EPhase.GlobalConfigOpened);
|
||||
}
|
||||
}
|
||||
|
||||
private void MainTab_Deselecting(object sender, TabControlCancelEventArgs e) {
|
||||
if ((sender == null) || (e == null)) {
|
||||
private void MainTab_Deselecting(object sender, TabControlCancelEventArgs args) {
|
||||
if ((sender == null) || (args == null)) {
|
||||
Logging.LogNullError(nameof(sender) + " || " + nameof(args));
|
||||
return;
|
||||
}
|
||||
|
||||
OldTab = e.TabPage;
|
||||
OldTab = args.TabPage;
|
||||
}
|
||||
|
||||
private void MainForm_Shown(object sender, EventArgs e) {
|
||||
if ((sender == null) || (e == null)) {
|
||||
private void MainForm_Shown(object sender, EventArgs args) {
|
||||
if ((sender == null) || (args == null)) {
|
||||
Logging.LogNullError(nameof(sender) + " || " + nameof(args));
|
||||
return;
|
||||
}
|
||||
|
||||
Tutorial.OnAction(Tutorial.EPhase.Shown);
|
||||
}
|
||||
|
||||
private void MainForm_HelpButtonClicked(object sender, CancelEventArgs e) {
|
||||
if ((sender == null) || (e == null)) {
|
||||
private void MainForm_HelpButtonClicked(object sender, CancelEventArgs args) {
|
||||
if ((sender == null) || (args == null)) {
|
||||
Logging.LogNullError(nameof(sender) + " || " + nameof(args));
|
||||
return;
|
||||
}
|
||||
|
||||
e.Cancel = true;
|
||||
args.Cancel = true;
|
||||
Tutorial.OnAction(Tutorial.EPhase.Help);
|
||||
Process.Start("https://github.com/JustArchi/ArchiSteamFarm/wiki/Configuration");
|
||||
Tutorial.OnAction(Tutorial.EPhase.HelpFinished);
|
||||
|
||||
@@ -79,12 +79,13 @@ namespace ConfigGenerator {
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericError("Config directory could not be found!");
|
||||
Logging.LogGenericErrorWithoutStacktrace("Config directory could not be found!");
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs args) {
|
||||
if ((sender == null) || (args == null)) {
|
||||
if ((sender == null) || (args == null) || (args.ExceptionObject == null)) {
|
||||
Logging.LogNullError(nameof(sender) + " || " + nameof(args) + " || " + nameof(args.ExceptionObject));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -92,7 +93,8 @@ namespace ConfigGenerator {
|
||||
}
|
||||
|
||||
private static void UnobservedTaskExceptionHandler(object sender, UnobservedTaskExceptionEventArgs args) {
|
||||
if ((sender == null) || (args == null)) {
|
||||
if ((sender == null) || (args == null) || (args.Exception == null)) {
|
||||
Logging.LogNullError(nameof(sender) + " || " + nameof(args) + " || " + nameof(args.Exception));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,42 +51,42 @@ namespace ConfigGenerator {
|
||||
case EPhase.Unknown:
|
||||
break;
|
||||
case EPhase.Start:
|
||||
Logging.LogGenericInfo("Hello there! I noticed that you're using ASF Config Generator for the first time, so let me help you a bit.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("Hello there! I noticed that you're using ASF Config Generator for the first time, so let me help you a bit.");
|
||||
break;
|
||||
case EPhase.Shown:
|
||||
Logging.LogGenericInfo("You can now notice the main ASF Config Generator screen, it's really easy to use!");
|
||||
Logging.LogGenericInfo("At the top of the window you can notice currently loaded configs, and 3 extra buttons for removing, renaming and adding new ones.");
|
||||
Logging.LogGenericInfo("In the middle of the window you will be able to configure all config properties that are available for you.");
|
||||
Logging.LogGenericInfo("In the top right corner you can find help button [?] which will redirect you to ASF wiki where you can find more information.");
|
||||
Logging.LogGenericInfo("Please click the help button to continue.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("You can now notice the main ASF Config Generator screen, it's really easy to use!");
|
||||
Logging.LogGenericInfoWithoutStacktrace("At the top of the window you can notice currently loaded configs, and 3 extra buttons for removing, renaming and adding new ones.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("In the middle of the window you will be able to configure all config properties that are available for you.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("In the top right corner you can find help button [?] which will redirect you to ASF wiki where you can find more information.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("Please click the help button to continue.");
|
||||
break;
|
||||
case EPhase.Help:
|
||||
Logging.LogGenericInfo("Well done! On ASF wiki you can find detailed help about every config property you're going to configure in a moment.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("Well done! On ASF wiki you can find detailed help about every config property you're going to configure in a moment.");
|
||||
break;
|
||||
case EPhase.HelpFinished:
|
||||
Logging.LogGenericInfo("Alright, let's start configuring our ASF. Click on the plus [+] button to add your first steam account to ASF!");
|
||||
Logging.LogGenericInfoWithoutStacktrace("Alright, let's start configuring our ASF. Click on the plus [+] button to add your first steam account to ASF!");
|
||||
break;
|
||||
case EPhase.BotNickname:
|
||||
Logging.LogGenericInfo("Good job! You'll be asked for your bot name now. A good example would be a nickname that you're using for the steam account you're configuring right now, or any other name of your choice which will be easy for you to connect with bot instance that is being configured. Please don't use spaces in the name.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("Good job! You'll be asked for your bot name now. A good example would be a nickname that you're using for the steam account you're configuring right now, or any other name of your choice which will be easy for you to connect with bot instance that is being configured. Please don't use spaces in the name.");
|
||||
break;
|
||||
case EPhase.BotNicknameFinished:
|
||||
Logging.LogGenericInfo("As you can see your bot config is now ready to configure!");
|
||||
Logging.LogGenericInfo("First thing that you want to do is switching \"Enabled\" property from False to True, try it!");
|
||||
Logging.LogGenericInfoWithoutStacktrace("As you can see your bot config is now ready to configure!");
|
||||
Logging.LogGenericInfoWithoutStacktrace("First thing that you want to do is switching \"Enabled\" property from False to True, try it!");
|
||||
break;
|
||||
case EPhase.BotEnabled:
|
||||
Logging.LogGenericInfo("Excellent! Now your bot instance is enabled. You need to configure at least 2 more config properties - \"SteamLogin\" and \"SteamPassword\". The tutorial will continue after you're done with it. Remember to visit ASF wiki by clicking the help icon if you're unsure how given property should be configured!");
|
||||
Logging.LogGenericInfoWithoutStacktrace("Excellent! Now your bot instance is enabled. You need to configure at least 2 more config properties - \"SteamLogin\" and \"SteamPassword\". The tutorial will continue after you're done with it. Remember to visit ASF wiki by clicking the help icon if you're unsure how given property should be configured!");
|
||||
break;
|
||||
case EPhase.BotReady:
|
||||
Logging.LogGenericInfo("If the data you put is proper, then your bot is ready to run! We need to do only one more thing now. Visit global ASF config, which is labelled as \"ASF\" on your config tab.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("If the data you put is proper, then your bot is ready to run! We need to do only one more thing now. Visit global ASF config, which is labelled as \"ASF\" on your config tab.");
|
||||
break;
|
||||
case EPhase.GlobalConfigOpened:
|
||||
Logging.LogGenericInfo("While bot config affects only given bot instance you're configuring, global config affects whole ASF process, including all configured bots.");
|
||||
Logging.LogGenericInfo("In order to fully configure your ASF, I suggest to fill \"SteamOwnerID\" property. Remember, if you don't know what to put, help button is always there for you!");
|
||||
Logging.LogGenericInfoWithoutStacktrace("While bot config affects only given bot instance you're configuring, global config affects whole ASF process, including all configured bots.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("In order to fully configure your ASF, I suggest to fill \"SteamOwnerID\" property. Remember, if you don't know what to put, help button is always there for you!");
|
||||
break;
|
||||
case EPhase.GlobalConfigReady:
|
||||
Logging.LogGenericInfo("Your ASF is now ready! Simply launch ASF process by double-clicking ASF.exe binary and if you did everything properly, you should now notice that ASF logs in on your account and starts farming. If you have SteamGuard or 2FA authorization enabled, ASF will ask you for that once");
|
||||
Logging.LogGenericInfo("Congratulations! You've done everything that is needed in order to make ASF \"work\". I highly recommend reading the wiki now, as ASF offers some really neat features for you to configure, such as offline farming or deciding upon most efficient cards farming algorithm.");
|
||||
Logging.LogGenericInfo("If you'd like to add another steam account for farming, simply click the plus [+] button and add another instance. You can also rename bots [~] and remove them [-]. Good luck!");
|
||||
Logging.LogGenericInfoWithoutStacktrace("Your ASF is now ready! Simply launch ASF process by double-clicking ASF.exe binary and if you did everything properly, you should now notice that ASF logs in on your account and starts farming. If you have SteamGuard or 2FA authorization enabled, ASF will ask you for that once");
|
||||
Logging.LogGenericInfoWithoutStacktrace("Congratulations! You've done everything that is needed in order to make ASF \"work\". I highly recommend reading the wiki now, as ASF offers some really neat features for you to configure, such as offline farming or deciding upon most efficient cards farming algorithm.");
|
||||
Logging.LogGenericInfoWithoutStacktrace("If you'd like to add another steam account for farming, simply click the plus [+] button and add another instance. You can also rename bots [~] and remove them [-]. Good luck!");
|
||||
Enabled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net451" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1-beta1" targetFramework="net451" />
|
||||
</packages>
|
||||
@@ -135,16 +135,6 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
<PostBuildEvent Condition=" '$(OS)' != 'Unix' AND '$(ConfigurationName)' == 'Release' ">
|
||||
"$(SolutionDir)tools\ILRepack\ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out\ASF-GUI.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
|
||||
del "$(SolutionDir)out\ASF-GUI.exe.config"
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent Condition=" '$(OS)' == 'Unix' AND '$(ConfigurationName)' == 'Release' ">
|
||||
mono -O=all "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-GUI.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
|
||||
rm "$(SolutionDir)out/ASF-GUI.exe.config"
|
||||
</PostBuildEvent>
|
||||
-->
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
59
README.md
59
README.md
@@ -10,44 +10,41 @@ ArchiSteamFarm
|
||||
|
||||
---
|
||||
|
||||
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).
|
||||
ASF is a C# application that allows you to farm steam cards using multiple steam accounts simultaneously. Unlike Idle Master which works only for 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).
|
||||
|
||||
ASF doesn't require and doesn't interfere in any way with Steam client. In addition to that, it no longer requires exclusive access to given account, which means that you can use your main account in Steam client, and use ASF for farming the same account at the same time. If you decide to launch a game, ASF will get disconnected, and resume farming once you finish playing your game, being as transparent as possible.
|
||||
|
||||
**Core features:**
|
||||
**Core features**
|
||||
|
||||
- Automatically farm available games using any number of active accounts
|
||||
- Automatically accept friend requests sent from master
|
||||
- Automatically accept all trades coming from master
|
||||
- Automatically accept all steam cd-keys sent via chat from master
|
||||
- Possibility to choose the most efficient cards farming algorithm, based on given account
|
||||
- SteamGuard / SteamParental / 2FA support
|
||||
- Unique ASF 2FA mechanism allowing ASF to act as mobile authenticator (if needed)
|
||||
- ASF update notifications
|
||||
- Full Mono support, cross-OS compatibility
|
||||
- Automatic farming of available games with card drops using any number of active accounts
|
||||
- No requirement of running or even having official Steam client installed
|
||||
- Guarantee of being VAC-free
|
||||
- Complex error-reporting mechanism, allowing ASF to be smart and resume farming even in case of Steam or networking problems
|
||||
- Customizable cards farming algorithm which will push performance of cards farming to the maximum
|
||||
- Offline farming, allowing you to skip in-game status and not confuse your friends anymore
|
||||
- Advanced support for alt accounts, including ability to redeem keys, redeem gifts, accept trades and more through a simple Steam chat
|
||||
- Support for latest Steam security features, including SteamGuard, SteamParental and Two-Factor authentication
|
||||
- Unique ASF 2FA mechanism allowing ASF to act as a mobile authenticator (if needed)
|
||||
- StreamTradeMatcher integration allowing ASF to help you in completing your steam badges by accepting dupe trades
|
||||
- Full Mono support, cross-OS compatibility, official support for Windows, Linux and OS X
|
||||
- ...and many more!
|
||||
|
||||
**Setting up:**
|
||||
**Setting up / Help**
|
||||
|
||||
Detailed setting up instructions are available on **[our wiki](https://github.com/JustArchi/ArchiSteamFarm/wiki/Setting-up)**.
|
||||
Detailed guide regarding setting up and using ASF is available on **[our wiki](https://github.com/JustArchi/ArchiSteamFarm/wiki)**.
|
||||
|
||||
**Current Commands:**
|
||||
**Supported / Tested operating systems:**
|
||||
|
||||
Detailed documentation of all available commands is available on **[our wiki](https://github.com/JustArchi/ArchiSteamFarm/wiki/Commands)**.
|
||||
ASF officially supports Windows, Linux and OS X operating systems, including following tested variants:
|
||||
|
||||
> Commands can be executed via a private chat with your bot.
|
||||
> Remember that bot accepts commands only from ```SteamMasterID```. That property can be configured in the config.
|
||||
|
||||
**Supported / Tested Operating-Systems:**
|
||||
|
||||
- Windows 10 Professional/Enterprise Edition (Native)
|
||||
- Windows 8.1 Professional (Native)
|
||||
- Windows 7 Ultimate (Native)
|
||||
- Debian 9.0 Stretch (Mono)
|
||||
- Debian 8.1 Jessie (Mono)
|
||||
- OS X 10.11.1 (Mono)
|
||||
- Windows 10 (Native)
|
||||
- Windows 8.1 (Native)
|
||||
- Windows 7 (Native)
|
||||
- Windows Vista (Native)
|
||||
- Debian 9 Stretch (Mono)
|
||||
- Debian 8 Jessie (Mono)
|
||||
- Ubuntu 16.04 (Mono)
|
||||
- OS X 10.11 (Mono)
|
||||
- OS X 10.7 (Mono)
|
||||
|
||||
However, any operating system [listed here](http://www.mono-project.com/docs/about-mono/supported-platforms/) should run ASF flawlessly.
|
||||
|
||||
**Need help or more info?**
|
||||
|
||||
Head over to our [wiki](https://github.com/JustArchi/ArchiSteamFarm/wiki) then.
|
||||
However, any **[currently supported Windows](http://windows.microsoft.com/en-us/windows/lifecycle)** should run ASF flawlessly (with latest .NET framework), as well as any **[Mono-powered OS](http://www.mono-project.com/docs/about-mono/supported-platforms/)** (with latest Mono).
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1-beta1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net451" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1-beta1" targetFramework="net451" />
|
||||
</packages>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -81,7 +81,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.Close">
|
||||
@@ -320,12 +320,12 @@
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.ConstructorHandling.Default">
|
||||
<summary>
|
||||
First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor.
|
||||
First attempt to use the public default constructor, then fall back to single parameterized constructor, then the non-public default constructor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.ConstructorHandling.AllowNonPublicDefaultConstructor">
|
||||
<summary>
|
||||
Json.NET will use a non-public default constructor before falling back to a paramatized constructor.
|
||||
Json.NET will use a non-public default constructor before falling back to a parameterized constructor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Converters.BinaryConverter">
|
||||
@@ -781,7 +781,7 @@
|
||||
</summary>
|
||||
<param name="attributeName">Attribute name to test.</param>
|
||||
<param name="prefix">The attribute name prefix if it has one, otherwise an empty string.</param>
|
||||
<returns>True if attribute name is for a namespace attribute, otherwise false.</returns>
|
||||
<returns><c>true</c> if attribute name is for a namespace attribute, otherwise <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Converters.XmlNodeConverter.CanConvert(System.Type)">
|
||||
<summary>
|
||||
@@ -1118,10 +1118,9 @@
|
||||
When overridden in a derived class, returns whether resetting an object changes its value.
|
||||
</summary>
|
||||
<returns>
|
||||
true if resetting the component changes its value; otherwise, false.
|
||||
<c>true</c> if resetting the component changes its value; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<param name="component">The component to test for reset capability.
|
||||
</param>
|
||||
<param name="component">The component to test for reset capability.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JPropertyDescriptor.GetValue(System.Object)">
|
||||
<summary>
|
||||
@@ -1153,10 +1152,9 @@
|
||||
When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the property should be persisted; otherwise, false.
|
||||
<c>true</c> if the property should be persisted; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<param name="component">The component with the property to be examined for persistence.
|
||||
</param>
|
||||
<param name="component">The component with the property to be examined for persistence.</param>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JPropertyDescriptor.ComponentType">
|
||||
<summary>
|
||||
@@ -1171,7 +1169,7 @@
|
||||
When overridden in a derived class, gets a value indicating whether this property is read-only.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the property is read-only; otherwise, false.
|
||||
<c>true</c> if the property is read-only; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JPropertyDescriptor.PropertyType">
|
||||
@@ -1239,7 +1237,7 @@
|
||||
<param name="x">The first object of type <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<param name="y">The second object of type <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<returns>
|
||||
true if the specified objects are equal; otherwise, false.
|
||||
<c>true</c> if the specified objects are equal; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenEqualityComparer.GetHashCode(Newtonsoft.Json.Linq.JToken)">
|
||||
@@ -1822,7 +1820,7 @@
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<param name="value">The value.</param>
|
||||
<param name="comparison">One of the enumeration values that specifies how the strings will be compared.</param>
|
||||
<returns>true if a value was successfully retrieved; otherwise, false.</returns>
|
||||
<returns><c>true</c> if a value was successfully retrieved; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JObject.Add(System.String,Newtonsoft.Json.Linq.JToken)">
|
||||
<summary>
|
||||
@@ -1836,7 +1834,7 @@
|
||||
Removes the property with the specified name.
|
||||
</summary>
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<returns>true if item was successfully removed; otherwise, false.</returns>
|
||||
<returns><c>true</c> if item was successfully removed; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JObject.TryGetValue(System.String,Newtonsoft.Json.Linq.JToken@)">
|
||||
<summary>
|
||||
@@ -1844,7 +1842,7 @@
|
||||
</summary>
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<param name="value">The value.</param>
|
||||
<returns>true if a value was successfully retrieved; otherwise, false.</returns>
|
||||
<returns><c>true</c> if a value was successfully retrieved; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JObject.GetEnumerator">
|
||||
<summary>
|
||||
@@ -2177,7 +2175,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JTokenReader.Path">
|
||||
@@ -2436,7 +2434,7 @@
|
||||
</summary>
|
||||
<param name="t1">The first <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<param name="t2">The second <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<returns>true if the tokens are equal; otherwise false.</returns>
|
||||
<returns><c>true</c> if the tokens are equal; otherwise <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JToken.Next">
|
||||
<summary>
|
||||
@@ -3566,7 +3564,7 @@
|
||||
Indicates whether the current object is equal to another object of the same type.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
|
||||
<c>true</c> if the current object is equal to the <paramref name="other"/> parameter; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<param name="other">An object to compare with this object.</param>
|
||||
</member>
|
||||
@@ -3576,7 +3574,7 @@
|
||||
</summary>
|
||||
<param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
|
||||
<returns>
|
||||
true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
|
||||
<c>true</c> if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<exception cref="T:System.NullReferenceException">
|
||||
The <paramref name="obj"/> parameter is null.
|
||||
@@ -3666,6 +3664,47 @@
|
||||
Do not try to read metadata properties.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy">
|
||||
<summary>
|
||||
A camel case naming strategy.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy.#ctor(System.Boolean,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
<param name="processDictionaryKeys">
|
||||
A flag indicating whether dictionary keys should be processed.
|
||||
</param>
|
||||
<param name="overrideSpecifiedNames">
|
||||
A flag indicating whether explicitly specified property names should be processed,
|
||||
e.g. a property name customized with a <see cref="T:Newtonsoft.Json.JsonPropertyAttribute"/>.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.DefaultNamingStrategy">
|
||||
<summary>
|
||||
The default naming strategy. Property names and dictionary keys are unchanged.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.DefaultNamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.DiagnosticsTraceWriter">
|
||||
<summary>
|
||||
Represents a trace writer that writes to the application's <see cref="T:System.Diagnostics.TraceListener"/> instances.
|
||||
@@ -3808,6 +3847,46 @@
|
||||
A <see cref="T:System.String"/> of the most recent trace messages.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.NamingStrategy">
|
||||
<summary>
|
||||
A base class for resolving how property names and dictionary keys are serialized.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.NamingStrategy.ProcessDictionaryKeys">
|
||||
<summary>
|
||||
A flag indicating whether dictionary keys should be processed.
|
||||
Defaults to <c>false</c>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.NamingStrategy.OverrideSpecifiedNames">
|
||||
<summary>
|
||||
A flag indicating whether explicitly specified property names,
|
||||
e.g. a property name customized with a <see cref="T:Newtonsoft.Json.JsonPropertyAttribute"/>, should be processed.
|
||||
Defaults to <c>false</c>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.NamingStrategy.GetPropertyName(System.String,System.Boolean)">
|
||||
<summary>
|
||||
Gets the serialized name for a given property name.
|
||||
</summary>
|
||||
<param name="name">The initial property name.</param>
|
||||
<param name="hasSpecifiedName">A flag indicating whether the property has had a name explicitly specfied.</param>
|
||||
<returns>The serialized property name.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.NamingStrategy.GetDictionaryKey(System.String)">
|
||||
<summary>
|
||||
Gets the serialized key for a given dictionary key.
|
||||
</summary>
|
||||
<param name="key">The initial dictionary key.</param>
|
||||
<returns>The serialized dictionary key.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.NamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.ReflectionAttributeProvider">
|
||||
<summary>
|
||||
Provides methods to get attributes from a <see cref="T:System.Type"/>, <see cref="T:System.Reflection.MemberInfo"/>, <see cref="T:System.Reflection.ParameterInfo"/> or <see cref="T:System.Reflection.Assembly"/>.
|
||||
@@ -3834,6 +3913,35 @@
|
||||
<param name="inherit">When true, look up the hierarchy chain for the inherited custom attribute.</param>
|
||||
<returns>A collection of <see cref="T:System.Attribute"/>s, or an empty collection.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy">
|
||||
<summary>
|
||||
A snake case naming strategy.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy.#ctor(System.Boolean,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
<param name="processDictionaryKeys">
|
||||
A flag indicating whether dictionary keys should be processed.
|
||||
</param>
|
||||
<param name="overrideSpecifiedNames">
|
||||
A flag indicating whether explicitly specified property names should be processed,
|
||||
e.g. a property name customized with a <see cref="T:Newtonsoft.Json.JsonPropertyAttribute"/>.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver">
|
||||
<summary>
|
||||
Resolves member mappings for a type, camel casing property names.
|
||||
@@ -3844,13 +3952,6 @@
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the name of the property.
|
||||
</summary>
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<returns>The property name camel cased.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.DefaultContractResolver">
|
||||
<summary>
|
||||
Used by <see cref="T:Newtonsoft.Json.JsonSerializer"/> to resolves a <see cref="T:Newtonsoft.Json.Serialization.JsonContract"/> for a given <see cref="T:System.Type"/>.
|
||||
@@ -3895,6 +3996,12 @@
|
||||
<c>true</c> if the <see cref="T:System.SerializableAttribute"/> attribute will be ignored when serializing and deserializing types; otherwise, <c>false</c>.
|
||||
</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.DefaultContractResolver.NamingStrategy">
|
||||
<summary>
|
||||
Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized.
|
||||
</summary>
|
||||
<value>The naming strategy used to resolve how property names and dictionary keys are serialized.</value>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.DefaultContractResolver.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.DefaultContractResolver"/> class.
|
||||
@@ -4799,13 +4906,6 @@
|
||||
<param name="converterArgs">Optional arguments to pass to an initializing constructor of the JsonConverter.
|
||||
If null, the default constructor is used.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.JsonTypeReflector.GetJsonConverterCreator(System.Type)">
|
||||
<summary>
|
||||
Create a factory function that can be used to create instances of a JsonConverter described by the
|
||||
argument type. The returned function can then be used to either invoke the converter's default ctor, or any
|
||||
parameterized constructors by way of an object array.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.ObjectConstructor`1">
|
||||
<summary>
|
||||
Represents a method that constructs an object.
|
||||
@@ -5967,16 +6067,6 @@
|
||||
<param name="initial">The list to add to.</param>
|
||||
<param name="collection">The collection of elements to add.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Utilities.CollectionUtils.IndexOf``1(System.Collections.Generic.IEnumerable{``0},``0,System.Collections.Generic.IEqualityComparer{``0})">
|
||||
<summary>
|
||||
Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer{TSource}.
|
||||
</summary>
|
||||
<typeparam name="TSource">The type of the elements of source.</typeparam>
|
||||
<param name="list">A sequence in which to locate a value.</param>
|
||||
<param name="value">The object to locate in the sequence</param>
|
||||
<param name="comparer">An equality comparer to compare values.</param>
|
||||
<returns>The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Utilities.ReflectionUtils.GetCollectionItemType(System.Type)">
|
||||
<summary>
|
||||
Gets the type of the typed collection's items.
|
||||
@@ -6055,13 +6145,6 @@
|
||||
<c>true</c> if the string is all white space; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Utilities.StringUtils.NullEmptyString(System.String)">
|
||||
<summary>
|
||||
Nulls an empty string.
|
||||
</summary>
|
||||
<param name="s">The string.</param>
|
||||
<returns>Null if the string was null, otherwise the string unchanged.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Required">
|
||||
<summary>
|
||||
Indicating whether a property is required.
|
||||
@@ -6194,21 +6277,38 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.ItemConverterType">
|
||||
<summary>
|
||||
Gets the collection's items converter.
|
||||
Gets or sets the collection's items converter.
|
||||
</summary>
|
||||
<value>The collection's items converter.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.ItemConverterParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the JsonConverter described by ItemConverterType.
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/> described by ItemConverterType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number,
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.JsonConverter"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.NamingStrategyType">
|
||||
<summary>
|
||||
Gets or sets the <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.
|
||||
</summary>
|
||||
<value>The <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.NamingStrategyParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> described by NamingStrategyType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonContainer(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.IsReference">
|
||||
<summary>
|
||||
Gets or sets a value that indicates whether to preserve object references.
|
||||
@@ -6290,13 +6390,13 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonConverterAttribute.ConverterType">
|
||||
<summary>
|
||||
Gets the <see cref="T:System.Type"/> of the converter.
|
||||
Gets the <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.
|
||||
</summary>
|
||||
<value>The <see cref="T:System.Type"/> of the converter.</value>
|
||||
<value>The <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonConverterAttribute.ConverterParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the JsonConverter described by ConverterType.
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/> described by ConverterType.
|
||||
If null, the default constructor is used.
|
||||
</summary>
|
||||
</member>
|
||||
@@ -6304,14 +6404,14 @@
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.JsonConverterAttribute"/> class.
|
||||
</summary>
|
||||
<param name="converterType">Type of the converter.</param>
|
||||
<param name="converterType">Type of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonConverterAttribute.#ctor(System.Type,System.Object[])">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.JsonConverterAttribute"/> class.
|
||||
</summary>
|
||||
<param name="converterType">Type of the converter.</param>
|
||||
<param name="converterParameters">Parameter list to use when constructing the JsonConverter. Can be null.</param>
|
||||
<param name="converterType">Type of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.</param>
|
||||
<param name="converterParameters">Parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/>. Can be null.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.JsonObjectAttribute">
|
||||
<summary>
|
||||
@@ -6657,7 +6757,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.MemberSerialization">
|
||||
@@ -6725,7 +6825,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
@@ -6806,21 +6906,38 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.ItemConverterType">
|
||||
<summary>
|
||||
Gets or sets the converter used when serializing the property's collection items.
|
||||
Gets or sets the <see cref="T:Newtonsoft.Json.JsonConverter"/> used when serializing the property's collection items.
|
||||
</summary>
|
||||
<value>The collection's items converter.</value>
|
||||
<value>The collection's items <see cref="T:Newtonsoft.Json.JsonConverter"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.ItemConverterParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the JsonConverter described by ItemConverterType.
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/> described by ItemConverterType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number,
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.JsonConverter"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.NamingStrategyType">
|
||||
<summary>
|
||||
Gets or sets the <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.
|
||||
</summary>
|
||||
<value>The <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.NamingStrategyParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> described by NamingStrategyType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonProperty(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.NullValueHandling">
|
||||
<summary>
|
||||
Gets or sets the null value handling used when serializing this property.
|
||||
@@ -7490,7 +7607,7 @@
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>true if the next token was read successfully; false if there are no more tokens to read.</returns>
|
||||
<returns><c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsInt32">
|
||||
<summary>
|
||||
Binary file not shown.
@@ -64,7 +64,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.Close">
|
||||
@@ -804,7 +804,7 @@
|
||||
</summary>
|
||||
<param name="attributeName">Attribute name to test.</param>
|
||||
<param name="prefix">The attribute name prefix if it has one, otherwise an empty string.</param>
|
||||
<returns>True if attribute name is for a namespace attribute, otherwise false.</returns>
|
||||
<returns><c>true</c> if attribute name is for a namespace attribute, otherwise <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Converters.XmlNodeConverter.CanConvert(System.Type)">
|
||||
<summary>
|
||||
@@ -822,12 +822,12 @@
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.ConstructorHandling.Default">
|
||||
<summary>
|
||||
First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor.
|
||||
First attempt to use the public default constructor, then fall back to single parameterized constructor, then the non-public default constructor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.ConstructorHandling.AllowNonPublicDefaultConstructor">
|
||||
<summary>
|
||||
Json.NET will use a non-public default constructor before falling back to a paramatized constructor.
|
||||
Json.NET will use a non-public default constructor before falling back to a parameterized constructor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.DateFormatHandling">
|
||||
@@ -1095,10 +1095,9 @@
|
||||
When overridden in a derived class, returns whether resetting an object changes its value.
|
||||
</summary>
|
||||
<returns>
|
||||
true if resetting the component changes its value; otherwise, false.
|
||||
<c>true</c> if resetting the component changes its value; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<param name="component">The component to test for reset capability.
|
||||
</param>
|
||||
<param name="component">The component to test for reset capability.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JPropertyDescriptor.GetValue(System.Object)">
|
||||
<summary>
|
||||
@@ -1130,10 +1129,9 @@
|
||||
When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the property should be persisted; otherwise, false.
|
||||
<c>true</c> if the property should be persisted; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<param name="component">The component with the property to be examined for persistence.
|
||||
</param>
|
||||
<param name="component">The component with the property to be examined for persistence.</param>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JPropertyDescriptor.ComponentType">
|
||||
<summary>
|
||||
@@ -1148,7 +1146,7 @@
|
||||
When overridden in a derived class, gets a value indicating whether this property is read-only.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the property is read-only; otherwise, false.
|
||||
<c>true</c> if the property is read-only; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JPropertyDescriptor.PropertyType">
|
||||
@@ -1282,7 +1280,7 @@
|
||||
<param name="x">The first object of type <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<param name="y">The second object of type <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<returns>
|
||||
true if the specified objects are equal; otherwise, false.
|
||||
<c>true</c> if the specified objects are equal; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenEqualityComparer.GetHashCode(Newtonsoft.Json.Linq.JToken)">
|
||||
@@ -1870,7 +1868,7 @@
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<param name="value">The value.</param>
|
||||
<param name="comparison">One of the enumeration values that specifies how the strings will be compared.</param>
|
||||
<returns>true if a value was successfully retrieved; otherwise, false.</returns>
|
||||
<returns><c>true</c> if a value was successfully retrieved; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JObject.Add(System.String,Newtonsoft.Json.Linq.JToken)">
|
||||
<summary>
|
||||
@@ -1884,7 +1882,7 @@
|
||||
Removes the property with the specified name.
|
||||
</summary>
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<returns>true if item was successfully removed; otherwise, false.</returns>
|
||||
<returns><c>true</c> if item was successfully removed; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JObject.TryGetValue(System.String,Newtonsoft.Json.Linq.JToken@)">
|
||||
<summary>
|
||||
@@ -1892,7 +1890,7 @@
|
||||
</summary>
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<param name="value">The value.</param>
|
||||
<returns>true if a value was successfully retrieved; otherwise, false.</returns>
|
||||
<returns><c>true</c> if a value was successfully retrieved; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JObject.GetEnumerator">
|
||||
<summary>
|
||||
@@ -2231,7 +2229,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JTokenReader.Path">
|
||||
@@ -2496,7 +2494,7 @@
|
||||
</summary>
|
||||
<param name="t1">The first <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<param name="t2">The second <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<returns>true if the tokens are equal; otherwise false.</returns>
|
||||
<returns><c>true</c> if the tokens are equal; otherwise <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JToken.Next">
|
||||
<summary>
|
||||
@@ -3660,7 +3658,7 @@
|
||||
Indicates whether the current object is equal to another object of the same type.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
|
||||
<c>true</c> if the current object is equal to the <paramref name="other"/> parameter; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<param name="other">An object to compare with this object.</param>
|
||||
</member>
|
||||
@@ -3670,7 +3668,7 @@
|
||||
</summary>
|
||||
<param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
|
||||
<returns>
|
||||
true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
|
||||
<c>true</c> if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<exception cref="T:System.NullReferenceException">
|
||||
The <paramref name="obj"/> parameter is null.
|
||||
@@ -3760,6 +3758,47 @@
|
||||
Do not try to read metadata properties.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy">
|
||||
<summary>
|
||||
A camel case naming strategy.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy.#ctor(System.Boolean,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
<param name="processDictionaryKeys">
|
||||
A flag indicating whether dictionary keys should be processed.
|
||||
</param>
|
||||
<param name="overrideSpecifiedNames">
|
||||
A flag indicating whether explicitly specified property names should be processed,
|
||||
e.g. a property name customized with a <see cref="T:Newtonsoft.Json.JsonPropertyAttribute"/>.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.DefaultNamingStrategy">
|
||||
<summary>
|
||||
The default naming strategy. Property names and dictionary keys are unchanged.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.DefaultNamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.DiagnosticsTraceWriter">
|
||||
<summary>
|
||||
Represents a trace writer that writes to the application's <see cref="T:System.Diagnostics.TraceListener"/> instances.
|
||||
@@ -3902,6 +3941,46 @@
|
||||
A <see cref="T:System.String"/> of the most recent trace messages.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.NamingStrategy">
|
||||
<summary>
|
||||
A base class for resolving how property names and dictionary keys are serialized.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.NamingStrategy.ProcessDictionaryKeys">
|
||||
<summary>
|
||||
A flag indicating whether dictionary keys should be processed.
|
||||
Defaults to <c>false</c>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.NamingStrategy.OverrideSpecifiedNames">
|
||||
<summary>
|
||||
A flag indicating whether explicitly specified property names,
|
||||
e.g. a property name customized with a <see cref="T:Newtonsoft.Json.JsonPropertyAttribute"/>, should be processed.
|
||||
Defaults to <c>false</c>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.NamingStrategy.GetPropertyName(System.String,System.Boolean)">
|
||||
<summary>
|
||||
Gets the serialized name for a given property name.
|
||||
</summary>
|
||||
<param name="name">The initial property name.</param>
|
||||
<param name="hasSpecifiedName">A flag indicating whether the property has had a name explicitly specfied.</param>
|
||||
<returns>The serialized property name.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.NamingStrategy.GetDictionaryKey(System.String)">
|
||||
<summary>
|
||||
Gets the serialized key for a given dictionary key.
|
||||
</summary>
|
||||
<param name="key">The initial dictionary key.</param>
|
||||
<returns>The serialized dictionary key.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.NamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.ReflectionAttributeProvider">
|
||||
<summary>
|
||||
Provides methods to get attributes from a <see cref="T:System.Type"/>, <see cref="T:System.Reflection.MemberInfo"/>, <see cref="T:System.Reflection.ParameterInfo"/> or <see cref="T:System.Reflection.Assembly"/>.
|
||||
@@ -3928,6 +4007,35 @@
|
||||
<param name="inherit">When true, look up the hierarchy chain for the inherited custom attribute.</param>
|
||||
<returns>A collection of <see cref="T:System.Attribute"/>s, or an empty collection.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy">
|
||||
<summary>
|
||||
A snake case naming strategy.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy.#ctor(System.Boolean,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
<param name="processDictionaryKeys">
|
||||
A flag indicating whether dictionary keys should be processed.
|
||||
</param>
|
||||
<param name="overrideSpecifiedNames">
|
||||
A flag indicating whether explicitly specified property names should be processed,
|
||||
e.g. a property name customized with a <see cref="T:Newtonsoft.Json.JsonPropertyAttribute"/>.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.JsonISerializableContract">
|
||||
<summary>
|
||||
Contract details for a <see cref="T:System.Type"/> used by the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
|
||||
@@ -4026,13 +4134,6 @@
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the name of the property.
|
||||
</summary>
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<returns>The property name camel cased.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.DefaultContractResolver">
|
||||
<summary>
|
||||
Used by <see cref="T:Newtonsoft.Json.JsonSerializer"/> to resolves a <see cref="T:Newtonsoft.Json.Serialization.JsonContract"/> for a given <see cref="T:System.Type"/>.
|
||||
@@ -4077,6 +4178,12 @@
|
||||
<c>true</c> if the <see cref="T:System.SerializableAttribute"/> attribute will be ignored when serializing and deserializing types; otherwise, <c>false</c>.
|
||||
</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.DefaultContractResolver.NamingStrategy">
|
||||
<summary>
|
||||
Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized.
|
||||
</summary>
|
||||
<value>The naming strategy used to resolve how property names and dictionary keys are serialized.</value>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.DefaultContractResolver.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.DefaultContractResolver"/> class.
|
||||
@@ -4893,13 +5000,6 @@
|
||||
<param name="converterArgs">Optional arguments to pass to an initializing constructor of the JsonConverter.
|
||||
If null, the default constructor is used.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.JsonTypeReflector.GetJsonConverterCreator(System.Type)">
|
||||
<summary>
|
||||
Create a factory function that can be used to create instances of a JsonConverter described by the
|
||||
argument type. The returned function can then be used to either invoke the converter's default ctor, or any
|
||||
parameterized constructors by way of an object array.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.ReflectionValueProvider">
|
||||
<summary>
|
||||
Get and set values for a <see cref="T:System.Reflection.MemberInfo"/> using reflection.
|
||||
@@ -5003,16 +5103,6 @@
|
||||
<param name="initial">The list to add to.</param>
|
||||
<param name="collection">The collection of elements to add.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Utilities.CollectionUtils.IndexOf``1(System.Collections.Generic.IEnumerable{``0},``0,System.Collections.Generic.IEqualityComparer{``0})">
|
||||
<summary>
|
||||
Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer{TSource}.
|
||||
</summary>
|
||||
<typeparam name="TSource">The type of the elements of source.</typeparam>
|
||||
<param name="list">A sequence in which to locate a value.</param>
|
||||
<param name="value">The object to locate in the sequence</param>
|
||||
<param name="comparer">An equality comparer to compare values.</param>
|
||||
<returns>The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Utilities.ReflectionUtils.GetCollectionItemType(System.Type)">
|
||||
<summary>
|
||||
Gets the type of the typed collection's items.
|
||||
@@ -5091,13 +5181,6 @@
|
||||
<c>true</c> if the string is all white space; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Utilities.StringUtils.NullEmptyString(System.String)">
|
||||
<summary>
|
||||
Nulls an empty string.
|
||||
</summary>
|
||||
<param name="s">The string.</param>
|
||||
<returns>Null if the string was null, otherwise the string unchanged.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Required">
|
||||
<summary>
|
||||
Indicating whether a property is required.
|
||||
@@ -5230,21 +5313,38 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.ItemConverterType">
|
||||
<summary>
|
||||
Gets the collection's items converter.
|
||||
Gets or sets the collection's items converter.
|
||||
</summary>
|
||||
<value>The collection's items converter.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.ItemConverterParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the JsonConverter described by ItemConverterType.
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/> described by ItemConverterType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number,
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.JsonConverter"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.NamingStrategyType">
|
||||
<summary>
|
||||
Gets or sets the <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.
|
||||
</summary>
|
||||
<value>The <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.NamingStrategyParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> described by NamingStrategyType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonContainer(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.IsReference">
|
||||
<summary>
|
||||
Gets or sets a value that indicates whether to preserve object references.
|
||||
@@ -5326,13 +5426,13 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonConverterAttribute.ConverterType">
|
||||
<summary>
|
||||
Gets the <see cref="T:System.Type"/> of the converter.
|
||||
Gets the <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.
|
||||
</summary>
|
||||
<value>The <see cref="T:System.Type"/> of the converter.</value>
|
||||
<value>The <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonConverterAttribute.ConverterParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the JsonConverter described by ConverterType.
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/> described by ConverterType.
|
||||
If null, the default constructor is used.
|
||||
</summary>
|
||||
</member>
|
||||
@@ -5340,14 +5440,14 @@
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.JsonConverterAttribute"/> class.
|
||||
</summary>
|
||||
<param name="converterType">Type of the converter.</param>
|
||||
<param name="converterType">Type of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonConverterAttribute.#ctor(System.Type,System.Object[])">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.JsonConverterAttribute"/> class.
|
||||
</summary>
|
||||
<param name="converterType">Type of the converter.</param>
|
||||
<param name="converterParameters">Parameter list to use when constructing the JsonConverter. Can be null.</param>
|
||||
<param name="converterType">Type of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.</param>
|
||||
<param name="converterParameters">Parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/>. Can be null.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.JsonObjectAttribute">
|
||||
<summary>
|
||||
@@ -5699,7 +5799,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.MemberSerialization">
|
||||
@@ -5767,7 +5867,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
@@ -5854,21 +5954,38 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.ItemConverterType">
|
||||
<summary>
|
||||
Gets or sets the converter used when serializing the property's collection items.
|
||||
Gets or sets the <see cref="T:Newtonsoft.Json.JsonConverter"/> used when serializing the property's collection items.
|
||||
</summary>
|
||||
<value>The collection's items converter.</value>
|
||||
<value>The collection's items <see cref="T:Newtonsoft.Json.JsonConverter"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.ItemConverterParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the JsonConverter described by ItemConverterType.
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/> described by ItemConverterType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number,
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.JsonConverter"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.NamingStrategyType">
|
||||
<summary>
|
||||
Gets or sets the <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.
|
||||
</summary>
|
||||
<value>The <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.NamingStrategyParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> described by NamingStrategyType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonProperty(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.NullValueHandling">
|
||||
<summary>
|
||||
Gets or sets the null value handling used when serializing this property.
|
||||
@@ -6544,7 +6661,7 @@
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>true if the next token was read successfully; false if there are no more tokens to read.</returns>
|
||||
<returns><c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsInt32">
|
||||
<summary>
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.9.0.1-beta1/lib/netstandard1.0/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.9.0.1-beta1/lib/netstandard1.0/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -81,7 +81,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.Close">
|
||||
@@ -326,12 +326,12 @@
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.ConstructorHandling.Default">
|
||||
<summary>
|
||||
First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor.
|
||||
First attempt to use the public default constructor, then fall back to single parameterized constructor, then the non-public default constructor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.ConstructorHandling.AllowNonPublicDefaultConstructor">
|
||||
<summary>
|
||||
Json.NET will use a non-public default constructor before falling back to a paramatized constructor.
|
||||
Json.NET will use a non-public default constructor before falling back to a parameterized constructor.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Converters.BsonObjectIdConverter">
|
||||
@@ -925,21 +925,38 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.ItemConverterType">
|
||||
<summary>
|
||||
Gets the collection's items converter.
|
||||
Gets or sets the collection's items converter.
|
||||
</summary>
|
||||
<value>The collection's items converter.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.ItemConverterParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the JsonConverter described by ItemConverterType.
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/> described by ItemConverterType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number,
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.JsonConverter"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.NamingStrategyType">
|
||||
<summary>
|
||||
Gets or sets the <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.
|
||||
</summary>
|
||||
<value>The <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.NamingStrategyParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> described by NamingStrategyType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonContainer(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonContainerAttribute.IsReference">
|
||||
<summary>
|
||||
Gets or sets a value that indicates whether to preserve object references.
|
||||
@@ -1488,13 +1505,13 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonConverterAttribute.ConverterType">
|
||||
<summary>
|
||||
Gets the <see cref="T:System.Type"/> of the converter.
|
||||
Gets the <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.
|
||||
</summary>
|
||||
<value>The <see cref="T:System.Type"/> of the converter.</value>
|
||||
<value>The <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonConverterAttribute.ConverterParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the JsonConverter described by ConverterType.
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/> described by ConverterType.
|
||||
If null, the default constructor is used.
|
||||
</summary>
|
||||
</member>
|
||||
@@ -1502,14 +1519,14 @@
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.JsonConverterAttribute"/> class.
|
||||
</summary>
|
||||
<param name="converterType">Type of the converter.</param>
|
||||
<param name="converterType">Type of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonConverterAttribute.#ctor(System.Type,System.Object[])">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.JsonConverterAttribute"/> class.
|
||||
</summary>
|
||||
<param name="converterType">Type of the converter.</param>
|
||||
<param name="converterParameters">Parameter list to use when constructing the JsonConverter. Can be null.</param>
|
||||
<param name="converterType">Type of the <see cref="T:Newtonsoft.Json.JsonConverter"/>.</param>
|
||||
<param name="converterParameters">Parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/>. Can be null.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.JsonConverterCollection">
|
||||
<summary>
|
||||
@@ -1632,21 +1649,38 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.ItemConverterType">
|
||||
<summary>
|
||||
Gets or sets the converter used when serializing the property's collection items.
|
||||
Gets or sets the <see cref="T:Newtonsoft.Json.JsonConverter"/> used when serializing the property's collection items.
|
||||
</summary>
|
||||
<value>The collection's items converter.</value>
|
||||
<value>The collection's items <see cref="T:Newtonsoft.Json.JsonConverter"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.ItemConverterParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the JsonConverter described by ItemConverterType.
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.JsonConverter"/> described by ItemConverterType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number,
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.JsonConverter"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.NamingStrategyType">
|
||||
<summary>
|
||||
Gets or sets the <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.
|
||||
</summary>
|
||||
<value>The <see cref="T:System.Type"/> of the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/>.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.NamingStrategyParameters">
|
||||
<summary>
|
||||
The parameter list to use when constructing the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> described by NamingStrategyType.
|
||||
If null, the default constructor is used.
|
||||
When non-null, there must be a constructor defined in the <see cref="T:Newtonsoft.Json.Serialization.NamingStrategy"/> that exactly matches the number,
|
||||
order, and type of these parameters.
|
||||
</summary>
|
||||
<example>
|
||||
[JsonProperty(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })]
|
||||
</example>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.NullValueHandling">
|
||||
<summary>
|
||||
Gets or sets the null value handling used when serializing this property.
|
||||
@@ -1902,7 +1936,7 @@
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>true if the next token was read successfully; false if there are no more tokens to read.</returns>
|
||||
<returns><c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsInt32">
|
||||
<summary>
|
||||
@@ -2590,7 +2624,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
@@ -3152,7 +3186,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.JsonWriter">
|
||||
@@ -4432,7 +4466,7 @@
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<param name="value">The value.</param>
|
||||
<param name="comparison">One of the enumeration values that specifies how the strings will be compared.</param>
|
||||
<returns>true if a value was successfully retrieved; otherwise, false.</returns>
|
||||
<returns><c>true</c> if a value was successfully retrieved; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JObject.Add(System.String,Newtonsoft.Json.Linq.JToken)">
|
||||
<summary>
|
||||
@@ -4446,7 +4480,7 @@
|
||||
Removes the property with the specified name.
|
||||
</summary>
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<returns>true if item was successfully removed; otherwise, false.</returns>
|
||||
<returns><c>true</c> if item was successfully removed; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JObject.TryGetValue(System.String,Newtonsoft.Json.Linq.JToken@)">
|
||||
<summary>
|
||||
@@ -4454,7 +4488,7 @@
|
||||
</summary>
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<param name="value">The value.</param>
|
||||
<returns>true if a value was successfully retrieved; otherwise, false.</returns>
|
||||
<returns><c>true</c> if a value was successfully retrieved; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JObject.GetEnumerator">
|
||||
<summary>
|
||||
@@ -4643,7 +4677,7 @@
|
||||
</summary>
|
||||
<param name="t1">The first <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<param name="t2">The second <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<returns>true if the tokens are equal; otherwise false.</returns>
|
||||
<returns><c>true</c> if the tokens are equal; otherwise <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JToken.Next">
|
||||
<summary>
|
||||
@@ -5499,7 +5533,7 @@
|
||||
<param name="x">The first object of type <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<param name="y">The second object of type <see cref="T:Newtonsoft.Json.Linq.JToken"/> to compare.</param>
|
||||
<returns>
|
||||
true if the specified objects are equal; otherwise, false.
|
||||
<c>true</c> if the specified objects are equal; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenEqualityComparer.GetHashCode(Newtonsoft.Json.Linq.JToken)">
|
||||
@@ -5531,7 +5565,7 @@
|
||||
Reads the next JSON token from the stream.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
<c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Linq.JTokenReader.Path">
|
||||
@@ -6001,7 +6035,7 @@
|
||||
Indicates whether the current object is equal to another object of the same type.
|
||||
</summary>
|
||||
<returns>
|
||||
true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
|
||||
<c>true</c> if the current object is equal to the <paramref name="other"/> parameter; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<param name="other">An object to compare with this object.</param>
|
||||
</member>
|
||||
@@ -6011,7 +6045,7 @@
|
||||
</summary>
|
||||
<param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
|
||||
<returns>
|
||||
true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
|
||||
<c>true</c> if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<exception cref="T:System.NullReferenceException">
|
||||
The <paramref name="obj"/> parameter is null.
|
||||
@@ -6881,6 +6915,35 @@
|
||||
<param name="assemblyName">Specifies the <see cref="T:System.Reflection.Assembly"/> name of the serialized object.</param>
|
||||
<param name="typeName">Specifies the <see cref="T:System.Type"/> name of the serialized object.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy">
|
||||
<summary>
|
||||
A camel case naming strategy.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy.#ctor(System.Boolean,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
<param name="processDictionaryKeys">
|
||||
A flag indicating whether dictionary keys should be processed.
|
||||
</param>
|
||||
<param name="overrideSpecifiedNames">
|
||||
A flag indicating whether explicitly specified property names should be processed,
|
||||
e.g. a property name customized with a <see cref="T:Newtonsoft.Json.JsonPropertyAttribute"/>.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCaseNamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver">
|
||||
<summary>
|
||||
Resolves member mappings for a type, camel casing property names.
|
||||
@@ -6891,13 +6954,6 @@
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the name of the property.
|
||||
</summary>
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<returns>The property name camel cased.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.DefaultContractResolver">
|
||||
<summary>
|
||||
Used by <see cref="T:Newtonsoft.Json.JsonSerializer"/> to resolves a <see cref="T:Newtonsoft.Json.Serialization.JsonContract"/> for a given <see cref="T:System.Type"/>.
|
||||
@@ -6926,6 +6982,12 @@
|
||||
<c>true</c> if serialized compiler generated members; otherwise, <c>false</c>.
|
||||
</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.DefaultContractResolver.NamingStrategy">
|
||||
<summary>
|
||||
Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized.
|
||||
</summary>
|
||||
<value>The naming strategy used to resolve how property names and dictionary keys are serialized.</value>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.DefaultContractResolver.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.DefaultContractResolver"/> class.
|
||||
@@ -7072,6 +7134,18 @@
|
||||
<param name="propertyName">Name of the property.</param>
|
||||
<returns>Name of the property.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.DefaultNamingStrategy">
|
||||
<summary>
|
||||
The default naming strategy. Property names and dictionary keys are unchanged.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.DefaultNamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.DefaultSerializationBinder">
|
||||
<summary>
|
||||
The default serialization binder used when resolving and loading classes from type names.
|
||||
@@ -7890,13 +7964,6 @@
|
||||
<param name="converterArgs">Optional arguments to pass to an initializing constructor of the JsonConverter.
|
||||
If null, the default constructor is used.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.JsonTypeReflector.GetJsonConverterCreator(System.Type)">
|
||||
<summary>
|
||||
Create a factory function that can be used to create instances of a JsonConverter described by the
|
||||
argument type. The returned function can then be used to either invoke the converter's default ctor, or any
|
||||
parameterized constructors by way of an object array.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.MemoryTraceWriter">
|
||||
<summary>
|
||||
Represents a trace writer that writes to memory. When the trace message limit is
|
||||
@@ -7940,6 +8007,46 @@
|
||||
A <see cref="T:System.String"/> of the most recent trace messages.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.NamingStrategy">
|
||||
<summary>
|
||||
A base class for resolving how property names and dictionary keys are serialized.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.NamingStrategy.ProcessDictionaryKeys">
|
||||
<summary>
|
||||
A flag indicating whether dictionary keys should be processed.
|
||||
Defaults to <c>false</c>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.NamingStrategy.OverrideSpecifiedNames">
|
||||
<summary>
|
||||
A flag indicating whether explicitly specified property names,
|
||||
e.g. a property name customized with a <see cref="T:Newtonsoft.Json.JsonPropertyAttribute"/>, should be processed.
|
||||
Defaults to <c>false</c>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.NamingStrategy.GetPropertyName(System.String,System.Boolean)">
|
||||
<summary>
|
||||
Gets the serialized name for a given property name.
|
||||
</summary>
|
||||
<param name="name">The initial property name.</param>
|
||||
<param name="hasSpecifiedName">A flag indicating whether the property has had a name explicitly specfied.</param>
|
||||
<returns>The serialized property name.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.NamingStrategy.GetDictionaryKey(System.String)">
|
||||
<summary>
|
||||
Gets the serialized key for a given dictionary key.
|
||||
</summary>
|
||||
<param name="key">The initial dictionary key.</param>
|
||||
<returns>The serialized dictionary key.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.NamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.ObjectConstructor`1">
|
||||
<summary>
|
||||
Represents a method that constructs an object.
|
||||
@@ -8002,6 +8109,35 @@
|
||||
<param name="target">The target to get the value from.</param>
|
||||
<returns>The value.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy">
|
||||
<summary>
|
||||
A snake case naming strategy.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy.#ctor(System.Boolean,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
<param name="processDictionaryKeys">
|
||||
A flag indicating whether dictionary keys should be processed.
|
||||
</param>
|
||||
<param name="overrideSpecifiedNames">
|
||||
A flag indicating whether explicitly specified property names should be processed,
|
||||
e.g. a property name customized with a <see cref="T:Newtonsoft.Json.JsonPropertyAttribute"/>.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.SnakeCaseNamingStrategy.ResolvePropertyName(System.String)">
|
||||
<summary>
|
||||
Resolves the specified property name.
|
||||
</summary>
|
||||
<param name="name">The property name to resolve.</param>
|
||||
<returns>The resolved property name.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.StringEscapeHandling">
|
||||
<summary>
|
||||
Specifies how strings are escaped when writing JSON text.
|
||||
@@ -8103,16 +8239,6 @@
|
||||
<param name="initial">The list to add to.</param>
|
||||
<param name="collection">The collection of elements to add.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Utilities.CollectionUtils.IndexOf``1(System.Collections.Generic.IEnumerable{``0},``0,System.Collections.Generic.IEqualityComparer{``0})">
|
||||
<summary>
|
||||
Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer{TSource}.
|
||||
</summary>
|
||||
<typeparam name="TSource">The type of the elements of source.</typeparam>
|
||||
<param name="list">A sequence in which to locate a value.</param>
|
||||
<param name="value">The object to locate in the sequence</param>
|
||||
<param name="comparer">An equality comparer to compare values.</param>
|
||||
<returns>The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(System.Object,System.Globalization.CultureInfo,System.Type)">
|
||||
<summary>
|
||||
Converts the value to the specified type. If the value is unable to be converted, the
|
||||
@@ -8222,13 +8348,6 @@
|
||||
<c>true</c> if the string is all white space; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Utilities.StringUtils.NullEmptyString(System.String)">
|
||||
<summary>
|
||||
Nulls an empty string.
|
||||
</summary>
|
||||
<param name="s">The string.</param>
|
||||
<returns>Null if the string was null, otherwise the string unchanged.</returns>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.WriteState">
|
||||
<summary>
|
||||
Specifies the state of the <see cref="T:Newtonsoft.Json.JsonWriter"/>.
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user