mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 06:20:34 +00:00
Compare commits
222 Commits
0.9.0.0-pr
...
2.0.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dac057d242 | ||
|
|
3d9fe36245 | ||
|
|
5c1da24def | ||
|
|
1e961a5945 | ||
|
|
84898146d2 | ||
|
|
552613e977 | ||
|
|
07687df91f | ||
|
|
1a4d941a2c | ||
|
|
cfbd880995 | ||
|
|
09abe77495 | ||
|
|
ac9943ff94 | ||
|
|
741dd2adb7 | ||
|
|
1ad5d3676f | ||
|
|
27254aa31e | ||
|
|
bb90dc1c01 | ||
|
|
292ec97b1c | ||
|
|
238cc2ad46 | ||
|
|
b9064bbfda | ||
|
|
eddcc2816a | ||
|
|
52360a682a | ||
|
|
709ce6489b | ||
|
|
220a9baa7d | ||
|
|
a7f2dd99c3 | ||
|
|
3481adb3c5 | ||
|
|
9f5197a426 | ||
|
|
f6a631a33a | ||
|
|
9dc04ff5a0 | ||
|
|
248d200764 | ||
|
|
e3d08eca3f | ||
|
|
dc5d2483c1 | ||
|
|
93aacad350 | ||
|
|
1b822bee91 | ||
|
|
c65d6fee5a | ||
|
|
6bc715575f | ||
|
|
335044e38a | ||
|
|
6a6232b655 | ||
|
|
75ff6b4f11 | ||
|
|
9cea6e35e4 | ||
|
|
52d8dc88d2 | ||
|
|
1d5a50bcca | ||
|
|
44a595c1df | ||
|
|
a528dee670 | ||
|
|
b6e96d8711 | ||
|
|
c6cc4e2c9d | ||
|
|
6974e51148 | ||
|
|
25da5fb650 | ||
|
|
a1e8af0660 | ||
|
|
af61ad66c6 | ||
|
|
a06af3402a | ||
|
|
08b7f18796 | ||
|
|
6feb1a46cc | ||
|
|
3f8e6125d1 | ||
|
|
ff887196c3 | ||
|
|
3509b1be8c | ||
|
|
b27aa50083 | ||
|
|
45230a57ee | ||
|
|
b3e420d423 | ||
|
|
65d9f4fbee | ||
|
|
935e11ab2a | ||
|
|
c2cd7ca52d | ||
|
|
120691c6bf | ||
|
|
334d2df4ef | ||
|
|
1a2616c648 | ||
|
|
9858c0e0c1 | ||
|
|
7f19d04e93 | ||
|
|
8ba497855b | ||
|
|
7ef8b224eb | ||
|
|
a841b9494a | ||
|
|
856351aea0 | ||
|
|
6a172ce269 | ||
|
|
f86bc32f0d | ||
|
|
18800ff8d5 | ||
|
|
3b610432ec | ||
|
|
b20423e415 | ||
|
|
e4189b2bc4 | ||
|
|
c5ac0196de | ||
|
|
8934e004fb | ||
|
|
ed0fd3df78 | ||
|
|
bd19cc794a | ||
|
|
c52a4be7e7 | ||
|
|
7ae29aa122 | ||
|
|
49d213290f | ||
|
|
fc618cb24f | ||
|
|
2826fdb475 | ||
|
|
b0e990f9f3 | ||
|
|
6a7a568e59 | ||
|
|
547be25b57 | ||
|
|
9559bcb3b8 | ||
|
|
049b78eb02 | ||
|
|
d55c734718 | ||
|
|
79b6fc8b17 | ||
|
|
8603e7a579 | ||
|
|
ea1b401228 | ||
|
|
ee73a12440 | ||
|
|
cad47368ac | ||
|
|
50c7d32ed7 | ||
|
|
eab136f635 | ||
|
|
ae829d7942 | ||
|
|
a3ab01bf0e | ||
|
|
4913d6c0a0 | ||
|
|
8c1ffda944 | ||
|
|
8d5d407c90 | ||
|
|
af4117690f | ||
|
|
f02be5753c | ||
|
|
691949eb08 | ||
|
|
42758eadc3 | ||
|
|
319822d1a1 | ||
|
|
948787f8ba | ||
|
|
73b5246a88 | ||
|
|
670091c293 | ||
|
|
1332d12087 | ||
|
|
55633c8d14 | ||
|
|
42f47740db | ||
|
|
aaf10cf8f8 | ||
|
|
3d54772da5 | ||
|
|
1b552b305b | ||
|
|
af93dc5b0e | ||
|
|
63e1598ebf | ||
|
|
aa2cf6dbe4 | ||
|
|
d507b40c97 | ||
|
|
3df34ece61 | ||
|
|
047af8912f | ||
|
|
fdef39887a | ||
|
|
e0d944efc5 | ||
|
|
74e416394a | ||
|
|
35fb7c4e7f | ||
|
|
8d06dd90d8 | ||
|
|
254b0a7773 | ||
|
|
3fc51af261 | ||
|
|
20ea58981d | ||
|
|
f8c1582aeb | ||
|
|
13722ca8f8 | ||
|
|
da3537eba2 | ||
|
|
67f0b0f8e9 | ||
|
|
08a962e688 | ||
|
|
5b711f158d | ||
|
|
0ddcf004c1 | ||
|
|
4997cc48ca | ||
|
|
51bcf73e15 | ||
|
|
d7b21ded96 | ||
|
|
daf4efa054 | ||
|
|
6a12a26612 | ||
|
|
533058aa3f | ||
|
|
804d1260f2 | ||
|
|
78fcf53606 | ||
|
|
ceb641d1fa | ||
|
|
47fdff2993 | ||
|
|
1a96a975f9 | ||
|
|
cd460c5ec5 | ||
|
|
70b7f9d5dd | ||
|
|
f236d6c33f | ||
|
|
356df9098e | ||
|
|
9a8aa1e10d | ||
|
|
7aa985154f | ||
|
|
d287674d69 | ||
|
|
40b1e8f4c2 | ||
|
|
d38fde0359 | ||
|
|
e6015ca999 | ||
|
|
3bcecc6256 | ||
|
|
6cf264dcf7 | ||
|
|
b12db11956 | ||
|
|
591d665d56 | ||
|
|
327cae955a | ||
|
|
9fa23ecddf | ||
|
|
ab3bfe2460 | ||
|
|
465ca2d4f9 | ||
|
|
21e892c042 | ||
|
|
98be9e1efd | ||
|
|
3081bfe814 | ||
|
|
61e4461bc4 | ||
|
|
5c2bcd551c | ||
|
|
15f9eb4e80 | ||
|
|
5038527c90 | ||
|
|
e8370987ea | ||
|
|
3f7660526d | ||
|
|
f484b50ab3 | ||
|
|
55000c7653 | ||
|
|
4cd2444a1a | ||
|
|
4f23d2e874 | ||
|
|
76bdd898e1 | ||
|
|
a45cf02d52 | ||
|
|
828c76e201 | ||
|
|
32e68f2be3 | ||
|
|
de3f3cd93b | ||
|
|
31fb6fec08 | ||
|
|
cf2473a3d5 | ||
|
|
0d44379948 | ||
|
|
43264e77b2 | ||
|
|
c09af9b937 | ||
|
|
c84565f091 | ||
|
|
d07f1c6852 | ||
|
|
754b52647b | ||
|
|
9f4ed24704 | ||
|
|
015c6b7bdf | ||
|
|
a17c1fc35a | ||
|
|
19e46ce78d | ||
|
|
cf6ee3b60d | ||
|
|
488003993f | ||
|
|
c64a6fabbc | ||
|
|
eb2751861d | ||
|
|
48a1cf1189 | ||
|
|
98e1d51a48 | ||
|
|
5e22c832a2 | ||
|
|
6523b30f10 | ||
|
|
8fefa7c5af | ||
|
|
b6a5b8942c | ||
|
|
cd622989d6 | ||
|
|
8251274bf8 | ||
|
|
dd63c97ced | ||
|
|
b17960096e | ||
|
|
83934af041 | ||
|
|
0421da30cd | ||
|
|
bf084a1ffb | ||
|
|
f3868b9acc | ||
|
|
7c3d195fd4 | ||
|
|
4d7294feac | ||
|
|
6877abed6e | ||
|
|
5353d755a0 | ||
|
|
d2dff449d1 | ||
|
|
d526c6c1ce | ||
|
|
49fc908f0f | ||
|
|
b3162ce390 |
10
.gitignore
vendored
10
.gitignore
vendored
@@ -2,9 +2,15 @@
|
||||
## ArchiSteamFarm
|
||||
#################
|
||||
|
||||
# Ignore all config files, apart from example.xml
|
||||
# Ignore all config files, apart from ones we want to include
|
||||
ArchiSteamFarm/config/*
|
||||
!ArchiSteamFarm/config/example.xml
|
||||
!ArchiSteamFarm/config/ASF.json
|
||||
!ArchiSteamFarm/config/example.json
|
||||
!ArchiSteamFarm/config/minimal.json
|
||||
|
||||
# Ignore local debugging
|
||||
ArchiSteamFarm/log.txt
|
||||
ArchiSteamFarm/debug/*
|
||||
|
||||
#################
|
||||
## Eclipse
|
||||
|
||||
@@ -5,6 +5,8 @@ VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArchiSteamFarm", "ArchiSteamFarm\ArchiSteamFarm.csproj", "{35AF7887-08B9-40E8-A5EA-797D8B60B30C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SteamAuth", "SteamAuth\SteamAuth.csproj", "{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -15,6 +17,10 @@ Global
|
||||
{35AF7887-08B9-40E8-A5EA-797D8B60B30C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{35AF7887-08B9-40E8-A5EA-797D8B60B30C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{35AF7887-08B9-40E8-A5EA-797D8B60B30C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
</configuration>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -24,73 +24,194 @@
|
||||
|
||||
using SteamKit2;
|
||||
using SteamKit2.Internal;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class ArchiHandler : ClientMsgHandler {
|
||||
/*
|
||||
____ _ _ _ _
|
||||
/ ___| __ _ | || || |__ __ _ ___ | | __ ___
|
||||
| | / _` || || || '_ \ / _` | / __|| |/ // __|
|
||||
| |___| (_| || || || |_) || (_| || (__ | < \__ \
|
||||
\____|\__,_||_||_||_.__/ \__,_| \___||_|\_\|___/
|
||||
|
||||
*/
|
||||
|
||||
internal sealed class NotificationsCallback : CallbackMsg {
|
||||
internal sealed class Notification {
|
||||
internal enum ENotificationType : uint {
|
||||
Unknown = 0,
|
||||
Trading = 1,
|
||||
// Only custom below, different than ones available as user_notification_type
|
||||
Items = 514
|
||||
}
|
||||
|
||||
internal readonly ENotificationType NotificationType;
|
||||
|
||||
internal Notification(ENotificationType notificationType) {
|
||||
NotificationType = notificationType;
|
||||
}
|
||||
}
|
||||
|
||||
internal readonly List<Notification> Notifications;
|
||||
|
||||
internal NotificationsCallback(JobID jobID, CMsgClientUserNotifications msg) {
|
||||
JobID = jobID;
|
||||
|
||||
if (msg == null || msg.notifications == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Notifications = new List<Notification>(msg.notifications.Count);
|
||||
foreach (var notification in msg.notifications) {
|
||||
Notifications.Add(new Notification((Notification.ENotificationType) notification.user_notification_type));
|
||||
}
|
||||
}
|
||||
|
||||
internal NotificationsCallback(JobID jobID, CMsgClientItemAnnouncements msg) {
|
||||
JobID = jobID;
|
||||
|
||||
if (msg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg.count_new_items > 0) {
|
||||
Notifications = new List<Notification>(1) {
|
||||
new Notification(Notification.ENotificationType.Items)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class OfflineMessageCallback : CallbackMsg {
|
||||
internal readonly uint OfflineMessages;
|
||||
internal readonly List<uint> Users;
|
||||
|
||||
internal OfflineMessageCallback(JobID jobID, CMsgClientOfflineMessageNotification msg) {
|
||||
JobID = jobID;
|
||||
|
||||
if (msg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
OfflineMessages = msg.offline_messages;
|
||||
Users = msg.friends_with_offline_messages;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class PurchaseResponseCallback : CallbackMsg {
|
||||
internal enum EPurchaseResult {
|
||||
internal enum EPurchaseResult : int {
|
||||
Unknown = -1,
|
||||
OK = 0,
|
||||
AlreadyOwned = 9,
|
||||
RegionLockedKey = 13,
|
||||
RegionLocked = 13,
|
||||
InvalidKey = 14,
|
||||
DuplicatedKey = 15,
|
||||
BaseGameRequired = 24,
|
||||
OnCooldown = 53
|
||||
}
|
||||
|
||||
internal EResult Result { get; private set; }
|
||||
internal EPurchaseResult PurchaseResult { get; private set; }
|
||||
internal KeyValue ReceiptInfo { get; private set; } = new KeyValue();
|
||||
internal Dictionary<uint, string> Items { get; private set; } = new Dictionary<uint, string>();
|
||||
internal readonly EResult Result;
|
||||
internal readonly EPurchaseResult PurchaseResult;
|
||||
internal readonly KeyValue ReceiptInfo;
|
||||
internal readonly Dictionary<uint, string> Items;
|
||||
|
||||
internal PurchaseResponseCallback(CMsgClientPurchaseResponse body) {
|
||||
Result = (EResult) body.eresult;
|
||||
PurchaseResult = (EPurchaseResult) body.purchase_result_details;
|
||||
internal PurchaseResponseCallback(JobID jobID, CMsgClientPurchaseResponse msg) {
|
||||
JobID = jobID;
|
||||
|
||||
using (MemoryStream ms = new MemoryStream(body.purchase_receipt_info)) {
|
||||
if (msg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Result = (EResult) msg.eresult;
|
||||
PurchaseResult = (EPurchaseResult) msg.purchase_result_details;
|
||||
|
||||
if (msg.purchase_receipt_info == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ReceiptInfo = new KeyValue();
|
||||
using (MemoryStream ms = new MemoryStream(msg.purchase_receipt_info)) {
|
||||
if (!ReceiptInfo.TryReadAsBinary(ms)) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (KeyValue lineItem in ReceiptInfo["lineitems"].Children) {
|
||||
Items.Add((uint) lineItem["PackageID"].AsUnsignedLong(), lineItem["ItemDescription"].AsString());
|
||||
List<KeyValue> lineItems = ReceiptInfo["lineitems"].Children;
|
||||
Items = new Dictionary<uint, string>(lineItems.Count);
|
||||
|
||||
foreach (KeyValue lineItem in lineItems) {
|
||||
uint appID = (uint) lineItem["PackageID"].AsUnsignedLong();
|
||||
string gameName = lineItem["ItemDescription"].AsString();
|
||||
gameName = WebUtility.UrlDecode(gameName); // Apparently steam expects client to decode sent HTML
|
||||
Items.Add(appID, gameName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class NotificationCallback : CallbackMsg {
|
||||
internal enum ENotificationType {
|
||||
Unknown = 0,
|
||||
Trading = 1,
|
||||
}
|
||||
/*
|
||||
__ __ _ _ _
|
||||
| \/ | ___ | |_ | |__ ___ __| | ___
|
||||
| |\/| | / _ \| __|| '_ \ / _ \ / _` |/ __|
|
||||
| | | || __/| |_ | | | || (_) || (_| |\__ \
|
||||
|_| |_| \___| \__||_| |_| \___/ \__,_||___/
|
||||
|
||||
internal ENotificationType NotificationType { get; private set; }
|
||||
|
||||
internal NotificationCallback(CMsgClientUserNotifications.Notification body) {
|
||||
NotificationType = (ENotificationType) body.user_notification_type;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
internal void AcceptClanInvite(ulong clanID) {
|
||||
if (clanID == 0 || !Client.IsConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
var request = new ClientMsg<CMsgClientClanInviteAction>((int) EMsg.ClientAcknowledgeClanInvite);
|
||||
request.Body.GroupID = clanID;
|
||||
request.Body.AcceptInvite = true;
|
||||
|
||||
Client.Send(request);
|
||||
}
|
||||
|
||||
internal void DeclineClanInvite(ulong clanID) {
|
||||
if (clanID == 0 || !Client.IsConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
var request = new ClientMsg<CMsgClientClanInviteAction>((int) EMsg.ClientAcknowledgeClanInvite);
|
||||
request.Body.GroupID = clanID;
|
||||
request.Body.AcceptInvite = false;
|
||||
|
||||
Client.Send(request);
|
||||
}
|
||||
|
||||
internal void PlayGame(string gameName) {
|
||||
if (!Client.IsConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
var request = new ClientMsgProtobuf<CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed);
|
||||
|
||||
var gamePlayed = new CMsgClientGamesPlayed.GamePlayed();
|
||||
if (!string.IsNullOrEmpty(gameName)) {
|
||||
gamePlayed.game_id = new GameID() {
|
||||
AppType = GameID.GameType.Shortcut,
|
||||
ModID = uint.MaxValue
|
||||
};
|
||||
gamePlayed.game_extra_info = gameName;
|
||||
}
|
||||
|
||||
request.Body.games_played.Add(gamePlayed);
|
||||
|
||||
Client.Send(request);
|
||||
}
|
||||
|
||||
internal void PlayGames(params uint[] gameIDs) {
|
||||
if (!Client.IsConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
var request = new ClientMsgProtobuf<CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed);
|
||||
foreach (uint gameID in gameIDs) {
|
||||
if (gameID == 0) {
|
||||
@@ -101,10 +222,15 @@ namespace ArchiSteamFarm {
|
||||
game_id = new GameID(gameID),
|
||||
});
|
||||
}
|
||||
|
||||
Client.Send(request);
|
||||
}
|
||||
|
||||
internal void PlayGames(ICollection<uint> gameIDs) {
|
||||
if (gameIDs == null || !Client.IsConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
var request = new ClientMsgProtobuf<CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed);
|
||||
foreach (uint gameID in gameIDs) {
|
||||
if (gameID == 0) {
|
||||
@@ -115,22 +241,51 @@ namespace ArchiSteamFarm {
|
||||
game_id = new GameID(gameID),
|
||||
});
|
||||
}
|
||||
|
||||
Client.Send(request);
|
||||
}
|
||||
|
||||
// Will provide result in ClientPurchaseResponse, regardless if success or not
|
||||
internal void RedeemKey(string key) {
|
||||
var request = new ClientMsgProtobuf<CMsgClientRegisterKey>(EMsg.ClientRegisterKey);
|
||||
internal async Task<PurchaseResponseCallback> RedeemKey(string key) {
|
||||
if (string.IsNullOrEmpty(key) || !Client.IsConnected) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var request = new ClientMsgProtobuf<CMsgClientRegisterKey>(EMsg.ClientRegisterKey) {
|
||||
SourceJobID = Client.GetNextJobID()
|
||||
};
|
||||
|
||||
request.Body.key = key;
|
||||
|
||||
Client.Send(request);
|
||||
try {
|
||||
return await new AsyncJob<PurchaseResponseCallback>(Client, request.SourceJobID);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed override void HandleMsg(IPacketMsg packetMsg) {
|
||||
/*
|
||||
_ _ _ _
|
||||
| | | | __ _ _ __ __| || | ___ _ __ ___
|
||||
| |_| | / _` || '_ \ / _` || | / _ \| '__|/ __|
|
||||
| _ || (_| || | | || (_| || || __/| | \__ \
|
||||
|_| |_| \__,_||_| |_| \__,_||_| \___||_| |___/
|
||||
|
||||
*/
|
||||
|
||||
public override void HandleMsg(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (packetMsg.MsgType) {
|
||||
case EMsg.ClientFSOfflineMessageNotification:
|
||||
HandleFSOfflineMessageNotification(packetMsg);
|
||||
break;
|
||||
case EMsg.ClientItemAnnouncements:
|
||||
HandleItemAnnouncements(packetMsg);
|
||||
break;
|
||||
case EMsg.ClientPurchaseResponse:
|
||||
HandlePurchaseResponse(packetMsg);
|
||||
break;
|
||||
@@ -140,16 +295,40 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleFSOfflineMessageNotification(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var response = new ClientMsgProtobuf<CMsgClientOfflineMessageNotification>(packetMsg);
|
||||
Client.PostCallback(new OfflineMessageCallback(packetMsg.TargetJobID, response.Body));
|
||||
}
|
||||
|
||||
private void HandleItemAnnouncements(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var response = new ClientMsgProtobuf<CMsgClientItemAnnouncements>(packetMsg);
|
||||
Client.PostCallback(new NotificationsCallback(packetMsg.TargetJobID, response.Body));
|
||||
}
|
||||
|
||||
private void HandlePurchaseResponse(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var response = new ClientMsgProtobuf<CMsgClientPurchaseResponse>(packetMsg);
|
||||
Client.PostCallback(new PurchaseResponseCallback(response.Body));
|
||||
Client.PostCallback(new PurchaseResponseCallback(packetMsg.TargetJobID, response.Body));
|
||||
}
|
||||
|
||||
private void HandleUserNotifications(IPacketMsg packetMsg) {
|
||||
var response = new ClientMsgProtobuf<CMsgClientUserNotifications>(packetMsg);
|
||||
foreach (var notification in response.Body.notifications) {
|
||||
Client.PostCallback(new NotificationCallback(notification));
|
||||
if (packetMsg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var response = new ClientMsgProtobuf<CMsgClientUserNotifications>(packetMsg);
|
||||
Client.PostCallback(new NotificationsCallback(packetMsg.TargetJobID, response.Body));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,10 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ArchiSteamFarm</RootNamespace>
|
||||
<AssemblyName>ArchiSteamFarm</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<TargetFrameworkProfile />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
@@ -35,7 +36,7 @@
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -46,7 +47,7 @@
|
||||
</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
@@ -59,25 +60,36 @@
|
||||
<PropertyGroup>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DelaySign>false</DelaySign>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="HtmlAgilityPack, Version=1.4.9.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
|
||||
<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.1-beta3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\packages\Newtonsoft.Json.8.0.2\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">
|
||||
<HintPath>..\packages\protobuf-net.2.0.0.668\lib\net40\protobuf-net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SteamKit2, Version=1.6.5.29095, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamKit2.1.6.5\lib\net40\SteamKit2.dll</HintPath>
|
||||
<Reference Include="SteamKit2, Version=1.7.0.33680, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamKit2.1.7.0\lib\net45\SteamKit2.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -89,20 +101,37 @@
|
||||
<Compile Include="ArchiHandler.cs" />
|
||||
<Compile Include="ArchiWebHandler.cs" />
|
||||
<Compile Include="Bot.cs" />
|
||||
<Compile Include="BotConfig.cs" />
|
||||
<Compile Include="GlobalDatabase.cs" />
|
||||
<Compile Include="BotDatabase.cs" />
|
||||
<Compile Include="CardsFarmer.cs" />
|
||||
<Compile Include="CMsgClientClanInviteAction.cs" />
|
||||
<Compile Include="Debugging.cs" />
|
||||
<Compile Include="GlobalConfig.cs" />
|
||||
<Compile Include="JSON\GitHub.cs" />
|
||||
<Compile Include="Logging.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SteamItem.cs" />
|
||||
<Compile Include="SteamItemList.cs" />
|
||||
<Compile Include="SteamTradeOffer.cs" />
|
||||
<Compile Include="SteamTradeOfferRequest.cs" />
|
||||
<Compile Include="Trading.cs" />
|
||||
<Compile Include="Utilities.cs" />
|
||||
<Compile Include="WCF.cs" />
|
||||
<Compile Include="WebBrowser.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="config\ASF.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="config\example.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="config\minimal.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -119,22 +148,36 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="cirno.ico" />
|
||||
<Content Include="config\example.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SteamAuth\SteamAuth.csproj">
|
||||
<Project>{5ad0934e-f6c4-4ae5-83af-c788313b2a87}</Project>
|
||||
<Name>SteamAuth</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent Condition=" '$(OS)' != 'Unix' ">if $(ConfigurationName) == Release (
|
||||
mkdir "$(TargetDir)out" "$(TargetDir)out\config"
|
||||
copy "$(TargetDir)config\example.xml" "$(TargetDir)out\config"
|
||||
"$(SolutionDir)tools\ILMerge.exe" /out:"$(TargetDir)out\ASF.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" /target:exe /targetplatform:v4,C:\Windows\Microsoft.NET\Framework64\v4.0.30319 /wildcards
|
||||
del "$(TargetDir)out\ASF.pdb"
|
||||
)</PostBuildEvent>
|
||||
<PostBuildEvent Condition=" '$(OS)' != 'Unix' AND '$(ConfigurationName)' == 'Release' ">
|
||||
mkdir "$(TargetDir)out" "$(TargetDir)out\config"
|
||||
copy "$(TargetDir)config\ASF.json" "$(TargetDir)out\config"
|
||||
copy "$(TargetDir)config\example.json" "$(TargetDir)out\config"
|
||||
copy "$(TargetDir)config\minimal.json" "$(TargetDir)out\config"
|
||||
"$(SolutionDir)tools\ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(TargetDir)out\ASF.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
|
||||
del "$(TargetDir)out\ASF.exe.config"
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent Condition=" '$(OS)' == 'Unix' AND '$(ConfigurationName)' == 'Release' ">
|
||||
mkdir -p "$(TargetDir)out" "$(TargetDir)out/config"
|
||||
cp "$(TargetDir)config/ASF.json" "$(TargetDir)out/config"
|
||||
cp "$(TargetDir)config/example.json" "$(TargetDir)out/config"
|
||||
cp "$(TargetDir)config/minimal.json" "$(TargetDir)out/config"
|
||||
mono -O=all "$(SolutionDir)tools/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(TargetDir)out/ASF.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
|
||||
rm "$(TargetDir)out/ASF.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.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -21,12 +21,12 @@
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using HtmlAgilityPack;
|
||||
using SteamKit2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
@@ -34,43 +34,29 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class ArchiWebHandler {
|
||||
private const int Timeout = 1000 * WebBrowser.HttpTimeout; // In miliseconds
|
||||
private static int Timeout = 30 * 1000;
|
||||
|
||||
private readonly Bot Bot;
|
||||
private readonly string ApiKey;
|
||||
private readonly Dictionary<string, string> SteamCookieDictionary = new Dictionary<string, string>();
|
||||
private readonly Dictionary<string, string> Cookie = new Dictionary<string, string>(4);
|
||||
|
||||
private ulong SteamID;
|
||||
private string VanityURL;
|
||||
|
||||
// This is required because home_process request must be done on final URL
|
||||
private string GetHomeProcess() {
|
||||
if (!string.IsNullOrEmpty(VanityURL)) {
|
||||
return "http://steamcommunity.com/id/" + VanityURL + "/home_process";
|
||||
} else if (SteamID != 0) {
|
||||
return "http://steamcommunity.com/profiles/" + SteamID + "/home_process";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
internal static void Init() {
|
||||
Timeout = Program.GlobalConfig.HttpTimeout * 1000;
|
||||
}
|
||||
|
||||
internal ArchiWebHandler(Bot bot, string apiKey) {
|
||||
internal ArchiWebHandler(Bot bot) {
|
||||
Bot = bot;
|
||||
|
||||
if (!string.IsNullOrEmpty(apiKey) && !apiKey.Equals("null")) {
|
||||
ApiKey = apiKey;
|
||||
}
|
||||
}
|
||||
|
||||
internal async Task Init(SteamClient steamClient, string webAPIUserNonce, string vanityURL, string parentalPin) {
|
||||
internal async Task<bool> Init(SteamClient steamClient, string webAPIUserNonce, string parentalPin) {
|
||||
if (steamClient == null || steamClient.SteamID == null || string.IsNullOrEmpty(webAPIUserNonce)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
SteamID = steamClient.SteamID;
|
||||
VanityURL = vanityURL;
|
||||
|
||||
string sessionID = Convert.ToBase64String(Encoding.UTF8.GetBytes(SteamID.ToString(CultureInfo.InvariantCulture)));
|
||||
string sessionID = Convert.ToBase64String(Encoding.UTF8.GetBytes(SteamID.ToString()));
|
||||
|
||||
// Generate an AES session key
|
||||
byte[] sessionKey = CryptoHelper.GenerateRandomBlock(32);
|
||||
@@ -82,15 +68,16 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
// Copy our login key
|
||||
byte[] loginKey = new byte[20];
|
||||
byte[] loginKey = new byte[webAPIUserNonce.Length];
|
||||
Array.Copy(Encoding.ASCII.GetBytes(webAPIUserNonce), loginKey, webAPIUserNonce.Length);
|
||||
|
||||
// AES encrypt the loginkey with our session key
|
||||
byte[] cryptedLoginKey = CryptoHelper.SymmetricEncrypt(loginKey, sessionKey);
|
||||
|
||||
// Send the magic
|
||||
// Do the magic
|
||||
Logging.LogGenericInfo("Logging in to ISteamUserAuth...", Bot.BotName);
|
||||
|
||||
KeyValue authResult;
|
||||
Logging.LogGenericInfo(Bot.BotName, "Logging in to ISteamUserAuth...");
|
||||
using (dynamic iSteamUserAuth = WebAPI.GetInterface("ISteamUserAuth")) {
|
||||
iSteamUserAuth.Timeout = Timeout;
|
||||
|
||||
@@ -103,79 +90,85 @@ namespace ArchiSteamFarm {
|
||||
secure: true
|
||||
);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(Bot.BotName, e);
|
||||
steamClient.Disconnect(); // We may get 403 if we use the same webAPIUserNonce twice
|
||||
return;
|
||||
Logging.LogGenericException(e, Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (authResult == null) {
|
||||
steamClient.Disconnect(); // Try again
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo(Bot.BotName, "Success!");
|
||||
Logging.LogGenericInfo("Success!", Bot.BotName);
|
||||
|
||||
string steamLogin = authResult["token"].AsString();
|
||||
string steamLoginSecure = authResult["tokensecure"].AsString();
|
||||
|
||||
SteamCookieDictionary.Clear();
|
||||
SteamCookieDictionary.Add("sessionid", sessionID);
|
||||
SteamCookieDictionary.Add("steamLogin", steamLogin);
|
||||
SteamCookieDictionary.Add("steamLoginSecure", steamLoginSecure);
|
||||
SteamCookieDictionary.Add("birthtime", "-473356799"); // ( ͡° ͜ʖ ͡°)
|
||||
Cookie["sessionid"] = sessionID;
|
||||
Cookie["steamLogin"] = steamLogin;
|
||||
Cookie["steamLoginSecure"] = steamLoginSecure;
|
||||
|
||||
if (!string.IsNullOrEmpty(parentalPin) && !parentalPin.Equals("0")) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Unlocking parental account...");
|
||||
Dictionary<string, string> postData = new Dictionary<string, string>() {
|
||||
{"pin", parentalPin}
|
||||
};
|
||||
// The below is used for display purposes only
|
||||
Cookie["webTradeEligibility"] = "{\"allowed\":0,\"reason\":0,\"allowed_at_time\":0,\"steamguard_required_days\":0,\"sales_this_year\":0,\"max_sales_per_year\":0,\"forms_requested\":0}";
|
||||
|
||||
HttpResponseMessage response = await WebBrowser.UrlPost("https://steamcommunity.com/parental/ajaxunlock", postData, SteamCookieDictionary, "https://steamcommunity.com/").ConfigureAwait(false);
|
||||
if (response != null && response.IsSuccessStatusCode) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Success!");
|
||||
|
||||
var setCookieValues = response.Headers.GetValues("Set-Cookie");
|
||||
foreach (string setCookieValue in setCookieValues) {
|
||||
if (setCookieValue.Contains("steamparental=")) {
|
||||
string setCookie = setCookieValue.Substring(setCookieValue.IndexOf("steamparental=") + 14);
|
||||
setCookie = setCookie.Substring(0, setCookie.IndexOf(';'));
|
||||
SteamCookieDictionary.Add("steamparental", setCookie);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Failed!");
|
||||
}
|
||||
}
|
||||
|
||||
Bot.Trading.CheckTrades();
|
||||
await UnlockParentalAccount(parentalPin).ConfigureAwait(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
internal List<SteamTradeOffer> GetTradeOffers() {
|
||||
if (ApiKey == null) {
|
||||
internal async Task<bool?> IsLoggedIn() {
|
||||
if (SteamID == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
HtmlDocument htmlDocument = null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && htmlDocument == null; i++) {
|
||||
htmlDocument = await WebBrowser.UrlGetToHtmlDocument("https://steamcommunity.com/my/profile", Cookie).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (htmlDocument == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
KeyValue response;
|
||||
using (dynamic iEconService = WebAPI.GetInterface("IEconService")) {
|
||||
// Timeout
|
||||
HtmlNode htmlNode = htmlDocument.DocumentNode.SelectSingleNode("//span[@id='account_pulldown']");
|
||||
return htmlNode != null;
|
||||
}
|
||||
|
||||
internal async Task<bool> ReconnectIfNeeded() {
|
||||
bool? isLoggedIn = await IsLoggedIn().ConfigureAwait(false);
|
||||
if (isLoggedIn.HasValue && !isLoggedIn.Value) {
|
||||
Logging.LogGenericInfo("Reconnecting because our sessionID expired!", Bot.BotName);
|
||||
Task.Run(async () => await Bot.Restart().ConfigureAwait(false)).Forget();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
internal List<SteamTradeOffer> GetTradeOffers() {
|
||||
if (string.IsNullOrEmpty(Bot.BotConfig.SteamApiKey)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
KeyValue response = null;
|
||||
using (dynamic iEconService = WebAPI.GetInterface("IEconService", Bot.BotConfig.SteamApiKey)) {
|
||||
iEconService.Timeout = Timeout;
|
||||
|
||||
try {
|
||||
response = iEconService.GetTradeOffers(
|
||||
key: ApiKey,
|
||||
get_received_offers: 1,
|
||||
active_only: 1,
|
||||
secure: true
|
||||
);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(Bot.BotName, e);
|
||||
return null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && response == null; i++) {
|
||||
try {
|
||||
response = iEconService.GetTradeOffers(
|
||||
get_received_offers: 1,
|
||||
active_only: 1,
|
||||
secure: true
|
||||
);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e, Bot.BotName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -184,26 +177,16 @@ namespace ArchiSteamFarm {
|
||||
SteamTradeOffer tradeOffer = new SteamTradeOffer {
|
||||
tradeofferid = trade["tradeofferid"].AsString(),
|
||||
accountid_other = trade["accountid_other"].AsInteger(),
|
||||
message = trade["message"].AsString(),
|
||||
expiration_time = trade["expiration_time"].AsInteger(),
|
||||
trade_offer_state = (SteamTradeOffer.ETradeOfferState) trade["trade_offer_state"].AsInteger(),
|
||||
items_to_give = new List<SteamItem>(),
|
||||
items_to_receive = new List<SteamItem>(),
|
||||
is_our_offer = trade["is_our_offer"].AsBoolean(),
|
||||
time_created = trade["time_created"].AsInteger(),
|
||||
time_updated = trade["time_updated"].AsInteger(),
|
||||
from_real_time_trade = trade["from_real_time_trade"].AsBoolean()
|
||||
trade_offer_state = trade["trade_offer_state"].AsEnum<SteamTradeOffer.ETradeOfferState>()
|
||||
};
|
||||
foreach (KeyValue item in trade["items_to_give"].Children) {
|
||||
tradeOffer.items_to_give.Add(new SteamItem {
|
||||
appid = item["appid"].AsString(),
|
||||
contextid = item["contextid"].AsString(),
|
||||
assetid = item["assetid"].AsString(),
|
||||
currencyid = item["currencyid"].AsString(),
|
||||
classid = item["classid"].AsString(),
|
||||
instanceid = item["instanceid"].AsString(),
|
||||
amount = item["amount"].AsString(),
|
||||
missing = item["missing"].AsBoolean()
|
||||
});
|
||||
}
|
||||
foreach (KeyValue item in trade["items_to_receive"].Children) {
|
||||
@@ -211,11 +194,9 @@ namespace ArchiSteamFarm {
|
||||
appid = item["appid"].AsString(),
|
||||
contextid = item["contextid"].AsString(),
|
||||
assetid = item["assetid"].AsString(),
|
||||
currencyid = item["currencyid"].AsString(),
|
||||
classid = item["classid"].AsString(),
|
||||
instanceid = item["instanceid"].AsString(),
|
||||
amount = item["amount"].AsString(),
|
||||
missing = item["missing"].AsBoolean()
|
||||
});
|
||||
}
|
||||
result.Add(tradeOffer);
|
||||
@@ -224,44 +205,34 @@ namespace ArchiSteamFarm {
|
||||
return result;
|
||||
}
|
||||
|
||||
internal async Task JoinClan(ulong clanID) {
|
||||
internal async Task<bool> JoinClan(ulong clanID) {
|
||||
if (clanID == 0) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
string sessionID;
|
||||
if (!SteamCookieDictionary.TryGetValue("sessionid", out sessionID)) {
|
||||
return;
|
||||
if (!Cookie.TryGetValue("sessionid", out sessionID)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
string request = "http://steamcommunity.com/gid/" + clanID;
|
||||
string request = "https://steamcommunity.com/gid/" + clanID;
|
||||
|
||||
Dictionary<string, string> postData = new Dictionary<string, string>() {
|
||||
Dictionary<string, string> data = new Dictionary<string, string>(2) {
|
||||
{"sessionID", sessionID},
|
||||
{"action", "join"}
|
||||
};
|
||||
|
||||
await WebBrowser.UrlPost(request, postData, SteamCookieDictionary).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal async Task LeaveClan(ulong clanID) {
|
||||
if (clanID == 0) {
|
||||
return;
|
||||
HttpResponseMessage response = null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && response == null; i++) {
|
||||
response = await WebBrowser.UrlPost(request, data, Cookie).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
string sessionID;
|
||||
if (!SteamCookieDictionary.TryGetValue("sessionid", out sessionID)) {
|
||||
return;
|
||||
if (response == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
string request = GetHomeProcess();
|
||||
Dictionary<string, string> postData = new Dictionary<string, string>() {
|
||||
{"sessionID", sessionID},
|
||||
{"action", "leaveGroup"},
|
||||
{"groupId", clanID.ToString()}
|
||||
};
|
||||
|
||||
await WebBrowser.UrlPost(request, postData, SteamCookieDictionary).ConfigureAwait(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
internal async Task<bool> AcceptTradeOffer(ulong tradeID) {
|
||||
@@ -270,84 +241,241 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
string sessionID;
|
||||
if (!SteamCookieDictionary.TryGetValue("sessionid", out sessionID)) {
|
||||
if (!Cookie.TryGetValue("sessionid", out sessionID)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
string referer = "https://steamcommunity.com/tradeoffer/" + tradeID + "/";
|
||||
string request = referer + "accept";
|
||||
string referer = "https://steamcommunity.com/tradeoffer/" + tradeID;
|
||||
string request = referer + "/accept";
|
||||
|
||||
Dictionary<string, string> postData = new Dictionary<string, string>() {
|
||||
Dictionary<string, string> data = new Dictionary<string, string>(3) {
|
||||
{"sessionid", sessionID},
|
||||
{"serverid", "1"},
|
||||
{"tradeofferid", tradeID.ToString()}
|
||||
};
|
||||
|
||||
HttpResponseMessage result = await WebBrowser.UrlPost(request, postData, SteamCookieDictionary, referer).ConfigureAwait(false);
|
||||
if (result == null) {
|
||||
HttpResponseMessage response = null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && response == null; i++) {
|
||||
response = await WebBrowser.UrlPost(request, data, Cookie, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool success = result.IsSuccessStatusCode;
|
||||
|
||||
if (!success) {
|
||||
Logging.LogGenericWarning(Bot.BotName, "Request failed, reason: " + result.ReasonPhrase);
|
||||
switch (result.StatusCode) {
|
||||
case HttpStatusCode.InternalServerError:
|
||||
Logging.LogGenericWarning(Bot.BotName, "That might be caused by 7-days trade lock from new device");
|
||||
Logging.LogGenericWarning(Bot.BotName, "Try again in 7 days, declining that offer for now");
|
||||
DeclineTradeOffer(tradeID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
return true;
|
||||
}
|
||||
|
||||
internal bool DeclineTradeOffer(ulong tradeID) {
|
||||
if (ApiKey == null) {
|
||||
if (tradeID == 0 || string.IsNullOrEmpty(Bot.BotConfig.SteamApiKey)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tradeID == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
KeyValue response;
|
||||
using (dynamic iEconService = WebAPI.GetInterface("IEconService")) {
|
||||
// Timeout
|
||||
KeyValue response = null;
|
||||
using (dynamic iEconService = WebAPI.GetInterface("IEconService", Bot.BotConfig.SteamApiKey)) {
|
||||
iEconService.Timeout = Timeout;
|
||||
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && response == null; i++) {
|
||||
try {
|
||||
response = iEconService.DeclineTradeOffer(
|
||||
tradeofferid: tradeID.ToString(),
|
||||
method: WebRequestMethods.Http.Post,
|
||||
secure: true
|
||||
);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e, Bot.BotName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
internal async Task<List<SteamItem>> GetMyTradableInventory() {
|
||||
JObject jObject = null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && jObject == null; i++) {
|
||||
jObject = await WebBrowser.UrlGetToJObject("https://steamcommunity.com/my/inventory/json/753/6?trading=1", Cookie).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (jObject == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
IEnumerable<JToken> jTokens = jObject.SelectTokens("$.rgInventory.*");
|
||||
if (jTokens == null) {
|
||||
Logging.LogNullError("jTokens", Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
List<SteamItem> result = new List<SteamItem>();
|
||||
foreach (JToken jToken in jTokens) {
|
||||
try {
|
||||
response = iEconService.DeclineTradeOffer(
|
||||
key: ApiKey,
|
||||
tradeofferid: tradeID.ToString(),
|
||||
method: WebRequestMethods.Http.Post,
|
||||
secure: true
|
||||
);
|
||||
result.Add(JsonConvert.DeserializeObject<SteamItem>(jToken.ToString()));
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(Bot.BotName, e);
|
||||
Logging.LogGenericException(e, Bot.BotName);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
internal async Task<bool> SendTradeOffer(List<SteamItem> inventory, ulong partnerID, string token = null) {
|
||||
if (inventory == null || inventory.Count == 0 || partnerID == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
string sessionID;
|
||||
if (!Cookie.TryGetValue("sessionid", out sessionID)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
List<SteamTradeOfferRequest> trades = new List<SteamTradeOfferRequest>(1 + inventory.Count / Trading.MaxItemsPerTrade);
|
||||
|
||||
SteamTradeOfferRequest singleTrade = null;
|
||||
for (ushort i = 0; i < inventory.Count; i++) {
|
||||
if (i % Trading.MaxItemsPerTrade == 0) {
|
||||
if (trades.Count >= Trading.MaxTradesPerAccount) {
|
||||
break;
|
||||
}
|
||||
|
||||
singleTrade = new SteamTradeOfferRequest();
|
||||
trades.Add(singleTrade);
|
||||
}
|
||||
|
||||
SteamItem item = inventory[i];
|
||||
singleTrade.me.assets.Add(new SteamItem() {
|
||||
appid = "753",
|
||||
contextid = "6",
|
||||
amount = item.amount,
|
||||
assetid = item.id
|
||||
});
|
||||
}
|
||||
|
||||
string referer = "https://steamcommunity.com/tradeoffer/new";
|
||||
string request = referer + "/send";
|
||||
|
||||
foreach (SteamTradeOfferRequest 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) ? "" : string.Format("{{ \"trade_offer_access_token\":\"{0}\" }}", token)} // TODO: This should be rewrote
|
||||
};
|
||||
|
||||
HttpResponseMessage response = null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && response == null; i++) {
|
||||
response = await WebBrowser.UrlPost(request, data, Cookie, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return response != null; // Steam API doesn't respond with any error code, assume any response is a success
|
||||
return true;
|
||||
}
|
||||
|
||||
internal async Task<HtmlDocument> GetBadgePage(int page) {
|
||||
if (SteamID == 0 || page == 0) {
|
||||
internal async Task<HtmlDocument> GetBadgePage(byte page) {
|
||||
if (page == 0 || SteamID == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await WebBrowser.UrlGetToHtmlDocument("http://steamcommunity.com/profiles/" + SteamID + "/badges?p=" + page, SteamCookieDictionary).ConfigureAwait(false);
|
||||
HtmlDocument htmlDocument = null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && htmlDocument == null; i++) {
|
||||
htmlDocument = await WebBrowser.UrlGetToHtmlDocument("https://steamcommunity.com/profiles/" + SteamID + "/badges?l=english&p=" + page, Cookie).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (htmlDocument == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
return htmlDocument;
|
||||
}
|
||||
|
||||
internal async Task<HtmlDocument> GetGameCardsPage(ulong appID) {
|
||||
if (SteamID == 0 || appID == 0) {
|
||||
if (appID == 0 || SteamID == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await WebBrowser.UrlGetToHtmlDocument("http://steamcommunity.com/profiles/" + SteamID + "/gamecards/" + appID, SteamCookieDictionary).ConfigureAwait(false);
|
||||
HtmlDocument htmlDocument = null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && htmlDocument == null; i++) {
|
||||
htmlDocument = await WebBrowser.UrlGetToHtmlDocument("https://steamcommunity.com/profiles/" + SteamID + "/gamecards/" + appID + "?l=english", Cookie).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (htmlDocument == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return null;
|
||||
}
|
||||
|
||||
return htmlDocument;
|
||||
}
|
||||
|
||||
internal async Task<bool> MarkInventory() {
|
||||
if (SteamID == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
HttpResponseMessage response = null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && response == null; i++) {
|
||||
response = await WebBrowser.UrlGet("https://steamcommunity.com/profiles/" + SteamID + "/inventory", Cookie).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task UnlockParentalAccount(string parentalPin) {
|
||||
if (string.IsNullOrEmpty(parentalPin) || parentalPin.Equals("0")) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Unlocking parental account...", Bot.BotName);
|
||||
Dictionary<string, string> data = new Dictionary<string, string>(1) {
|
||||
{ "pin", parentalPin }
|
||||
};
|
||||
|
||||
HttpResponseMessage response = null;
|
||||
for (byte i = 0; i < WebBrowser.MaxRetries && response == null; i++) {
|
||||
response = await WebBrowser.UrlPost("https://steamcommunity.com/parental/ajaxunlock", data, Cookie, "https://steamcommunity.com/").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (response == null) {
|
||||
Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
IEnumerable<string> setCookieValues;
|
||||
if (!response.Headers.TryGetValues("Set-Cookie", out setCookieValues)) {
|
||||
Logging.LogNullError("setCookieValues", Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string setCookieValue in setCookieValues) {
|
||||
if (setCookieValue.Contains("steamparental=")) {
|
||||
string setCookie = setCookieValue.Substring(setCookieValue.IndexOf("steamparental=") + 14);
|
||||
setCookie = setCookie.Substring(0, setCookie.IndexOf(';'));
|
||||
Cookie["steamparental"] = setCookie;
|
||||
Logging.LogGenericInfo("Success!", Bot.BotName);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Logging.LogGenericWarning("Failed to unlock parental account!", Bot.BotName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
260
ArchiSteamFarm/BotConfig.cs
Normal file
260
ArchiSteamFarm/BotConfig.cs
Normal file
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
_ _ _ ____ _ _____
|
||||
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class BotConfig {
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool Enabled { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool StartOnLaunch { get; private set; } = true;
|
||||
|
||||
[JsonProperty]
|
||||
internal string SteamLogin { get; set; } = null;
|
||||
|
||||
[JsonProperty]
|
||||
internal string SteamPassword { get; set; } = null;
|
||||
|
||||
[JsonProperty]
|
||||
internal string SteamParentalPIN { get; set; } = "0";
|
||||
|
||||
[JsonProperty]
|
||||
internal string SteamApiKey { get; private set; } = null;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal ulong SteamMasterID { get; private set; } = 0;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal ulong SteamMasterClanID { get; private set; } = 0;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool CardDropsRestricted { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool DismissInventoryNotifications { get; private set; } = true;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool FarmOffline { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool HandleOfflineMessages { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool ForwardKeysToOtherBots { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool DistributeKeys { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool UseAsfAsMobileAuthenticator { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool ShutdownOnFarmingFinished { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool SendOnFarmingFinished { get; private set; } = false;
|
||||
|
||||
[JsonProperty]
|
||||
internal string SteamTradeToken { get; private set; } = null;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal byte SendTradePeriod { get; private set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
internal string CustomGamePlayedWhileIdle { get; private set; } = null;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal HashSet<uint> GamesPlayedWhileIdle { get; private set; } = new HashSet<uint>() { 0 };
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool Statistics { get; private set; } = true;
|
||||
|
||||
|
||||
internal static BotConfig Load(string path) {
|
||||
if (!File.Exists(path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
BotConfig botConfig;
|
||||
try {
|
||||
botConfig = JsonConvert.DeserializeObject<BotConfig>(File.ReadAllText(path));
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
return botConfig;
|
||||
}
|
||||
|
||||
// TODO: This should be removed soon
|
||||
internal static BotConfig LoadOldFormat(string path) {
|
||||
if (!File.Exists(path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
BotConfig botConfig = new BotConfig();
|
||||
|
||||
try {
|
||||
using (XmlReader reader = XmlReader.Create(path)) {
|
||||
while (reader.Read()) {
|
||||
if (reader.NodeType != XmlNodeType.Element) {
|
||||
continue;
|
||||
}
|
||||
|
||||
string key = reader.Name;
|
||||
if (string.IsNullOrEmpty(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
string value = reader.GetAttribute("value");
|
||||
if (string.IsNullOrEmpty(value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
case "Enabled":
|
||||
botConfig.Enabled = bool.Parse(value);
|
||||
break;
|
||||
case "SteamLogin":
|
||||
botConfig.SteamLogin = value;
|
||||
break;
|
||||
case "SteamPassword":
|
||||
botConfig.SteamPassword = value;
|
||||
break;
|
||||
case "SteamApiKey":
|
||||
botConfig.SteamApiKey = value;
|
||||
break;
|
||||
case "SteamTradeToken":
|
||||
botConfig.SteamTradeToken = value;
|
||||
break;
|
||||
case "SteamParentalPIN":
|
||||
botConfig.SteamParentalPIN = value;
|
||||
break;
|
||||
case "SteamMasterID":
|
||||
botConfig.SteamMasterID = ulong.Parse(value);
|
||||
break;
|
||||
case "SteamMasterClanID":
|
||||
botConfig.SteamMasterClanID = ulong.Parse(value);
|
||||
break;
|
||||
case "StartOnLaunch":
|
||||
botConfig.StartOnLaunch = bool.Parse(value);
|
||||
break;
|
||||
case "UseAsfAsMobileAuthenticator":
|
||||
botConfig.UseAsfAsMobileAuthenticator = bool.Parse(value);
|
||||
break;
|
||||
case "CardDropsRestricted":
|
||||
botConfig.CardDropsRestricted = bool.Parse(value);
|
||||
break;
|
||||
case "FarmOffline":
|
||||
botConfig.FarmOffline = bool.Parse(value);
|
||||
break;
|
||||
case "HandleOfflineMessages":
|
||||
botConfig.HandleOfflineMessages = bool.Parse(value);
|
||||
break;
|
||||
case "ForwardKeysToOtherBots":
|
||||
botConfig.ForwardKeysToOtherBots = bool.Parse(value);
|
||||
break;
|
||||
case "DistributeKeys":
|
||||
botConfig.DistributeKeys = bool.Parse(value);
|
||||
break;
|
||||
case "ShutdownOnFarmingFinished":
|
||||
botConfig.ShutdownOnFarmingFinished = bool.Parse(value);
|
||||
break;
|
||||
case "SendOnFarmingFinished":
|
||||
botConfig.SendOnFarmingFinished = bool.Parse(value);
|
||||
break;
|
||||
case "SendTradePeriod":
|
||||
botConfig.SendTradePeriod = byte.Parse(value);
|
||||
break;
|
||||
case "GamesPlayedWhileIdle":
|
||||
botConfig.GamesPlayedWhileIdle.Clear();
|
||||
foreach (string appID in value.Split(',')) {
|
||||
botConfig.GamesPlayedWhileIdle.Add(uint.Parse(appID));
|
||||
}
|
||||
break;
|
||||
case "Statistics":
|
||||
botConfig.Statistics = bool.Parse(value);
|
||||
break;
|
||||
case "Blacklist":
|
||||
case "SteamNickname":
|
||||
break;
|
||||
default:
|
||||
Logging.LogGenericWarning("Unrecognized config value: " + key + "=" + value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
Logging.LogGenericError("Your config for this bot instance is invalid, it won't run!");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fixups for new format
|
||||
if (botConfig.SteamLogin != null && botConfig.SteamLogin.Equals("null")) {
|
||||
botConfig.SteamLogin = null;
|
||||
}
|
||||
|
||||
if (botConfig.SteamPassword != null && botConfig.SteamPassword.Equals("null")) {
|
||||
botConfig.SteamPassword = null;
|
||||
}
|
||||
|
||||
if (botConfig.SteamApiKey != null && botConfig.SteamApiKey.Equals("null")) {
|
||||
botConfig.SteamApiKey = null;
|
||||
}
|
||||
|
||||
if (botConfig.SteamParentalPIN != null && botConfig.SteamParentalPIN.Equals("null")) {
|
||||
botConfig.SteamParentalPIN = null;
|
||||
}
|
||||
|
||||
if (botConfig.SteamTradeToken != null && botConfig.SteamTradeToken.Equals("null")) {
|
||||
botConfig.SteamTradeToken = null;
|
||||
}
|
||||
|
||||
return botConfig;
|
||||
}
|
||||
|
||||
// This constructor is used only by deserializer
|
||||
private BotConfig() { }
|
||||
|
||||
// TODO: This should be removed soon
|
||||
internal bool Convert(string path) {
|
||||
try {
|
||||
File.WriteAllText(path, JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented));
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
Logging.LogGenericWarning("Your config was converted to new ASF V2.0 format");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
104
ArchiSteamFarm/BotDatabase.cs
Normal file
104
ArchiSteamFarm/BotDatabase.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
_ _ _ ____ _ _____
|
||||
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using SteamAuth;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class BotDatabase {
|
||||
internal string LoginKey {
|
||||
get {
|
||||
return _LoginKey;
|
||||
}
|
||||
set {
|
||||
if (_LoginKey == value) {
|
||||
return;
|
||||
}
|
||||
|
||||
_LoginKey = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
internal SteamGuardAccount SteamGuardAccount {
|
||||
get {
|
||||
return _SteamGuardAccount;
|
||||
}
|
||||
set {
|
||||
if (_SteamGuardAccount == value) {
|
||||
return;
|
||||
}
|
||||
|
||||
_SteamGuardAccount = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty(Required = Required.AllowNull)]
|
||||
private string _LoginKey;
|
||||
|
||||
[JsonProperty(Required = Required.AllowNull)]
|
||||
private SteamGuardAccount _SteamGuardAccount;
|
||||
|
||||
private string FilePath;
|
||||
|
||||
internal static BotDatabase Load(string filePath) {
|
||||
if (!File.Exists(filePath)) {
|
||||
return new BotDatabase(filePath);
|
||||
}
|
||||
|
||||
BotDatabase botDatabase;
|
||||
try {
|
||||
botDatabase = JsonConvert.DeserializeObject<BotDatabase>(File.ReadAllText(filePath));
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
botDatabase.FilePath = filePath;
|
||||
return botDatabase;
|
||||
}
|
||||
|
||||
// This constructor is used when creating new database
|
||||
private BotDatabase(string filePath) {
|
||||
FilePath = filePath;
|
||||
Save();
|
||||
}
|
||||
|
||||
// This constructor is used only by deserializer
|
||||
private BotDatabase() { }
|
||||
|
||||
private void Save() {
|
||||
lock (FilePath) {
|
||||
try {
|
||||
File.WriteAllText(FilePath, JsonConvert.SerializeObject(this));
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -24,19 +24,18 @@
|
||||
|
||||
using SteamKit2;
|
||||
using SteamKit2.Internal;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class CMsgClientClanInviteAction : ISteamSerializableMessage, ISteamSerializable {
|
||||
internal sealed class CMsgClientClanInviteAction : ISteamSerializableMessage {
|
||||
internal ulong GroupID { get; set; } = 0;
|
||||
internal bool AcceptInvite { get; set; } = true;
|
||||
|
||||
EMsg ISteamSerializableMessage.GetEMsg() {
|
||||
return EMsg.ClientAcknowledgeClanInvite;
|
||||
}
|
||||
|
||||
internal ulong GroupID = 0;
|
||||
internal bool AcceptInvite = true;
|
||||
|
||||
public CMsgClientClanInviteAction() { }
|
||||
|
||||
void ISteamSerializable.Serialize(Stream stream) {
|
||||
if (stream == null) {
|
||||
return;
|
||||
@@ -46,8 +45,8 @@ namespace ArchiSteamFarm {
|
||||
BinaryWriter binaryWriter = new BinaryWriter(stream);
|
||||
binaryWriter.Write(GroupID);
|
||||
binaryWriter.Write(AcceptInvite);
|
||||
} catch {
|
||||
throw new IOException();
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,8 +59,8 @@ namespace ArchiSteamFarm {
|
||||
BinaryReader binaryReader = new BinaryReader(stream);
|
||||
GroupID = binaryReader.ReadUInt64();
|
||||
AcceptInvite = binaryReader.ReadBoolean();
|
||||
} catch {
|
||||
throw new IOException();
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
using HtmlAgilityPack;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
@@ -35,26 +36,38 @@ namespace ArchiSteamFarm {
|
||||
private const byte StatusCheckSleep = 5; // In minutes, how long to wait before checking the appID again
|
||||
private const ushort MaxFarmingTime = 600; // In minutes, how long ASF is allowed to farm one game in solo mode
|
||||
|
||||
private readonly ManualResetEvent FarmResetEvent = new ManualResetEvent(false);
|
||||
private readonly SemaphoreSlim Semaphore = new SemaphoreSlim(1);
|
||||
private readonly Bot Bot;
|
||||
|
||||
internal readonly ConcurrentDictionary<uint, double> GamesToFarm = new ConcurrentDictionary<uint, double>();
|
||||
internal readonly ConcurrentDictionary<uint, float> GamesToFarm = new ConcurrentDictionary<uint, float>();
|
||||
internal readonly List<uint> CurrentGamesFarming = new List<uint>();
|
||||
|
||||
private volatile bool NowFarming = false;
|
||||
private readonly ManualResetEvent FarmResetEvent = new ManualResetEvent(false);
|
||||
private readonly SemaphoreSlim Semaphore = new SemaphoreSlim(1);
|
||||
|
||||
private readonly Bot Bot;
|
||||
private readonly Timer Timer;
|
||||
|
||||
private bool ManualMode = false;
|
||||
private bool NowFarming = false;
|
||||
|
||||
internal CardsFarmer(Bot bot) {
|
||||
Bot = bot;
|
||||
|
||||
if (Timer == null) {
|
||||
Timer = new Timer(
|
||||
async e => await CheckGamesForFarming().ConfigureAwait(false),
|
||||
null,
|
||||
TimeSpan.FromMinutes(15), // Delay
|
||||
TimeSpan.FromMinutes(60) // Period
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
internal static List<uint> GetGamesToFarmSolo(ConcurrentDictionary<uint, double> gamesToFarm) {
|
||||
internal static List<uint> GetGamesToFarmSolo(ConcurrentDictionary<uint, float> gamesToFarm) {
|
||||
if (gamesToFarm == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<uint> result = new List<uint>();
|
||||
foreach (KeyValuePair<uint, double> keyValue in gamesToFarm) {
|
||||
foreach (KeyValuePair<uint, float> keyValue in gamesToFarm) {
|
||||
if (keyValue.Value >= 2) {
|
||||
result.Add(keyValue.Key);
|
||||
}
|
||||
@@ -63,7 +76,7 @@ namespace ArchiSteamFarm {
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static uint GetAnyGameToFarm(ConcurrentDictionary<uint, double> gamesToFarm) {
|
||||
internal static uint GetAnyGameToFarm(ConcurrentDictionary<uint, float> gamesToFarm) {
|
||||
if (gamesToFarm == null) {
|
||||
return 0;
|
||||
}
|
||||
@@ -75,30 +88,49 @@ namespace ArchiSteamFarm {
|
||||
return 0;
|
||||
}
|
||||
|
||||
internal bool FarmMultiple() {
|
||||
if (GamesToFarm == null || GamesToFarm.Count == 0) {
|
||||
internal async Task<bool> SwitchToManualMode(bool manualMode) {
|
||||
if (ManualMode == manualMode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ManualMode = manualMode;
|
||||
|
||||
if (ManualMode) {
|
||||
Logging.LogGenericInfo("Now running in Manual Farming mode", Bot.BotName);
|
||||
await StopFarming().ConfigureAwait(false);
|
||||
} else {
|
||||
Logging.LogGenericInfo("Now running in Automatic Farming mode", Bot.BotName);
|
||||
Task.Run(async () => await StartFarming().ConfigureAwait(false)).Forget();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
internal bool FarmMultiple(ConcurrentDictionary<uint, float> appIDs) {
|
||||
if (appIDs.Count == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
double maxHour = -1;
|
||||
float maxHour = 0;
|
||||
|
||||
foreach (double hour in GamesToFarm.Values) {
|
||||
foreach (float hour in appIDs.Values) {
|
||||
if (hour > maxHour) {
|
||||
maxHour = hour;
|
||||
}
|
||||
}
|
||||
|
||||
CurrentGamesFarming.Clear();
|
||||
foreach (uint appID in GamesToFarm.Keys) {
|
||||
CurrentGamesFarming.TrimExcess();
|
||||
foreach (uint appID in appIDs.Keys) {
|
||||
CurrentGamesFarming.Add(appID);
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo(Bot.BotName, "Now farming: " + string.Join(", ", GamesToFarm.Keys));
|
||||
if (Farm(maxHour, GamesToFarm.Keys)) {
|
||||
Logging.LogGenericInfo("Now farming: " + string.Join(", ", appIDs.Keys), Bot.BotName);
|
||||
if (Farm(maxHour, appIDs.Keys)) {
|
||||
CurrentGamesFarming.Clear();
|
||||
return true;
|
||||
} else {
|
||||
CurrentGamesFarming.Clear();
|
||||
NowFarming = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -109,164 +141,91 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
CurrentGamesFarming.Clear();
|
||||
CurrentGamesFarming.TrimExcess();
|
||||
CurrentGamesFarming.Add(appID);
|
||||
|
||||
Logging.LogGenericInfo(Bot.BotName, "Now farming: " + appID);
|
||||
Logging.LogGenericInfo("Now farming: " + appID, Bot.BotName);
|
||||
if (await Farm(appID).ConfigureAwait(false)) {
|
||||
double hours;
|
||||
float hours;
|
||||
GamesToFarm.TryRemove(appID, out hours);
|
||||
return true;
|
||||
} else {
|
||||
CurrentGamesFarming.Clear();
|
||||
NowFarming = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
internal async Task StartFarming() {
|
||||
internal async Task RestartFarming() {
|
||||
await StopFarming().ConfigureAwait(false);
|
||||
await StartFarming().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal async Task StartFarming() {
|
||||
await Semaphore.WaitAsync().ConfigureAwait(false);
|
||||
|
||||
if (NowFarming) {
|
||||
Semaphore.Release();
|
||||
if (ManualMode) {
|
||||
Semaphore.Release(); // We have nothing to do, don't forget to release semaphore
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo(Bot.BotName, "Checking badges...");
|
||||
|
||||
// Find the number of badge pages
|
||||
HtmlDocument badgesDocument = await Bot.ArchiWebHandler.GetBadgePage(1).ConfigureAwait(false);
|
||||
if (badgesDocument == null) {
|
||||
Logging.LogGenericWarning(Bot.BotName, "Could not get badges information, farming is stopped!");
|
||||
Semaphore.Release();
|
||||
if (!await IsAnythingToFarm().ConfigureAwait(false)) {
|
||||
Semaphore.Release(); // We have nothing to do, don't forget to release semaphore
|
||||
return;
|
||||
}
|
||||
|
||||
var maxPages = 1;
|
||||
HtmlNodeCollection badgesPagesNodeCollection = badgesDocument.DocumentNode.SelectNodes("//a[@class='pagelink']");
|
||||
if (badgesPagesNodeCollection != null) {
|
||||
maxPages = (badgesPagesNodeCollection.Count / 2) + 1; // Don't do this at home
|
||||
}
|
||||
Logging.LogGenericInfo("We have a total of " + GamesToFarm.Count + " games to farm on this account...", Bot.BotName);
|
||||
NowFarming = true;
|
||||
Semaphore.Release(); // From this point we allow other calls to shut us down
|
||||
|
||||
// Find APPIDs we need to farm
|
||||
for (var page = 1; page <= maxPages; page++) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Checking page: " + page + "/" + maxPages);
|
||||
|
||||
if (page > 1) { // Because we fetched page number 1 already
|
||||
badgesDocument = await Bot.ArchiWebHandler.GetBadgePage(page).ConfigureAwait(false);
|
||||
if (badgesDocument == null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
HtmlNodeCollection badgesPageNodes = badgesDocument.DocumentNode.SelectNodes("//a[@class='btn_green_white_innerfade btn_small_thin']");
|
||||
if (badgesPageNodes == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
GamesToFarm.Clear();
|
||||
foreach (HtmlNode badgesPageNode in badgesPageNodes) {
|
||||
string steamLink = badgesPageNode.GetAttributeValue("href", null);
|
||||
if (steamLink == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
uint appID = (uint) Utilities.OnlyNumbers(steamLink);
|
||||
if (appID == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Bot.Blacklist.Contains(appID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// We assume that every game has at least 2 hours played, until we actually check them
|
||||
GamesToFarm.AddOrUpdate(appID, 2, (key, value) => 2);
|
||||
}
|
||||
}
|
||||
|
||||
// If we have restricted card drops, actually do check all games that are left to farm
|
||||
if (Bot.CardDropsRestricted) {
|
||||
foreach (uint appID in GamesToFarm.Keys) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Checking hours of appID: " + appID);
|
||||
HtmlDocument appPage = await Bot.ArchiWebHandler.GetGameCardsPage(appID).ConfigureAwait(false);
|
||||
if (appPage == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
HtmlNode appNode = appPage.DocumentNode.SelectSingleNode("//div[@class='badge_title_stats_playtime']");
|
||||
if (appNode == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
string hoursString = appNode.InnerText;
|
||||
if (string.IsNullOrEmpty(hoursString)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
hoursString = Regex.Match(hoursString, @"[0-9\.,]+").Value;
|
||||
double hours;
|
||||
|
||||
if (string.IsNullOrEmpty(hoursString)) {
|
||||
hours = 0;
|
||||
} else {
|
||||
hours = double.Parse(hoursString, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
GamesToFarm[appID] = hours;
|
||||
}
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo(Bot.BotName, "Farming in progress...");
|
||||
|
||||
NowFarming = GamesToFarm.Count > 0;
|
||||
Semaphore.Release();
|
||||
bool farmedSomething = false;
|
||||
|
||||
// Now the algorithm used for farming depends on whether account is restricted or not
|
||||
if (Bot.CardDropsRestricted) {
|
||||
// If we have restricted card drops, we use complex algorithm, which prioritizes farming solo titles >= 2 hours, then all at once, until any game hits mentioned 2 hours
|
||||
Logging.LogGenericInfo(Bot.BotName, "Chosen farming algorithm: Complex");
|
||||
if (Bot.BotConfig.CardDropsRestricted) { // If we have restricted card drops, we use complex algorithm
|
||||
Logging.LogGenericInfo("Chosen farming algorithm: Complex", Bot.BotName);
|
||||
while (GamesToFarm.Count > 0) {
|
||||
List<uint> gamesToFarmSolo = GetGamesToFarmSolo(GamesToFarm);
|
||||
if (gamesToFarmSolo.Count > 0) {
|
||||
while (gamesToFarmSolo.Count > 0) {
|
||||
uint appID = gamesToFarmSolo[0];
|
||||
bool success = await FarmSolo(appID).ConfigureAwait(false);
|
||||
if (success) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Done farming: " + appID);
|
||||
if (await FarmSolo(appID).ConfigureAwait(false)) {
|
||||
farmedSomething = true;
|
||||
Logging.LogGenericInfo("Done farming: " + appID, Bot.BotName);
|
||||
gamesToFarmSolo.Remove(appID);
|
||||
gamesToFarmSolo.TrimExcess();
|
||||
} else {
|
||||
NowFarming = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bool success = FarmMultiple();
|
||||
if (success) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Done farming: " + string.Join(", ", GamesToFarm.Keys));
|
||||
if (FarmMultiple(GamesToFarm)) {
|
||||
farmedSomething = true;
|
||||
Logging.LogGenericInfo("Done farming: " + string.Join(", ", GamesToFarm.Keys), Bot.BotName);
|
||||
} else {
|
||||
NowFarming = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If we have unrestricted card drops, we use simple algorithm and farm cards one-by-one
|
||||
Logging.LogGenericInfo(Bot.BotName, "Chosen farming algorithm: Simple");
|
||||
} else { // If we have unrestricted card drops, we use simple algorithm
|
||||
Logging.LogGenericInfo("Chosen farming algorithm: Simple", Bot.BotName);
|
||||
while (GamesToFarm.Count > 0) {
|
||||
uint appID = GetAnyGameToFarm(GamesToFarm);
|
||||
bool success = await FarmSolo(appID).ConfigureAwait(false);
|
||||
if (success) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Done farming: " + appID);
|
||||
if (await FarmSolo(appID).ConfigureAwait(false)) {
|
||||
farmedSomething = true;
|
||||
Logging.LogGenericInfo("Done farming: " + appID, Bot.BotName);
|
||||
} else {
|
||||
NowFarming = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CurrentGamesFarming.Clear();
|
||||
CurrentGamesFarming.TrimExcess();
|
||||
NowFarming = false;
|
||||
Logging.LogGenericInfo(Bot.BotName, "Farming finished!");
|
||||
await Bot.OnFarmingFinished().ConfigureAwait(false);
|
||||
Logging.LogGenericInfo("Farming finished!", Bot.BotName);
|
||||
await Bot.OnFarmingFinished(farmedSomething).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal async Task StopFarming() {
|
||||
@@ -277,27 +236,181 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo(Bot.BotName, "Sending signal to stop farming");
|
||||
Logging.LogGenericInfo("Sending signal to stop farming", Bot.BotName);
|
||||
FarmResetEvent.Set();
|
||||
while (NowFarming) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Waiting for reaction...");
|
||||
for (byte i = 0; i < 5 && NowFarming; i++) {
|
||||
Logging.LogGenericInfo("Waiting for reaction...", Bot.BotName);
|
||||
await Utilities.SleepAsync(1000).ConfigureAwait(false);
|
||||
}
|
||||
FarmResetEvent.Reset();
|
||||
Logging.LogGenericInfo(Bot.BotName, "Farming stopped!");
|
||||
Logging.LogGenericInfo("Farming stopped!", Bot.BotName);
|
||||
Semaphore.Release();
|
||||
}
|
||||
|
||||
private async Task<bool?> ShouldFarm(ulong appID) {
|
||||
bool? result = null;
|
||||
HtmlDocument gamePageDocument = await Bot.ArchiWebHandler.GetGameCardsPage(appID).ConfigureAwait(false);
|
||||
if (gamePageDocument != null) {
|
||||
HtmlNode gamePageNode = gamePageDocument.DocumentNode.SelectSingleNode("//span[@class='progress_info_bold']");
|
||||
if (gamePageNode != null) {
|
||||
result = !gamePageNode.InnerText.Contains("No card drops");
|
||||
private async Task<bool> IsAnythingToFarm() {
|
||||
if (NowFarming) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (await Bot.ArchiWebHandler.ReconnectIfNeeded().ConfigureAwait(false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Checking badges...", Bot.BotName);
|
||||
|
||||
// Find the number of badge pages
|
||||
Logging.LogGenericInfo("Checking first page...", Bot.BotName);
|
||||
HtmlDocument htmlDocument = await Bot.ArchiWebHandler.GetBadgePage(1).ConfigureAwait(false);
|
||||
if (htmlDocument == null) {
|
||||
Logging.LogGenericWarning("Could not get badges information, will try again later!", Bot.BotName);
|
||||
return false;
|
||||
}
|
||||
|
||||
byte maxPages = 1;
|
||||
HtmlNodeCollection htmlNodeCollection = htmlDocument.DocumentNode.SelectNodes("//a[@class='pagelink']");
|
||||
if (htmlNodeCollection != null && htmlNodeCollection.Count > 0) {
|
||||
HtmlNode htmlNode = htmlNodeCollection[htmlNodeCollection.Count - 1];
|
||||
if (!byte.TryParse(htmlNode.InnerText, out maxPages)) {
|
||||
maxPages = 1; // Should never happen
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
GamesToFarm.Clear();
|
||||
|
||||
// Find APPIDs we need to farm
|
||||
Logging.LogGenericInfo("Checking other pages...", Bot.BotName);
|
||||
|
||||
List<Task> tasks = new List<Task>(maxPages - 1);
|
||||
for (byte page = 1; page <= maxPages; page++) {
|
||||
if (page == 1) {
|
||||
CheckPage(htmlDocument); // Because we fetched page number 1 already
|
||||
} else {
|
||||
byte currentPage = page; // We need a copy of variable being passed when in for loops
|
||||
tasks.Add(Task.Run(async () => await CheckPage(currentPage).ConfigureAwait(false)));
|
||||
}
|
||||
}
|
||||
await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||
|
||||
if (GamesToFarm.Count == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If we have restricted card drops, actually do check hours of all games that are left to farm
|
||||
if (Bot.BotConfig.CardDropsRestricted) {
|
||||
tasks = new List<Task>(GamesToFarm.Keys.Count);
|
||||
Logging.LogGenericInfo("Checking hours...", Bot.BotName);
|
||||
foreach (uint appID in GamesToFarm.Keys) {
|
||||
tasks.Add(Task.Run(async () => await CheckHours(appID).ConfigureAwait(false)));
|
||||
}
|
||||
await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void CheckPage(HtmlDocument htmlDocument) {
|
||||
if (htmlDocument == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
HtmlNodeCollection htmlNodeCollection = htmlDocument.DocumentNode.SelectNodes("//a[@class='btn_green_white_innerfade btn_small_thin']");
|
||||
if (htmlNodeCollection == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (HtmlNode htmlNode in htmlNodeCollection) {
|
||||
string steamLink = htmlNode.GetAttributeValue("href", null);
|
||||
if (steamLink == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
uint appID = (uint) Utilities.OnlyNumbers(steamLink);
|
||||
if (appID == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (GlobalConfig.GlobalBlacklist.Contains(appID) || Program.GlobalConfig.Blacklist.Contains(appID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// We assume that every game has at least 2 hours played, until we actually check them
|
||||
GamesToFarm[appID] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task CheckPage(byte page) {
|
||||
if (page == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
HtmlDocument htmlDocument = await Bot.ArchiWebHandler.GetBadgePage(page).ConfigureAwait(false);
|
||||
if (htmlDocument == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
CheckPage(htmlDocument);
|
||||
}
|
||||
|
||||
private async Task CheckHours(uint appID) {
|
||||
if (appID == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
HtmlDocument htmlDocument = await Bot.ArchiWebHandler.GetGameCardsPage(appID).ConfigureAwait(false);
|
||||
if (htmlDocument == null) {
|
||||
Logging.LogNullError("htmlDocument", Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
HtmlNode htmlNode = htmlDocument.DocumentNode.SelectSingleNode("//div[@class='badge_title_stats_playtime']");
|
||||
if (htmlNode == null) {
|
||||
Logging.LogNullError("htmlNode", Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
string hoursString = htmlNode.InnerText;
|
||||
if (string.IsNullOrEmpty(hoursString)) {
|
||||
Logging.LogNullError("hoursString", Bot.BotName);
|
||||
return;
|
||||
}
|
||||
|
||||
hoursString = Regex.Match(hoursString, @"[0-9\.,]+").Value;
|
||||
float hours;
|
||||
|
||||
if (string.IsNullOrEmpty(hoursString)) {
|
||||
hours = 0;
|
||||
} else {
|
||||
hours = float.Parse(hoursString, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
GamesToFarm[appID] = hours;
|
||||
}
|
||||
|
||||
private async Task CheckGamesForFarming() {
|
||||
if (NowFarming || ManualMode || GamesToFarm.Count > 0 || !Bot.SteamClient.IsConnected) {
|
||||
return;
|
||||
}
|
||||
|
||||
await StartFarming().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<bool?> ShouldFarm(ulong appID) {
|
||||
if (appID == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
HtmlDocument htmlDocument = await Bot.ArchiWebHandler.GetGameCardsPage(appID).ConfigureAwait(false);
|
||||
if (htmlDocument == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
HtmlNode htmlNode = htmlDocument.DocumentNode.SelectSingleNode("//span[@class='progress_info_bold']");
|
||||
if (htmlNode == null) {
|
||||
await Bot.ArchiWebHandler.ReconnectIfNeeded().ConfigureAwait(false);
|
||||
return null;
|
||||
}
|
||||
|
||||
return !htmlNode.InnerText.Contains("No card drops");
|
||||
}
|
||||
|
||||
private async Task<bool> Farm(uint appID) {
|
||||
@@ -307,7 +420,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
bool? keepFarming = await ShouldFarm(appID).ConfigureAwait(false);
|
||||
for (ushort farmingTime = 0; farmingTime <= MaxFarmingTime && (!keepFarming.HasValue || keepFarming.Value); farmingTime += StatusCheckSleep) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Still farming: " + appID);
|
||||
Logging.LogGenericInfo("Still farming: " + appID, Bot.BotName);
|
||||
if (FarmResetEvent.WaitOne(1000 * 60 * StatusCheckSleep)) {
|
||||
success = false;
|
||||
break;
|
||||
@@ -315,12 +428,12 @@ namespace ArchiSteamFarm {
|
||||
keepFarming = await ShouldFarm(appID).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
Bot.ArchiHandler.PlayGames(0);
|
||||
Logging.LogGenericInfo(Bot.BotName, "Stopped farming: " + appID);
|
||||
Bot.ResetGamesPlayed();
|
||||
Logging.LogGenericInfo("Stopped farming: " + appID, Bot.BotName);
|
||||
return success;
|
||||
}
|
||||
|
||||
private bool Farm(double maxHour, ICollection<uint> appIDs) {
|
||||
private bool Farm(float maxHour, ICollection<uint> appIDs) {
|
||||
if (maxHour >= 2) {
|
||||
return true;
|
||||
}
|
||||
@@ -329,27 +442,27 @@ namespace ArchiSteamFarm {
|
||||
|
||||
bool success = true;
|
||||
while (maxHour < 2) {
|
||||
Logging.LogGenericInfo(Bot.BotName, "Still farming: " + string.Join(", ", appIDs));
|
||||
Logging.LogGenericInfo("Still farming: " + string.Join(", ", appIDs), Bot.BotName);
|
||||
if (FarmResetEvent.WaitOne(1000 * 60 * StatusCheckSleep)) {
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// Don't forget to update our GamesToFarm hours
|
||||
double timePlayed = StatusCheckSleep / 60.0;
|
||||
foreach (KeyValuePair<uint, double> keyValue in GamesToFarm) {
|
||||
if (!appIDs.Contains(keyValue.Key)) {
|
||||
float timePlayed = StatusCheckSleep / 60.0F;
|
||||
foreach (KeyValuePair<uint, float> gameToFarm in GamesToFarm) {
|
||||
if (!appIDs.Contains(gameToFarm.Key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
GamesToFarm[keyValue.Key] = keyValue.Value + timePlayed;
|
||||
GamesToFarm[gameToFarm.Key] = gameToFarm.Value + timePlayed;
|
||||
}
|
||||
|
||||
maxHour += timePlayed;
|
||||
}
|
||||
|
||||
Bot.ArchiHandler.PlayGames(0);
|
||||
Logging.LogGenericInfo(Bot.BotName, "Stopped farming: " + string.Join(", ", appIDs));
|
||||
Bot.ResetGamesPlayed();
|
||||
Logging.LogGenericInfo("Stopped farming: " + string.Join(", ", appIDs), Bot.BotName);
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -22,20 +22,16 @@
|
||||
|
||||
*/
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class Debugging {
|
||||
internal static bool IsDebugBuild { get; private set; } = false;
|
||||
internal static bool IsReleaseBuild { get { return !IsDebugBuild; } }
|
||||
#if DEBUG
|
||||
internal static readonly bool IsDebugBuild = true;
|
||||
#else
|
||||
internal static readonly bool IsDebugBuild = false;
|
||||
#endif
|
||||
|
||||
static Debugging() {
|
||||
MarkIfDebug();
|
||||
}
|
||||
internal static bool IsReleaseBuild => !IsDebugBuild;
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private static void MarkIfDebug() {
|
||||
IsDebugBuild = true;
|
||||
}
|
||||
internal static bool NetHookAlreadyInitialized { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
88
ArchiSteamFarm/GlobalConfig.cs
Normal file
88
ArchiSteamFarm/GlobalConfig.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
_ _ _ ____ _ _____
|
||||
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class GlobalConfig {
|
||||
internal enum EUpdateChannel : byte {
|
||||
Unknown,
|
||||
Stable,
|
||||
Experimental
|
||||
}
|
||||
|
||||
// This is hardcoded blacklist which should not be possible to change
|
||||
internal static readonly HashSet<uint> GlobalBlacklist = new HashSet<uint> { 267420, 303700, 335590, 368020, 425280 };
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool Debug { get; private set; } = false;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal bool AutoUpdates { get; private set; } = true;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal EUpdateChannel UpdateChannel { get; private set; } = GlobalConfig.EUpdateChannel.Stable;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal byte HttpTimeout { get; private set; } = 30;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal byte AccountPlayingDelay { get; private set; } = 5;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal byte RequestLimiterDelay { get; private set; } = 7;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal string WCFHostname { get; private set; } = "localhost";
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal ushort WCFPort { get; private set; } = 1242;
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal HashSet<uint> Blacklist { get; private set; } = new HashSet<uint>(GlobalBlacklist);
|
||||
|
||||
internal static GlobalConfig Load() {
|
||||
string filePath = Path.Combine(Program.ConfigDirectory, Program.GlobalConfigFile);
|
||||
if (!File.Exists(filePath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
GlobalConfig globalConfig;
|
||||
try {
|
||||
globalConfig = JsonConvert.DeserializeObject<GlobalConfig>(File.ReadAllText(filePath));
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
return globalConfig;
|
||||
}
|
||||
|
||||
// This constructor is used only by deserializer
|
||||
private GlobalConfig() { }
|
||||
}
|
||||
}
|
||||
80
ArchiSteamFarm/GlobalDatabase.cs
Normal file
80
ArchiSteamFarm/GlobalDatabase.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
_ _ _ ____ _ _____
|
||||
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using SteamAuth;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class GlobalDatabase {
|
||||
private static readonly string FilePath = Path.Combine(Program.ConfigDirectory, Program.GlobalDatabaseFile);
|
||||
|
||||
internal uint CellID {
|
||||
get {
|
||||
return _CellID;
|
||||
}
|
||||
set {
|
||||
if (_CellID == value) {
|
||||
return;
|
||||
}
|
||||
|
||||
_CellID = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
private uint _CellID = 0;
|
||||
|
||||
internal static GlobalDatabase Load() {
|
||||
if (!File.Exists(FilePath)) {
|
||||
return new GlobalDatabase();
|
||||
}
|
||||
|
||||
GlobalDatabase globalDatabase;
|
||||
try {
|
||||
globalDatabase = JsonConvert.DeserializeObject<GlobalDatabase>(File.ReadAllText(FilePath));
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
return globalDatabase;
|
||||
}
|
||||
|
||||
// This constructor is used only by deserializer
|
||||
private GlobalDatabase() { }
|
||||
|
||||
private void Save() {
|
||||
lock (FilePath) {
|
||||
try {
|
||||
File.WriteAllText(FilePath, JsonConvert.SerializeObject(this));
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
46
ArchiSteamFarm/JSON/GitHub.cs
Normal file
46
ArchiSteamFarm/JSON/GitHub.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
_ _ _ ____ _ _____
|
||||
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class GitHub {
|
||||
internal sealed class Asset {
|
||||
[JsonProperty(PropertyName = "name", Required = Required.Always)]
|
||||
internal string Name { get; private set; }
|
||||
|
||||
[JsonProperty(PropertyName = "browser_download_url", Required = Required.Always)]
|
||||
internal string DownloadURL { get; private set; }
|
||||
}
|
||||
|
||||
internal sealed class ReleaseResponse {
|
||||
[JsonProperty(PropertyName = "tag_name", Required = Required.Always)]
|
||||
internal string Tag { get; private set; }
|
||||
|
||||
[JsonProperty(PropertyName = "assets", Required = Required.Always)]
|
||||
internal List<Asset> Assets { get; private set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -24,44 +24,115 @@
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class Logging {
|
||||
private static void Log(string message) {
|
||||
lock (Program.ConsoleLock) {
|
||||
Console.WriteLine(DateTime.Now + " " + message);
|
||||
private static readonly object FileLock = new object();
|
||||
|
||||
internal static bool? LogToFile { get; set; } = null;
|
||||
|
||||
internal static void Init() {
|
||||
if (!LogToFile.HasValue) {
|
||||
LogToFile = true;
|
||||
}
|
||||
|
||||
lock (FileLock) {
|
||||
try {
|
||||
File.Delete(Program.LogFile);
|
||||
} catch (Exception e) {
|
||||
LogGenericException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static void LogGenericError(string botName, string message, [CallerMemberName] string previousMethodName = "") {
|
||||
internal static void LogGenericWTF(string message, string botName = "Main", [CallerMemberName] string previousMethodName = "") {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Log("[!!] WTF: " + previousMethodName + "() <" + botName + "> " + message + ", WTF?");
|
||||
}
|
||||
|
||||
internal static void LogGenericError(string message, string botName = "Main", [CallerMemberName] string previousMethodName = "") {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Log("[!!] ERROR: " + previousMethodName + "() <" + botName + "> " + message);
|
||||
}
|
||||
|
||||
internal static void LogGenericException(string botName, Exception exception, [CallerMemberName] string previousMethodName = "") {
|
||||
internal static void LogGenericException(Exception exception, string botName = "Main", [CallerMemberName] string previousMethodName = "") {
|
||||
if (exception == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Log("[!] EXCEPTION: " + previousMethodName + "() <" + botName + "> " + exception.Message);
|
||||
Log("[!] StackTrace: " + exception.StackTrace);
|
||||
|
||||
Exception innerException = exception.InnerException;
|
||||
if (innerException != null) {
|
||||
LogGenericException(innerException, botName, previousMethodName);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void LogGenericWarning(string botName, string message, [CallerMemberName] string previousMethodName = "") {
|
||||
internal static void LogGenericWarning(string message, string botName = "Main", [CallerMemberName] string previousMethodName = "") {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Log("[!] WARNING: " + previousMethodName + "() <" + botName + "> " + message);
|
||||
}
|
||||
|
||||
internal static void LogGenericInfo(string botName, string message, [CallerMemberName] string previousMethodName = "") {
|
||||
internal static void LogGenericInfo(string message, string botName = "Main", [CallerMemberName] string previousMethodName = "") {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Log("[*] INFO: " + previousMethodName + "() <" + botName + "> " + message);
|
||||
}
|
||||
|
||||
internal static void LogGenericNotice(string botName, string message, [CallerMemberName] string previousMethodName = "") {
|
||||
Log("[*] NOTICE: " + previousMethodName + "() <" + botName + "> " + message);
|
||||
internal static void LogNullError(string nullObjectName, string botName = "Main", [CallerMemberName] string previousMethodName = "") {
|
||||
if (string.IsNullOrEmpty(nullObjectName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
LogGenericError(nullObjectName + " is null!", botName, previousMethodName);
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
internal static void LogGenericDebug(string botName, string message, [CallerMemberName] string previousMethodName = "") {
|
||||
internal static void LogGenericDebug(string message, string botName = "Main", [CallerMemberName] string previousMethodName = "") {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Log("[#] DEBUG: " + previousMethodName + "() <" + botName + "> " + message);
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
internal static void LogGenericDebug(string message, [CallerMemberName] string previousMethodName = "") {
|
||||
LogGenericDebug("DEBUG", message, previousMethodName);
|
||||
private static void Log(string message) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
return;
|
||||
}
|
||||
|
||||
string loggedMessage = DateTime.Now + " " + message + Environment.NewLine;
|
||||
|
||||
// Write on console only when not awaiting response from user
|
||||
if (!Program.ConsoleIsBusy) {
|
||||
Console.Write(loggedMessage);
|
||||
}
|
||||
|
||||
if (LogToFile.GetValueOrDefault()) {
|
||||
lock (FileLock) {
|
||||
try {
|
||||
File.AppendAllText(Program.LogFile, loggedMessage);
|
||||
} catch (Exception e) {
|
||||
LogToFile = false;
|
||||
LogGenericException(e);
|
||||
LogToFile = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -22,8 +22,10 @@
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
@@ -31,76 +33,254 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class Program {
|
||||
internal enum EUserInputType {
|
||||
internal enum EUserInputType : byte {
|
||||
Login,
|
||||
Password,
|
||||
PhoneNumber,
|
||||
SMS,
|
||||
SteamGuard,
|
||||
SteamParentalPIN,
|
||||
RevocationCode,
|
||||
TwoFactorAuthentication,
|
||||
}
|
||||
|
||||
private const string LatestGithubReleaseURL = "https://api.github.com/repos/JustArchi/ArchiSteamFarm/releases/latest";
|
||||
internal enum EMode : byte {
|
||||
Normal, // Standard most common usage
|
||||
Client, // WCF client only
|
||||
Server // Normal + WCF server
|
||||
}
|
||||
|
||||
internal const ulong ArchiSCFarmGroup = 103582791440160998;
|
||||
internal const string ConfigDirectoryPath = "config";
|
||||
private const string GithubReleaseURL = "https://api.github.com/repos/JustArchi/ArchiSteamFarm/releases";
|
||||
|
||||
internal const string ASF = "ASF";
|
||||
internal const string ConfigDirectory = "config";
|
||||
internal const string DebugDirectory = "debug";
|
||||
internal const string LogFile = "log.txt";
|
||||
internal const string GlobalConfigFile = ASF + ".json";
|
||||
internal const string GlobalDatabaseFile = ASF + ".db";
|
||||
|
||||
private static readonly object ConsoleLock = new object();
|
||||
private static readonly SemaphoreSlim SteamSemaphore = new SemaphoreSlim(1);
|
||||
private static readonly ManualResetEvent ShutdownResetEvent = new ManualResetEvent(false);
|
||||
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
|
||||
private static readonly string ExecutablePath = Assembly.Location;
|
||||
private static readonly AssemblyName AssemblyName = Assembly.GetName();
|
||||
//private static readonly string ExeName = AssemblyName.Name + ".exe";
|
||||
private static readonly string ExecutableFile = Assembly.Location;
|
||||
private static readonly string ExecutableName = Path.GetFileName(ExecutableFile);
|
||||
private static readonly string ExecutableDirectory = Path.GetDirectoryName(ExecutableFile);
|
||||
private static readonly WCF WCF = new WCF();
|
||||
|
||||
internal static readonly string Version = AssemblyName.Version.ToString();
|
||||
internal static readonly object ConsoleLock = new object();
|
||||
internal static readonly string Version = Assembly.GetName().Version.ToString();
|
||||
|
||||
internal static GlobalConfig GlobalConfig { get; private set; }
|
||||
internal static GlobalDatabase GlobalDatabase { get; private set; }
|
||||
internal static bool ConsoleIsBusy { get; private set; } = false;
|
||||
|
||||
private static Timer AutoUpdatesTimer;
|
||||
private static EMode Mode = EMode.Normal;
|
||||
|
||||
private static async Task CheckForUpdate() {
|
||||
JObject response = await WebBrowser.UrlGetToJObject(LatestGithubReleaseURL).ConfigureAwait(false);
|
||||
if (response == null) {
|
||||
string oldExeFile = ExecutableFile + ".old";
|
||||
|
||||
// We booted successfully so we can now remove old exe file
|
||||
if (File.Exists(oldExeFile)) {
|
||||
try {
|
||||
File.Delete(oldExeFile);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (GlobalConfig.UpdateChannel == GlobalConfig.EUpdateChannel.Unknown) {
|
||||
return;
|
||||
}
|
||||
|
||||
string remoteVersion = response["tag_name"].ToString();
|
||||
if (string.IsNullOrEmpty(remoteVersion)) {
|
||||
string releaseURL = GithubReleaseURL;
|
||||
if (GlobalConfig.UpdateChannel == GlobalConfig.EUpdateChannel.Stable) {
|
||||
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);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(response)) {
|
||||
Logging.LogGenericWarning("Could not check latest version!");
|
||||
return;
|
||||
}
|
||||
|
||||
string localVersion = Version;
|
||||
GitHub.ReleaseResponse releaseResponse = null;
|
||||
if (GlobalConfig.UpdateChannel == GlobalConfig.EUpdateChannel.Stable) {
|
||||
try {
|
||||
releaseResponse = JsonConvert.DeserializeObject<GitHub.ReleaseResponse>(response);
|
||||
} catch (JsonException e) {
|
||||
Logging.LogGenericException(e);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
List<GitHub.ReleaseResponse> releases;
|
||||
try {
|
||||
releases = JsonConvert.DeserializeObject<List<GitHub.ReleaseResponse>>(response);
|
||||
} catch (JsonException e) {
|
||||
Logging.LogGenericException(e);
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericNotice("", "Local version: " + localVersion);
|
||||
Logging.LogGenericNotice("", "Remote version: " + remoteVersion);
|
||||
if (releases == null || releases.Count == 0) {
|
||||
Logging.LogGenericWarning("Could not check latest version!");
|
||||
return;
|
||||
}
|
||||
|
||||
int comparisonResult = localVersion.CompareTo(remoteVersion);
|
||||
if (comparisonResult < 0) {
|
||||
Logging.LogGenericNotice("", "New version is available!");
|
||||
Logging.LogGenericNotice("", "Consider updating yourself!");
|
||||
releaseResponse = releases[0];
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(releaseResponse.Tag)) {
|
||||
Logging.LogGenericWarning("Could not check latest version!");
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Local version: " + Version + " | Remote version: " + releaseResponse.Tag);
|
||||
|
||||
if (Version.CompareTo(releaseResponse.Tag) >= 0) { // If local version is the same or newer than remote version
|
||||
// Set up a timer that will automatically update ASF on as-needed basis
|
||||
if (GlobalConfig.AutoUpdates && AutoUpdatesTimer == null) {
|
||||
Logging.LogGenericInfo("ASF will automatically check for new versions every 24 hours");
|
||||
AutoUpdatesTimer = new Timer(
|
||||
async e => await CheckForUpdate().ConfigureAwait(false),
|
||||
null,
|
||||
TimeSpan.FromDays(1), // Delay
|
||||
TimeSpan.FromDays(1) // Period
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GlobalConfig.AutoUpdates) {
|
||||
Logging.LogGenericInfo("New version is available!");
|
||||
Logging.LogGenericInfo("Consider updating yourself!");
|
||||
await Utilities.SleepAsync(5000).ConfigureAwait(false);
|
||||
} else if (comparisonResult > 0) {
|
||||
Logging.LogGenericNotice("", "You're currently using pre-release version!");
|
||||
Logging.LogGenericNotice("", "Be careful!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Auto update logic starts here
|
||||
if (releaseResponse.Assets == null) {
|
||||
Logging.LogGenericWarning("Could not proceed with update because that version doesn't include assets!");
|
||||
return;
|
||||
}
|
||||
|
||||
GitHub.Asset binaryAsset = null;
|
||||
foreach (var asset in releaseResponse.Assets) {
|
||||
if (string.IsNullOrEmpty(asset.Name) || !asset.Name.Equals(ExecutableName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
binaryAsset = asset;
|
||||
break;
|
||||
}
|
||||
|
||||
if (binaryAsset == null) {
|
||||
Logging.LogGenericWarning("Could not proceed with update because there is no asset that relates to currently running binary!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(binaryAsset.DownloadURL)) {
|
||||
Logging.LogGenericWarning("Could not proceed with update because download URL is empty!");
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Downloading new version...");
|
||||
Stream newExe = await WebBrowser.UrlGetToStream(binaryAsset.DownloadURL).ConfigureAwait(false);
|
||||
if (newExe == null) {
|
||||
Logging.LogGenericWarning("Could not download new version!");
|
||||
return;
|
||||
}
|
||||
|
||||
// We start deep update logic here
|
||||
string newExeFile = ExecutableFile + ".new";
|
||||
|
||||
// Firstly we create new exec
|
||||
try {
|
||||
using (FileStream fileStream = File.Open(newExeFile, FileMode.Create)) {
|
||||
await newExe.CopyToAsync(fileStream).ConfigureAwait(false);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return;
|
||||
}
|
||||
|
||||
// Now we move current -> old
|
||||
try {
|
||||
File.Move(ExecutableFile, oldExeFile);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
try {
|
||||
// Cleanup
|
||||
File.Delete(newExeFile);
|
||||
} catch { }
|
||||
return;
|
||||
}
|
||||
|
||||
// Now we move new -> current
|
||||
try {
|
||||
File.Move(newExeFile, ExecutableFile);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
try {
|
||||
// Cleanup
|
||||
File.Move(oldExeFile, ExecutableFile);
|
||||
File.Delete(newExeFile);
|
||||
} catch { }
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Update process is finished! ASF will now restart itself...");
|
||||
await Utilities.SleepAsync(5000);
|
||||
|
||||
if (!Restart()) {
|
||||
// Make sure that we won't try updating again in this case
|
||||
if (AutoUpdatesTimer != null) {
|
||||
AutoUpdatesTimer.Dispose();
|
||||
AutoUpdatesTimer = null;
|
||||
}
|
||||
|
||||
// Inform user about failure
|
||||
Logging.LogGenericWarning("ASF could not restart itself, you may need to restart it manually!");
|
||||
await Utilities.SleepAsync(5000);
|
||||
}
|
||||
}
|
||||
|
||||
internal static async Task Exit(int exitCode = 0) {
|
||||
await Bot.ShutdownAllBots().ConfigureAwait(false);
|
||||
internal static void Exit(int exitCode = 0) {
|
||||
Environment.Exit(exitCode);
|
||||
}
|
||||
|
||||
internal static async Task Restart() {
|
||||
await Bot.ShutdownAllBots().ConfigureAwait(false);
|
||||
System.Diagnostics.Process.Start(ExecutablePath);
|
||||
Environment.Exit(0);
|
||||
internal static bool Restart() {
|
||||
try {
|
||||
// TODO: This probably won't work on Mono, I wonder if I can make it work at some point
|
||||
if (Process.Start(ExecutableFile, string.Join(" ", Environment.GetCommandLineArgs())) != null) {
|
||||
Exit();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
internal static async Task LimitSteamRequestsAsync() {
|
||||
await SteamSemaphore.WaitAsync().ConfigureAwait(false);
|
||||
await Utilities.SleepAsync(5 * 1000).ConfigureAwait(false); // We must add some delay to not get caught by Steam anty-DoS
|
||||
SteamSemaphore.Release();
|
||||
Task.Run(async () => {
|
||||
await Utilities.SleepAsync(GlobalConfig.RequestLimiterDelay * 1000).ConfigureAwait(false);
|
||||
SteamSemaphore.Release();
|
||||
}).Forget();
|
||||
}
|
||||
|
||||
internal static string GetUserInput(string botLogin, EUserInputType userInputType) {
|
||||
internal static string GetUserInput(string botLogin, EUserInputType userInputType, string extraInformation = null) {
|
||||
string result;
|
||||
lock (ConsoleLock) {
|
||||
ConsoleIsBusy = true;
|
||||
switch (userInputType) {
|
||||
case EUserInputType.Login:
|
||||
Console.Write("<" + botLogin + "> Please enter your login: ");
|
||||
@@ -108,70 +288,200 @@ namespace ArchiSteamFarm {
|
||||
case EUserInputType.Password:
|
||||
Console.Write("<" + botLogin + "> Please enter your password: ");
|
||||
break;
|
||||
case EUserInputType.PhoneNumber:
|
||||
Console.Write("<" + botLogin + "> Please enter your full phone number (e.g. +1234567890): ");
|
||||
break;
|
||||
case EUserInputType.SMS:
|
||||
Console.Write("<" + botLogin + "> Please enter SMS code sent on your mobile: ");
|
||||
break;
|
||||
case EUserInputType.SteamGuard:
|
||||
Console.Write("<" + botLogin + "> Please enter the auth code sent to your email: ");
|
||||
break;
|
||||
case EUserInputType.SteamParentalPIN:
|
||||
Console.Write("<" + botLogin + "> Please enter steam parental PIN: ");
|
||||
break;
|
||||
case EUserInputType.RevocationCode:
|
||||
Console.WriteLine("<" + botLogin + "> PLEASE WRITE DOWN YOUR REVOCATION CODE: " + extraInformation);
|
||||
Console.WriteLine("<" + botLogin + "> THIS IS THE ONLY WAY TO NOT GET LOCKED OUT OF YOUR ACCOUNT!");
|
||||
Console.Write("<" + botLogin + "> Hit enter once ready...");
|
||||
break;
|
||||
case EUserInputType.TwoFactorAuthentication:
|
||||
Console.Write("<" + botLogin + "> Please enter your 2 factor auth code from your authenticator app: ");
|
||||
break;
|
||||
}
|
||||
result = Console.ReadLine();
|
||||
Console.Clear(); // For security purposes
|
||||
ConsoleIsBusy = false;
|
||||
}
|
||||
result = result.Trim(); // Get rid of all whitespace characters
|
||||
return result;
|
||||
|
||||
return result.Trim(); // Get rid of all whitespace characters
|
||||
}
|
||||
|
||||
internal static async void OnBotShutdown(Bot bot) {
|
||||
if (Bot.GetRunningBotsCount() == 0) {
|
||||
Logging.LogGenericInfo("Main", "No bots are running, exiting");
|
||||
await Utilities.SleepAsync(5000).ConfigureAwait(false); // This might be the only message user gets, consider giving him some time
|
||||
ShutdownResetEvent.Set();
|
||||
internal static void OnBotShutdown() {
|
||||
foreach (Bot bot in Bot.Bots.Values) {
|
||||
if (bot.KeepRunning) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (WCF.IsServerRunning()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("No bots are running, exiting");
|
||||
ShutdownResetEvent.Set();
|
||||
}
|
||||
|
||||
private static void InitServices() {
|
||||
GlobalConfig = GlobalConfig.Load();
|
||||
if (GlobalConfig == null) {
|
||||
Logging.LogGenericError("Global config could not be loaded, please make sure that ASF.db exists and is valid!");
|
||||
Thread.Sleep(5000);
|
||||
Exit(1);
|
||||
}
|
||||
|
||||
GlobalDatabase = GlobalDatabase.Load();
|
||||
if (GlobalDatabase == null) {
|
||||
Logging.LogGenericError("Global database could not be loaded!");
|
||||
Thread.Sleep(5000);
|
||||
Exit(1);
|
||||
}
|
||||
|
||||
ArchiWebHandler.Init();
|
||||
WebBrowser.Init();
|
||||
WCF.Init();
|
||||
}
|
||||
|
||||
private static void ParseArgs(string[] args) {
|
||||
foreach (string arg in args) {
|
||||
switch (arg) {
|
||||
case "--client":
|
||||
Mode = EMode.Client;
|
||||
Logging.LogToFile = false;
|
||||
break;
|
||||
case "--log":
|
||||
Logging.LogToFile = true;
|
||||
break;
|
||||
case "--no-log":
|
||||
Logging.LogToFile = false;
|
||||
break;
|
||||
case "--server":
|
||||
Mode = EMode.Server;
|
||||
WCF.StartServer();
|
||||
break;
|
||||
default:
|
||||
if (arg.StartsWith("--")) {
|
||||
Logging.LogGenericWarning("Unrecognized parameter: " + arg);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Mode != EMode.Client) {
|
||||
Logging.LogGenericWarning("Ignoring command because --client wasn't specified: " + arg);
|
||||
continue;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Command sent: \"" + arg + "\"");
|
||||
|
||||
// We intentionally execute this async block synchronously
|
||||
Logging.LogGenericInfo("Response received: \"" + WCF.SendCommand(arg) + "\"");
|
||||
/*
|
||||
Task.Run(async () => {
|
||||
Logging.LogGenericNotice("WCF", "Response received: " + await WCF.SendCommand(arg).ConfigureAwait(false));
|
||||
}).Wait();
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs args) {
|
||||
if (sender == null || args == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericException((Exception) args.ExceptionObject);
|
||||
}
|
||||
|
||||
private static void Main(string[] args) {
|
||||
Logging.LogGenericInfo("Main", "Archi's Steam Farm, version " + Version);
|
||||
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
|
||||
|
||||
Logging.LogGenericInfo("Archi's Steam Farm, version " + Version);
|
||||
Directory.SetCurrentDirectory(ExecutableDirectory);
|
||||
InitServices();
|
||||
|
||||
Task.Run(async () => await CheckForUpdate().ConfigureAwait(false)).Wait();
|
||||
|
||||
// Allow loading configs from source tree if it's a debug build
|
||||
if (Debugging.IsDebugBuild) {
|
||||
|
||||
// Common structure is bin/(x64/)Debug/ArchiSteamFarm.exe, so we allow up to 4 directories up
|
||||
for (var i = 0; i < 4; i++) {
|
||||
Directory.SetCurrentDirectory("..");
|
||||
if (Directory.Exists(ConfigDirectoryPath)) {
|
||||
if (Directory.Exists(ConfigDirectory)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!Directory.Exists(ConfigDirectoryPath)) {
|
||||
Logging.LogGenericError("Main", "Config directory doesn't exist!");
|
||||
Console.ReadLine();
|
||||
Task.Run(async () => await Exit(1).ConfigureAwait(false)).Wait();
|
||||
}
|
||||
|
||||
foreach (var configFile in Directory.EnumerateFiles(ConfigDirectoryPath, "*.xml")) {
|
||||
string botName = Path.GetFileNameWithoutExtension(configFile);
|
||||
Bot bot = new Bot(botName);
|
||||
if (!bot.Enabled) {
|
||||
Logging.LogGenericInfo(botName, "Not starting this instance because it's disabled in config file");
|
||||
// If config directory doesn't exist after our adjustment, abort all of that
|
||||
if (!Directory.Exists(ConfigDirectory)) {
|
||||
Directory.SetCurrentDirectory(ExecutableDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we got any bots running
|
||||
OnBotShutdown(null);
|
||||
// Parse args
|
||||
ParseArgs(args);
|
||||
|
||||
// If we ran ASF as a client, we're done by now
|
||||
if (Mode == EMode.Client) {
|
||||
return;
|
||||
}
|
||||
|
||||
// From now on it's server mode
|
||||
Logging.Init();
|
||||
|
||||
if (!Directory.Exists(ConfigDirectory)) {
|
||||
Logging.LogGenericError("Config directory doesn't exist!");
|
||||
Thread.Sleep(5000);
|
||||
Exit(1);
|
||||
}
|
||||
|
||||
CheckForUpdate().Wait();
|
||||
|
||||
// Before attempting to connect, initialize our list of CMs
|
||||
Bot.RefreshCMs(GlobalDatabase.CellID).Wait();
|
||||
|
||||
foreach (var configFile in Directory.EnumerateFiles(ConfigDirectory, "*.json")) {
|
||||
string botName = Path.GetFileNameWithoutExtension(configFile);
|
||||
if (botName.Equals(ASF)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Bot bot = new Bot(botName);
|
||||
if (!bot.BotConfig.Enabled) {
|
||||
Logging.LogGenericInfo("Not starting this instance because it's disabled in config file", botName);
|
||||
}
|
||||
}
|
||||
|
||||
// CONVERSION START
|
||||
foreach (var configFile in Directory.EnumerateFiles(ConfigDirectory, "*.xml")) {
|
||||
string botName = Path.GetFileNameWithoutExtension(configFile);
|
||||
Logging.LogGenericWarning("Found legacy " + botName + ".xml config file, it will now be converted to new ASF V2.0 format!");
|
||||
Bot bot = new Bot(botName);
|
||||
if (!bot.BotConfig.Enabled) {
|
||||
Logging.LogGenericInfo("Not starting this instance because it's disabled in config file", botName);
|
||||
}
|
||||
}
|
||||
// CONVERSION END
|
||||
|
||||
// Check if we got any bots running
|
||||
OnBotShutdown();
|
||||
|
||||
// Wait for signal to shutdown
|
||||
ShutdownResetEvent.WaitOne();
|
||||
|
||||
// We got a signal to shutdown, consider giving user some time to read the message
|
||||
Thread.Sleep(5000);
|
||||
|
||||
// This is over, cleanup only now
|
||||
WCF.StopServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ArchiSteamFarm")]
|
||||
[assembly: AssemblyCopyright("Copyright © Łukasz Domeradzki 2015")]
|
||||
[assembly: AssemblyCopyright("Copyright © Łukasz Domeradzki 2015-2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -32,5 +32,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("0.9.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.9.0.0")]
|
||||
[assembly: AssemblyVersion("2.0.0.1")]
|
||||
[assembly: AssemblyFileVersion("2.0.0.1")]
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -22,16 +22,34 @@
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class SteamItem {
|
||||
// REF: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService
|
||||
// REF: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService#CEcon_Asset
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal string appid { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal string contextid { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal string assetid { get; set; }
|
||||
internal string currencyid { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
internal string id {
|
||||
get { return assetid; }
|
||||
set { assetid = value; }
|
||||
}
|
||||
|
||||
[JsonProperty(Required = Required.AllowNull)]
|
||||
internal string classid { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.AllowNull)]
|
||||
internal string instanceid { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal string amount { get; set; }
|
||||
internal bool missing { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
33
ArchiSteamFarm/SteamItemList.cs
Normal file
33
ArchiSteamFarm/SteamItemList.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
_ _ _ ____ _ _____
|
||||
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class SteamItemList {
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal List<SteamItem> assets { get; } = new List<SteamItem>();
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -22,13 +22,14 @@
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using SteamKit2;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class SteamTradeOffer {
|
||||
// REF: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService
|
||||
internal enum ETradeOfferState {
|
||||
// REF: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService#CEcon_TradeOffer
|
||||
internal enum ETradeOfferState : byte {
|
||||
Unknown,
|
||||
Invalid,
|
||||
Active,
|
||||
@@ -39,20 +40,24 @@ namespace ArchiSteamFarm {
|
||||
Declined,
|
||||
InvalidItems,
|
||||
EmailPending,
|
||||
EmailCanceled
|
||||
EmailCanceled,
|
||||
OnHold
|
||||
}
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal string tradeofferid { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal int accountid_other { get; set; }
|
||||
internal string message { get; set; }
|
||||
internal int expiration_time { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal ETradeOfferState trade_offer_state { get; set; }
|
||||
internal List<SteamItem> items_to_give { get; set; }
|
||||
internal List<SteamItem> items_to_receive { get; set; }
|
||||
internal bool is_our_offer { get; set; }
|
||||
internal int time_created { get; set; }
|
||||
internal int time_updated { get; set; }
|
||||
internal bool from_real_time_trade { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal List<SteamItem> items_to_give { get; } = new List<SteamItem>();
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal List<SteamItem> items_to_receive { get; } = new List<SteamItem>();
|
||||
|
||||
// Extra
|
||||
private ulong _OtherSteamID64 = 0;
|
||||
|
||||
41
ArchiSteamFarm/SteamTradeOfferRequest.cs
Normal file
41
ArchiSteamFarm/SteamTradeOfferRequest.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
_ _ _ ____ _ _____
|
||||
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class SteamTradeOfferRequest {
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal bool newversion { get; } = true;
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal int version { get; } = 2;
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal SteamItemList me { get; } = new SteamItemList();
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
internal SteamItemList them { get; } = new SteamItemList();
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -28,10 +28,23 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class Trading {
|
||||
internal const byte MaxItemsPerTrade = 150; // This is due to limit on POST size in WebBrowser
|
||||
internal const byte MaxTradesPerAccount = 5; // This is limit introduced by Valve
|
||||
|
||||
private static readonly SemaphoreSlim InventorySemaphore = new SemaphoreSlim(1);
|
||||
|
||||
private readonly Bot Bot;
|
||||
private readonly SemaphoreSlim Semaphore = new SemaphoreSlim(1);
|
||||
private volatile byte ParsingTasks = 0;
|
||||
|
||||
internal static async Task LimitInventoryRequestsAsync() {
|
||||
await InventorySemaphore.WaitAsync().ConfigureAwait(false);
|
||||
Task.Run(async () => {
|
||||
await Utilities.SleepAsync(Program.GlobalConfig.RequestLimiterDelay * 1000).ConfigureAwait(false);
|
||||
InventorySemaphore.Release();
|
||||
}).Forget();
|
||||
}
|
||||
|
||||
internal Trading(Bot bot) {
|
||||
Bot = bot;
|
||||
}
|
||||
@@ -62,6 +75,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||
await Bot.AcceptAllConfirmations().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task ParseTrade(SteamTradeOffer tradeOffer) {
|
||||
@@ -74,20 +88,11 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
bool success, tradeAccepted;
|
||||
|
||||
if (tradeOffer.items_to_give.Count == 0 || tradeOffer.OtherSteamID64 == Bot.SteamMasterID) {
|
||||
tradeAccepted = true;
|
||||
Logging.LogGenericInfo(Bot.BotName, "Accepting trade: " + tradeID);
|
||||
success = await Bot.ArchiWebHandler.AcceptTradeOffer(tradeID).ConfigureAwait(false);
|
||||
if (tradeOffer.items_to_give.Count == 0 || tradeOffer.OtherSteamID64 == Bot.BotConfig.SteamMasterID) {
|
||||
Logging.LogGenericInfo("Accepting trade: " + tradeID, Bot.BotName);
|
||||
await Bot.ArchiWebHandler.AcceptTradeOffer(tradeID).ConfigureAwait(false);
|
||||
} else {
|
||||
tradeAccepted = false;
|
||||
Logging.LogGenericInfo(Bot.BotName, "Rejecting trade: " + tradeID);
|
||||
success = Bot.ArchiWebHandler.DeclineTradeOffer(tradeID);
|
||||
}
|
||||
|
||||
if (tradeAccepted && success) {
|
||||
// Do whatever we want with success
|
||||
Logging.LogGenericInfo("Ignoring trade: " + tradeID, Bot.BotName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -27,6 +27,8 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class Utilities {
|
||||
internal static void Forget(this Task task) { }
|
||||
|
||||
internal static async Task SleepAsync(int miliseconds) {
|
||||
await Task.Delay(miliseconds).ConfigureAwait(false);
|
||||
}
|
||||
@@ -56,5 +58,20 @@ namespace ArchiSteamFarm {
|
||||
|
||||
return Regex.Replace(text, @"[^\d]", "");
|
||||
}
|
||||
|
||||
internal static uint GetCharCountInString(string s, char c) {
|
||||
if (string.IsNullOrEmpty(s)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint count = 0;
|
||||
foreach (char singleChar in s) {
|
||||
if (singleChar == c) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
137
ArchiSteamFarm/WCF.cs
Normal file
137
ArchiSteamFarm/WCF.cs
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
_ _ _ ____ _ _____
|
||||
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
[ServiceContract]
|
||||
internal interface IWCF {
|
||||
[OperationContract]
|
||||
string HandleCommand(string input);
|
||||
}
|
||||
|
||||
internal sealed class WCF : IWCF {
|
||||
|
||||
private static string URL = "http://localhost:1242/ASF";
|
||||
|
||||
private ServiceHost ServiceHost;
|
||||
private Client Client;
|
||||
|
||||
internal static void Init() {
|
||||
URL = "http://" + Program.GlobalConfig.WCFHostname + ":" + Program.GlobalConfig.WCFPort + "/ASF";
|
||||
}
|
||||
|
||||
internal bool IsServerRunning() {
|
||||
return ServiceHost != null;
|
||||
}
|
||||
|
||||
internal void StartServer() {
|
||||
if (ServiceHost != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Starting WCF server...");
|
||||
ServiceHost = new ServiceHost(typeof(WCF));
|
||||
ServiceHost.AddServiceEndpoint(typeof(IWCF), new BasicHttpBinding(), URL);
|
||||
|
||||
try {
|
||||
ServiceHost.Open();
|
||||
} catch (AddressAccessDeniedException) {
|
||||
Logging.LogGenericWarning("WCF service could not be started because of AddressAccessDeniedException");
|
||||
Logging.LogGenericWarning("If you want to use WCF service provided by ASF, consider starting ASF as administrator, or giving proper permissions");
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("WCF server ready!");
|
||||
}
|
||||
|
||||
internal void StopServer() {
|
||||
if (ServiceHost == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ServiceHost.Close();
|
||||
ServiceHost = null;
|
||||
}
|
||||
|
||||
internal string SendCommand(string input) {
|
||||
if (Client == null) {
|
||||
Client = new Client(new BasicHttpBinding(), new EndpointAddress(URL));
|
||||
}
|
||||
|
||||
return Client.HandleCommand(input);
|
||||
}
|
||||
|
||||
public string HandleCommand(string input) {
|
||||
if (string.IsNullOrEmpty(input)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
string[] args = input.Split(' ');
|
||||
|
||||
string botName;
|
||||
|
||||
if (args.Length > 1) { // If we have args[1] provided, use given botName
|
||||
botName = args[1];
|
||||
} else { // If not, just pick first one
|
||||
botName = Bot.GetAnyBotName();
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(botName)) {
|
||||
return "ERROR: Invalid botName: " + botName;
|
||||
}
|
||||
|
||||
Bot bot;
|
||||
if (!Bot.Bots.TryGetValue(botName, out bot)) {
|
||||
return "ERROR: Couldn't find any bot named: " + botName;
|
||||
}
|
||||
|
||||
Logging.LogGenericInfo("Received command: \"" + input + "\"");
|
||||
|
||||
string command = '!' + input;
|
||||
string output = bot.HandleMessage(command).Result; // TODO: This should be asynchronous
|
||||
|
||||
Logging.LogGenericInfo("Answered to command: \"" + input + "\" with: \"" + output + "\"");
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class Client : ClientBase<IWCF>, IWCF {
|
||||
internal Client(Binding binding, EndpointAddress address) : base(binding, address) { }
|
||||
|
||||
public string HandleCommand(string input) {
|
||||
try {
|
||||
return Channel.HandleCommand(input);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||
|
||||
Copyright 2015 Łukasz "JustArchi" Domeradzki
|
||||
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||
Contact: JustArchi@JustArchi.net
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -26,67 +26,44 @@ using HtmlAgilityPack;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class WebBrowser {
|
||||
internal const byte HttpTimeout = 180; // In seconds
|
||||
internal const byte MaxConnections = 10; // Defines maximum number of connections per ServicePoint. Be careful, as it also defines maximum number of sockets in CLOSE_WAIT state
|
||||
internal const byte MaxIdleTime = 15; // In seconds, how long socket is allowed to stay in CLOSE_WAIT state after there are no connections to it
|
||||
internal const byte MaxRetries = 5; // Defines maximum number of retries, UrlRequest() does not handle retry by itself (it's app responsibility)
|
||||
|
||||
private static readonly HttpClientHandler HttpClientHandler = new HttpClientHandler { UseCookies = false };
|
||||
private static readonly HttpClient HttpClient = new HttpClient(HttpClientHandler) { Timeout = TimeSpan.FromSeconds(HttpTimeout) };
|
||||
private static readonly string DefaultUserAgent = "ArchiSteamFarm/" + Program.Version;
|
||||
private static readonly HttpClient HttpClient = new HttpClient(new HttpClientHandler {
|
||||
UseCookies = false
|
||||
}) {
|
||||
Timeout = TimeSpan.FromSeconds(30)
|
||||
};
|
||||
|
||||
internal static void Init() {
|
||||
HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd("ArchiSteamFarm/" + Program.Version);
|
||||
HttpClient.Timeout = TimeSpan.FromSeconds(Program.GlobalConfig.HttpTimeout);
|
||||
|
||||
// Don't limit maximum number of allowed concurrent connections
|
||||
// It's application's responsibility to handle that stuff
|
||||
ServicePointManager.DefaultConnectionLimit = int.MaxValue;
|
||||
}
|
||||
// Most web services expect that UserAgent is set, so we declare it globally
|
||||
// Any request can override that on as-needed basis (see: RequestOptions.FakeUserAgent)
|
||||
HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd(DefaultUserAgent);
|
||||
|
||||
private static async Task<HttpResponseMessage> UrlRequest(string request, HttpMethod httpMethod, Dictionary<string, string> data = null, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request) || httpMethod == null) {
|
||||
return null;
|
||||
}
|
||||
// Set max connection limit from default of 2 to desired value
|
||||
ServicePointManager.DefaultConnectionLimit = MaxConnections;
|
||||
|
||||
HttpRequestMessage requestMessage = new HttpRequestMessage(httpMethod, request);
|
||||
// Set max idle time from default of 100 seconds (100 * 1000) to desired value
|
||||
ServicePointManager.MaxServicePointIdleTime = MaxIdleTime * 1000;
|
||||
|
||||
if (httpMethod == HttpMethod.Post && data != null) {
|
||||
requestMessage.Content = new FormUrlEncodedContent(data);
|
||||
}
|
||||
// Don't use Expect100Continue, we're sure about our POSTs, save some TCP packets
|
||||
ServicePointManager.Expect100Continue = false;
|
||||
|
||||
if (cookies != null && cookies.Count > 0) {
|
||||
StringBuilder cookieHeader = new StringBuilder();
|
||||
foreach (KeyValuePair<string, string> cookie in cookies) {
|
||||
cookieHeader.Append(cookie.Key + "=" + cookie.Value + ";");
|
||||
}
|
||||
requestMessage.Headers.Add("Cookie", cookieHeader.ToString());
|
||||
}
|
||||
|
||||
if (referer != null) {
|
||||
requestMessage.Headers.Referrer = new Uri(referer);
|
||||
}
|
||||
|
||||
HttpResponseMessage responseMessage;
|
||||
|
||||
try {
|
||||
responseMessage = await HttpClient.SendAsync(requestMessage).ConfigureAwait(false);
|
||||
} catch { // Request failed, we don't need to know the exact reason, swallow exception
|
||||
return null;
|
||||
}
|
||||
|
||||
if (responseMessage == null || !responseMessage.IsSuccessStatusCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!responseMessage.IsSuccessStatusCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return responseMessage;
|
||||
// Reuse ports if possible
|
||||
// TODO: Mono doesn't support that feature yet
|
||||
//ServicePointManager.ReusePort = true;
|
||||
}
|
||||
|
||||
internal static async Task<HttpResponseMessage> UrlGet(string request, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
@@ -97,29 +74,12 @@ namespace ArchiSteamFarm {
|
||||
return await UrlRequest(request, HttpMethod.Get, null, cookies, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal static async Task<HttpResponseMessage> UrlPost(string request, Dictionary<string, string> postData = null, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
internal static async Task<HttpResponseMessage> UrlPost(string request, Dictionary<string, string> data = null, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await UrlRequest(request, HttpMethod.Post, postData, cookies, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal static async Task<HtmlDocument> HttpResponseToHtmlDocument(HttpResponseMessage httpResponse) {
|
||||
if (httpResponse == null || httpResponse.Content == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
string content = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
if (string.IsNullOrEmpty(content)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
content = WebUtility.HtmlDecode(content);
|
||||
HtmlDocument htmlDocument = new HtmlDocument();
|
||||
htmlDocument.LoadHtml(content);
|
||||
|
||||
return htmlDocument;
|
||||
return await UrlRequest(request, HttpMethod.Post, data, cookies, referer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal static async Task<string> UrlGetToContent(string request, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
@@ -127,59 +87,36 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
HttpResponseMessage responseMessage = await UrlGet(request, cookies, referer).ConfigureAwait(false);
|
||||
if (responseMessage == null || responseMessage.Content == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal static async Task<string> UrlPostToContent(string request, Dictionary<string, string> postData = null, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
HttpResponseMessage responseMessage = await UrlPost(request, postData, cookies, referer).ConfigureAwait(false);
|
||||
if (responseMessage == null || responseMessage.Content == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal static async Task<string> UrlGetToTitle(string request, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
HtmlDocument htmlDocument = await UrlGetToHtmlDocument(request, cookies, referer).ConfigureAwait(false);
|
||||
if (htmlDocument == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
HtmlNode htmlNode = htmlDocument.DocumentNode.SelectSingleNode("//head/title");
|
||||
if (htmlNode == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return htmlNode.InnerText;
|
||||
}
|
||||
|
||||
internal static async Task<HtmlDocument> UrlGetToHtmlDocument(string request, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
HttpResponseMessage httpResponse = await UrlGet(request, cookies, referer).ConfigureAwait(false);
|
||||
if (httpResponse == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await HttpResponseToHtmlDocument(httpResponse).ConfigureAwait(false);
|
||||
if (httpResponse.Content == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal static async Task<JArray> UrlGetToJArray(string request, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
internal static async Task<Stream> UrlGetToStream(string request, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
HttpResponseMessage httpResponse = await UrlGet(request, cookies, referer).ConfigureAwait(false);
|
||||
if (httpResponse == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (httpResponse.Content == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal static async Task<HtmlDocument> UrlGetToHtmlDocument(string request, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
return null;
|
||||
}
|
||||
@@ -189,16 +126,11 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
JArray jArray;
|
||||
content = WebUtility.HtmlDecode(content);
|
||||
HtmlDocument htmlDocument = new HtmlDocument();
|
||||
htmlDocument.LoadHtml(content);
|
||||
|
||||
try {
|
||||
jArray = JArray.Parse(content);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException("WebBrowser", e);
|
||||
return null;
|
||||
}
|
||||
|
||||
return jArray;
|
||||
return htmlDocument;
|
||||
}
|
||||
|
||||
internal static async Task<JObject> UrlGetToJObject(string request, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
@@ -216,33 +148,53 @@ namespace ArchiSteamFarm {
|
||||
try {
|
||||
jObject = JObject.Parse(content);
|
||||
} catch (Exception e) {
|
||||
Logging.LogGenericException("WebBrowser", e);
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
return jObject;
|
||||
}
|
||||
|
||||
internal static async Task<XmlDocument> UrlGetToXML(string request, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request)) {
|
||||
private static async Task<HttpResponseMessage> UrlRequest(string request, HttpMethod httpMethod, Dictionary<string, string> data = null, Dictionary<string, string> cookies = null, string referer = null) {
|
||||
if (string.IsNullOrEmpty(request) || httpMethod == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
string content = await UrlGetToContent(request, cookies, referer).ConfigureAwait(false);
|
||||
if (string.IsNullOrEmpty(content)) {
|
||||
HttpResponseMessage responseMessage;
|
||||
using (HttpRequestMessage requestMessage = new HttpRequestMessage(httpMethod, request)) {
|
||||
if (data != null && data.Count > 0) {
|
||||
try {
|
||||
requestMessage.Content = new FormUrlEncodedContent(data);
|
||||
} catch (UriFormatException e) {
|
||||
Logging.LogGenericException(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (cookies != null && cookies.Count > 0) {
|
||||
StringBuilder cookieHeader = new StringBuilder();
|
||||
foreach (KeyValuePair<string, string> cookie in cookies) {
|
||||
cookieHeader.Append(cookie.Key + "=" + cookie.Value + ";");
|
||||
}
|
||||
requestMessage.Headers.Add("Cookie", cookieHeader.ToString());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(referer)) {
|
||||
requestMessage.Headers.Referrer = new Uri(referer);
|
||||
}
|
||||
|
||||
try {
|
||||
responseMessage = await HttpClient.SendAsync(requestMessage).ConfigureAwait(false);
|
||||
} catch { // Request failed, we don't need to know the exact reason, swallow exception
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (responseMessage == null || !responseMessage.IsSuccessStatusCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
XmlDocument xmlDocument = new XmlDocument();
|
||||
|
||||
try {
|
||||
xmlDocument.LoadXml(content);
|
||||
} catch (XmlException e) {
|
||||
Logging.LogGenericException("WebBrowser", e);
|
||||
return null;
|
||||
}
|
||||
|
||||
return xmlDocument;
|
||||
return responseMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
ArchiSteamFarm/config/ASF.json
Normal file
17
ArchiSteamFarm/config/ASF.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"Debug": false,
|
||||
"AutoUpdates": true,
|
||||
"UpdateChannel": 1,
|
||||
"HttpTimeout": 30,
|
||||
"AccountPlayingDelay": 5,
|
||||
"RequestLimiterDelay": 7,
|
||||
"WCFHostname": "localhost",
|
||||
"WCFPort": 1242,
|
||||
"Blacklist": [
|
||||
267420,
|
||||
303700,
|
||||
335590,
|
||||
368020,
|
||||
425280
|
||||
]
|
||||
}
|
||||
26
ArchiSteamFarm/config/example.json
Normal file
26
ArchiSteamFarm/config/example.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"Enabled": false,
|
||||
"StartOnLaunch": true,
|
||||
"SteamLogin": null,
|
||||
"SteamPassword": null,
|
||||
"SteamParentalPIN": "0",
|
||||
"SteamApiKey": null,
|
||||
"SteamMasterID": 0,
|
||||
"SteamMasterClanID": 0,
|
||||
"CardDropsRestricted": false,
|
||||
"DismissInventoryNotifications": true,
|
||||
"FarmOffline": false,
|
||||
"HandleOfflineMessages": false,
|
||||
"ForwardKeysToOtherBots": false,
|
||||
"DistributeKeys": false,
|
||||
"UseAsfAsMobileAuthenticator": false,
|
||||
"ShutdownOnFarmingFinished": false,
|
||||
"SendOnFarmingFinished": false,
|
||||
"SteamTradeToken": null,
|
||||
"SendTradePeriod": 0,
|
||||
"CustomGamePlayedWhileIdle": null,
|
||||
"GamesPlayedWhileIdle": [
|
||||
0
|
||||
],
|
||||
"Statistics": true
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<!-- Every bot should have it's own unique .xml configuration file, this is example on which you can base on -->
|
||||
|
||||
<!-- Notice, if you use special characters reserved for XML, you should escape them -->
|
||||
<!-- Escape table: [& - &] | [" - "] | [' - '] | [< - <] | [> - >] -->
|
||||
<!-- So e.g. if your SteamPassword is "foo&" you should write value="foo&" -->
|
||||
|
||||
<!-- Type of the property is a tip for you that defines what values you can use -->
|
||||
<!-- bool - Boolean value that can be only "true" or "false" -->
|
||||
<!-- string - Any sequence of characters, unless stated otherwise (keep in mind escape table above), with special treatment of "null" value -->
|
||||
<!-- uint - 32-bit unsigned integer, used mostly for steam appID -->
|
||||
<!-- ulong - 64-bit unsigned (long) integer, used mostly for representing steamID64 -->
|
||||
<!-- HashSet(uint) - Comma-separated list of unique 32-bit unsigned integers -->
|
||||
|
||||
<!-- Master switch to turn account on and off, set to "true" after you're done -->
|
||||
<!-- TIP: This bot instance won't run unless below switch is set to "true" -->
|
||||
<Enabled type="bool" value="false"/>
|
||||
|
||||
<!-- This is your steam login, the one you use for logging in to steam -->
|
||||
<!-- TIP: You can use "null" if you wish to enter login on every startup -->
|
||||
<SteamLogin type="string" value="null"/>
|
||||
|
||||
<!-- This is your steam password, the one you use for logging in to steam -->
|
||||
<!-- TIP: You can use "null" if you wish to enter password on every startup -->
|
||||
<SteamPassword type="string" value="null"/>
|
||||
|
||||
<!-- This is steam nickname, the one you want to use for bot. Can be anything up to 32 characters -->
|
||||
<!-- TIP: You can use "null" if you wish to preserve your actual nickname -->
|
||||
<SteamNickname type="string" value="null"/>
|
||||
|
||||
<!-- This is your bot's API key, get one at https://steamcommunity.com/dev/apikey while logged in as bot, domain doesn't matter -->
|
||||
<!-- TIP: You can use "null", but it will disable all API-based functionalities such as trading -->
|
||||
<SteamApiKey type="string" value="null"/>
|
||||
|
||||
<!-- This is your parental PIN if you use steam parental functionality -->
|
||||
<!-- TIP: Most likely you don't want to change it. You can use "null" if you wish to enter PIN on every startup, 0 means there is no PIN -->
|
||||
<SteamParentalPIN type="string" value="0"/>
|
||||
|
||||
<!-- This is steamID64 of the bot-master - you, for example "76561198006963719" -->
|
||||
<!-- You can get one e.g. by logging in to http://steamrep.com/ -->
|
||||
<!-- TIP: You can use "0", but bot won't accept steam cd-keys or trades from anybody" -->
|
||||
<SteamMasterID type="ulong" value="0"/>
|
||||
|
||||
<!-- This is steamID64 of the master clan (group). If defined, bot will join the group and the chat automatically after logging in -->
|
||||
<!-- The easiest way to get one is to check groups on your profile: http://steamcommunity.com/my/profile" -->
|
||||
<!-- Then copying the URL of "Leave group" link, it will look like this: javascript:leaveGroupPrompt('103582791440160998','Archi\'s SC Farm') -->
|
||||
<!-- The steamID64 we're looking for is there, in above example: "103582791440160998" -->
|
||||
<!-- TIP: If you don't have your own farming group, most likely you don't want to change it, 0 means there is no master group defined -->
|
||||
<SteamMasterClanID type="ulong" value="0"/>
|
||||
|
||||
<!-- This switch defines if the account has card drops restricted -->
|
||||
<!-- Restricted card drops means that the account doesn't receive any steam cards until it plays the game for at least 2 hours -->
|
||||
<!-- As there is no magical way to detect it by ASF, I made this option config-based switch -->
|
||||
<!-- TIP: Based on this parameter, ASF will try to choose the most optimal cards farming algorithm for this account -->
|
||||
<CardDropsRestricted type="bool" value="false"/>
|
||||
|
||||
<!-- This switch defines if bot should disconnect once farming is finished -->
|
||||
<!-- When no bots are active, ASF will shutdown as well -->
|
||||
<!-- Some people may want to keep their bots 24/7, other disconnect them after job is done -->
|
||||
<!-- Choose yourself what you prefer -->
|
||||
<ShutdownOnFarmingFinished type="bool" value="false"/>
|
||||
|
||||
<!-- Comma-separated list of IDs that should not be considered for farming -->
|
||||
<!-- Default value includes appIDs that are wrongly appearing on the profile, e.g. Monster Summer Sale -->
|
||||
<!-- TIP: Most likely you don't want to change it -->
|
||||
<Blacklist type="HashSet(uint)" value="303700,335590,368020"/>
|
||||
|
||||
<!-- This switch enables statistics for me - bot will join Archi's SC Farm group and chat -->
|
||||
<!-- Consider leaving it at "true", this way I can check how many running bots are active -->
|
||||
<!-- That directly affects my willings to work on the project, as I can see how many users are actually using it -->
|
||||
<!-- TIP: Group link is http://steamcommunity.com/groups/ascfarm -->
|
||||
<Statistics type="bool" value="true"/>
|
||||
</configuration>
|
||||
5
ArchiSteamFarm/config/minimal.json
Normal file
5
ArchiSteamFarm/config/minimal.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"Enabled": false,
|
||||
"SteamLogin": null,
|
||||
"SteamPassword": null
|
||||
}
|
||||
@@ -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.1-beta3" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net452" />
|
||||
<package id="protobuf-net" version="2.0.0.668" targetFramework="net45" />
|
||||
<package id="SteamKit2" version="1.6.5" targetFramework="net45" />
|
||||
<package id="SteamKit2" version="1.7.0" targetFramework="net452" />
|
||||
</packages>
|
||||
39
README.md
39
README.md
@@ -1,38 +1,33 @@
|
||||
ArchiSteamFarm
|
||||
===================
|
||||
|
||||
[](https://ci.appveyor.com/project/JustArchi/archisteamfarm) [](https://github.com/JustArchi/ArchiSteamFarm/releases/latest) [](https://github.com/JustArchi/ArchiSteamFarm/releases) [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HD2P2P3WGS5Y4) [](https://steamcommunity.com/tradeoffer/new/?partner=46697991&token=0ix2Ruv_)
|
||||
|
||||
---
|
||||
|
||||
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 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:**
|
||||
|
||||
- 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
|
||||
- Update notifications
|
||||
- Full Mono support, cross-OS compatibility
|
||||
- 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
|
||||
|
||||
**Setting up:**
|
||||
|
||||
Each ASF bot is defined in it's own XML config file in `config` directory. ASF comes with included ```example.xml``` config file, on which you should base all of your bots. Simply copy ```example.xml``` to a new file, and edit properties inside. Don't forget to switch ```Enabled``` property to ```true``` once you're done, as this is the master switch which enables configured bot to launch. The most minimalistic setup to make ASF working is changing only ```Enabled```, ```SteamLogin``` and ```SteamPassword``` properties, everything else is more or less optional to enable additional features.
|
||||
|
||||
ASF expects exclusive access to all steam accounts it's using, which means that you should not use the account which is currently being used by ASF at the same time. You may however ```!start``` and ```!stop``` bots during farming, as well as use config property such as ```ShutdownOnFarmingFinished``` which will automatically release account after farming is done.
|
||||
|
||||
After you set up all your bots (their configs), you should launch ```ASF.exe```. If your accounts require additional steps to unlock, such as Steam guard code, you'll need to enter those too after ASF tries to launch given bot. If everything ended properly, you should notice in the console output, as well as on your Steam, that all of your bots automatically started cards farming.
|
||||
|
||||
ASF doesn't require and doesn't interfere in any way with Steam client, which means that you can be logged in to Steam client as your primary account with e.g. Idle Master in the background, and launch ASF for all other accounts (your alts) at the same time.
|
||||
Detailed setting up instructions are available on **[our wiki](https://github.com/JustArchi/ArchiSteamFarm/wiki/Setting-up)**.
|
||||
|
||||
**Current Commands:**
|
||||
|
||||
- `!exit` Stops whole ASF
|
||||
- `!farm` Restarts cards farming module. ASF automatically executes that if any cd-key is successfully claimed
|
||||
- `!redeem <KEY>` Redeems cd-key on current bot instance. You can also paste cd-key directly to the chat
|
||||
- `!start <BOT>` Starts given bot instance, after it was ```!stop```pped
|
||||
- `!status` Prints current status of ASF
|
||||
- `!stop` Stops current bot instance
|
||||
- `!stop <BOT>` Stops given bot instance
|
||||
Detailed documentation of all available commands is available on **[our wiki](https://github.com/JustArchi/ArchiSteamFarm/wiki/Commands)**.
|
||||
|
||||
> 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.
|
||||
|
||||
12
SteamAuth/APIEndpoints.cs
Normal file
12
SteamAuth/APIEndpoints.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace SteamAuth
|
||||
{
|
||||
public static class APIEndpoints
|
||||
{
|
||||
public const string STEAMAPI_BASE = "https://api.steampowered.com";
|
||||
public const string COMMUNITY_BASE = "https://steamcommunity.com";
|
||||
public const string MOBILEAUTH_BASE = STEAMAPI_BASE + "/IMobileAuthService/%s/v0001";
|
||||
public static string MOBILEAUTH_GETWGTOKEN = MOBILEAUTH_BASE.Replace("%s", "GetWGToken");
|
||||
public const string TWO_FACTOR_BASE = STEAMAPI_BASE + "/ITwoFactorService/%s/v0001";
|
||||
public static string TWO_FACTOR_TIME_QUERY = TWO_FACTOR_BASE.Replace("%s", "QueryTime");
|
||||
}
|
||||
}
|
||||
292
SteamAuth/AuthenticatorLinker.cs
Normal file
292
SteamAuth/AuthenticatorLinker.cs
Normal file
@@ -0,0 +1,292 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SteamAuth
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles the linking process for a new mobile authenticator.
|
||||
/// </summary>
|
||||
public class AuthenticatorLinker
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set to register a new phone number when linking. If a phone number is not set on the account, this must be set. If a phone number is set on the account, this must be null.
|
||||
/// </summary>
|
||||
public string PhoneNumber = null;
|
||||
|
||||
/// <summary>
|
||||
/// Randomly-generated device ID. Should only be generated once per linker.
|
||||
/// </summary>
|
||||
public string DeviceID { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// After the initial link step, if successful, this will be the SteamGuard data for the account. PLEASE save this somewhere after generating it; it's vital data.
|
||||
/// </summary>
|
||||
public SteamGuardAccount LinkedAccount { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// True if the authenticator has been fully finalized.
|
||||
/// </summary>
|
||||
public bool Finalized = false;
|
||||
|
||||
private SessionData _session;
|
||||
private CookieContainer _cookies;
|
||||
|
||||
public AuthenticatorLinker(SessionData session)
|
||||
{
|
||||
this._session = session;
|
||||
this.DeviceID = GenerateDeviceID();
|
||||
|
||||
this._cookies = new CookieContainer();
|
||||
session.AddCookies(_cookies);
|
||||
}
|
||||
|
||||
public LinkResult AddAuthenticator()
|
||||
{
|
||||
bool hasPhone = _hasPhoneAttached();
|
||||
if (hasPhone && PhoneNumber != null)
|
||||
return LinkResult.MustRemovePhoneNumber;
|
||||
if (!hasPhone && PhoneNumber == null)
|
||||
return LinkResult.MustProvidePhoneNumber;
|
||||
|
||||
if (!hasPhone)
|
||||
{
|
||||
if (!_addPhoneNumber())
|
||||
{
|
||||
return LinkResult.GeneralFailure;
|
||||
}
|
||||
}
|
||||
|
||||
var postData = new NameValueCollection();
|
||||
postData.Add("access_token", _session.OAuthToken);
|
||||
postData.Add("steamid", _session.SteamID.ToString());
|
||||
postData.Add("authenticator_type", "1");
|
||||
postData.Add("device_identifier", this.DeviceID);
|
||||
postData.Add("sms_phone_id", "1");
|
||||
|
||||
string response = SteamWeb.MobileLoginRequest(APIEndpoints.STEAMAPI_BASE + "/ITwoFactorService/AddAuthenticator/v0001", "POST", postData);
|
||||
if (response == null) return LinkResult.GeneralFailure;
|
||||
|
||||
var addAuthenticatorResponse = JsonConvert.DeserializeObject<AddAuthenticatorResponse>(response);
|
||||
if (addAuthenticatorResponse == null || addAuthenticatorResponse.Response == null)
|
||||
{
|
||||
return LinkResult.GeneralFailure;
|
||||
}
|
||||
|
||||
if (addAuthenticatorResponse.Response.Status == 29)
|
||||
{
|
||||
return LinkResult.AuthenticatorPresent;
|
||||
}
|
||||
|
||||
if (addAuthenticatorResponse.Response.Status != 1)
|
||||
{
|
||||
return LinkResult.GeneralFailure;
|
||||
}
|
||||
|
||||
this.LinkedAccount = addAuthenticatorResponse.Response;
|
||||
LinkedAccount.Session = this._session;
|
||||
LinkedAccount.DeviceID = this.DeviceID;
|
||||
|
||||
return LinkResult.AwaitingFinalization;
|
||||
}
|
||||
|
||||
public FinalizeResult FinalizeAddAuthenticator(string smsCode)
|
||||
{
|
||||
//The act of checking the SMS code is necessary for Steam to finalize adding the phone number to the account.
|
||||
//Of course, we only want to check it if we're adding a phone number in the first place...
|
||||
|
||||
if (!String.IsNullOrEmpty(this.PhoneNumber) && !this._checkSMSCode(smsCode))
|
||||
{
|
||||
return FinalizeResult.BadSMSCode;
|
||||
}
|
||||
|
||||
var postData = new NameValueCollection();
|
||||
postData.Add("steamid", _session.SteamID.ToString());
|
||||
postData.Add("access_token", _session.OAuthToken);
|
||||
postData.Add("activation_code", smsCode);
|
||||
int tries = 0;
|
||||
while (tries <= 30)
|
||||
{
|
||||
postData.Set("authenticator_code", LinkedAccount.GenerateSteamGuardCode());
|
||||
postData.Set("authenticator_time", TimeAligner.GetSteamTime().ToString());
|
||||
|
||||
string response = SteamWeb.MobileLoginRequest(APIEndpoints.STEAMAPI_BASE + "/ITwoFactorService/FinalizeAddAuthenticator/v0001", "POST", postData);
|
||||
if (response == null) return FinalizeResult.GeneralFailure;
|
||||
|
||||
var finalizeResponse = JsonConvert.DeserializeObject<FinalizeAuthenticatorResponse>(response);
|
||||
|
||||
if (finalizeResponse == null || finalizeResponse.Response == null)
|
||||
{
|
||||
return FinalizeResult.GeneralFailure;
|
||||
}
|
||||
|
||||
if (finalizeResponse.Response.Status == 89)
|
||||
{
|
||||
return FinalizeResult.BadSMSCode;
|
||||
}
|
||||
|
||||
if (finalizeResponse.Response.Status == 88)
|
||||
{
|
||||
if (tries >= 30)
|
||||
{
|
||||
return FinalizeResult.UnableToGenerateCorrectCodes;
|
||||
}
|
||||
}
|
||||
|
||||
if (!finalizeResponse.Response.Success)
|
||||
{
|
||||
return FinalizeResult.GeneralFailure;
|
||||
}
|
||||
|
||||
if (finalizeResponse.Response.WantMore)
|
||||
{
|
||||
tries++;
|
||||
continue;
|
||||
}
|
||||
|
||||
this.LinkedAccount.FullyEnrolled = true;
|
||||
return FinalizeResult.Success;
|
||||
}
|
||||
|
||||
return FinalizeResult.GeneralFailure;
|
||||
}
|
||||
|
||||
private bool _checkSMSCode(string smsCode)
|
||||
{
|
||||
var postData = new NameValueCollection();
|
||||
postData.Add("op", "check_sms_code");
|
||||
postData.Add("arg", smsCode);
|
||||
postData.Add("sessionid", _session.SessionID);
|
||||
|
||||
string response = SteamWeb.Request(APIEndpoints.COMMUNITY_BASE + "/steamguard/phoneajax", "POST", postData, _cookies);
|
||||
if (response == null) return false;
|
||||
|
||||
var addPhoneNumberResponse = JsonConvert.DeserializeObject<AddPhoneResponse>(response);
|
||||
return addPhoneNumberResponse.Success;
|
||||
}
|
||||
|
||||
private bool _addPhoneNumber()
|
||||
{
|
||||
var postData = new NameValueCollection();
|
||||
postData.Add("op", "add_phone_number");
|
||||
postData.Add("arg", PhoneNumber);
|
||||
postData.Add("sessionid", _session.SessionID);
|
||||
|
||||
string response = SteamWeb.Request(APIEndpoints.COMMUNITY_BASE + "/steamguard/phoneajax", "POST", postData, _cookies);
|
||||
if (response == null) return false;
|
||||
|
||||
var addPhoneNumberResponse = JsonConvert.DeserializeObject<AddPhoneResponse>(response);
|
||||
return addPhoneNumberResponse.Success;
|
||||
}
|
||||
|
||||
private bool _hasPhoneAttached()
|
||||
{
|
||||
var postData = new NameValueCollection();
|
||||
postData.Add("op", "has_phone");
|
||||
postData.Add("arg", "null");
|
||||
postData.Add("sessionid", _session.SessionID);
|
||||
|
||||
string response = SteamWeb.Request(APIEndpoints.COMMUNITY_BASE + "/steamguard/phoneajax", "POST", postData, _cookies);
|
||||
if (response == null) return false;
|
||||
|
||||
var hasPhoneResponse = JsonConvert.DeserializeObject<HasPhoneResponse>(response);
|
||||
return hasPhoneResponse.HasPhone;
|
||||
}
|
||||
|
||||
public enum LinkResult
|
||||
{
|
||||
MustProvidePhoneNumber, //No phone number on the account
|
||||
MustRemovePhoneNumber, //A phone number is already on the account
|
||||
AwaitingFinalization, //Must provide an SMS code
|
||||
GeneralFailure, //General failure (really now!)
|
||||
AuthenticatorPresent
|
||||
}
|
||||
|
||||
public enum FinalizeResult
|
||||
{
|
||||
BadSMSCode,
|
||||
UnableToGenerateCorrectCodes,
|
||||
Success,
|
||||
GeneralFailure
|
||||
}
|
||||
|
||||
private class AddAuthenticatorResponse
|
||||
{
|
||||
[JsonProperty("response")]
|
||||
public SteamGuardAccount Response { get; set; }
|
||||
}
|
||||
|
||||
private class FinalizeAuthenticatorResponse
|
||||
{
|
||||
[JsonProperty("response")]
|
||||
public FinalizeAuthenticatorInternalResponse Response { get; set; }
|
||||
|
||||
internal class FinalizeAuthenticatorInternalResponse
|
||||
{
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
[JsonProperty("server_time")]
|
||||
public long ServerTime { get; set; }
|
||||
|
||||
[JsonProperty("want_more")]
|
||||
public bool WantMore { get; set; }
|
||||
|
||||
[JsonProperty("success")]
|
||||
public bool Success { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
private class HasPhoneResponse
|
||||
{
|
||||
[JsonProperty("has_phone")]
|
||||
public bool HasPhone { get; set; }
|
||||
}
|
||||
|
||||
private class AddPhoneResponse
|
||||
{
|
||||
[JsonProperty("success")]
|
||||
public bool Success { get; set; }
|
||||
}
|
||||
|
||||
public static string GenerateDeviceID()
|
||||
{
|
||||
using (var sha1 = new SHA1Managed())
|
||||
{
|
||||
RNGCryptoServiceProvider secureRandom = new RNGCryptoServiceProvider();
|
||||
byte[] randomBytes = new byte[8];
|
||||
secureRandom.GetBytes(randomBytes);
|
||||
|
||||
byte[] hashedBytes = sha1.ComputeHash(randomBytes);
|
||||
string random32 = BitConverter.ToString(hashedBytes).Replace("-", "").Substring(0, 32).ToLower();
|
||||
|
||||
return "android:" + SplitOnRatios(random32, new[] { 8, 4, 4, 4, 12 }, "-");
|
||||
}
|
||||
}
|
||||
|
||||
private static string SplitOnRatios(string str, int[] ratios, string intermediate)
|
||||
{
|
||||
string result = "";
|
||||
|
||||
int pos = 0;
|
||||
for (int index = 0; index < ratios.Length; index++)
|
||||
{
|
||||
result += str.Substring(pos, ratios[index]);
|
||||
pos = ratios[index];
|
||||
|
||||
if (index < ratios.Length - 1)
|
||||
result += intermediate;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
SteamAuth/Confirmation.cs
Normal file
15
SteamAuth/Confirmation.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SteamAuth
|
||||
{
|
||||
public class Confirmation
|
||||
{
|
||||
public string ConfirmationID;
|
||||
public string ConfirmationKey;
|
||||
public string ConfirmationDescription;
|
||||
}
|
||||
}
|
||||
21
SteamAuth/LICENSE
Normal file
21
SteamAuth/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Joshua Coffey
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
36
SteamAuth/Properties/AssemblyInfo.cs
Normal file
36
SteamAuth/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SteamAuth")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("SteamAuth")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("5ad0934e-f6c4-4ae5-83af-c788313b2a87")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// 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("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
40
SteamAuth/SessionData.cs
Normal file
40
SteamAuth/SessionData.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Net;
|
||||
|
||||
namespace SteamAuth
|
||||
{
|
||||
public class SessionData
|
||||
{
|
||||
public string SessionID { get; set; }
|
||||
|
||||
public string SteamLogin { get; set; }
|
||||
|
||||
public string SteamLoginSecure { get; set; }
|
||||
|
||||
public string WebCookie { get; set; }
|
||||
|
||||
public string OAuthToken { get; set; }
|
||||
|
||||
public ulong SteamID { get; set; }
|
||||
|
||||
public void AddCookies(CookieContainer cookies)
|
||||
{
|
||||
cookies.Add(new Cookie("mobileClientVersion", "0 (2.1.3)", "/", ".steamcommunity.com"));
|
||||
cookies.Add(new Cookie("mobileClient", "android", "/", ".steamcommunity.com"));
|
||||
|
||||
cookies.Add(new Cookie("steamid", SteamID.ToString(), "/", ".steamcommunity.com"));
|
||||
cookies.Add(new Cookie("steamLogin", SteamLogin, "/", ".steamcommunity.com")
|
||||
{
|
||||
HttpOnly = true
|
||||
});
|
||||
|
||||
cookies.Add(new Cookie("steamLoginSecure", SteamLoginSecure, "/", ".steamcommunity.com")
|
||||
{
|
||||
HttpOnly = true,
|
||||
Secure = true
|
||||
});
|
||||
cookies.Add(new Cookie("Steam_Language", "english", "/", ".steamcommunity.com"));
|
||||
cookies.Add(new Cookie("dob", "", "/", ".steamcommunity.com"));
|
||||
cookies.Add(new Cookie("sessionid", this.SessionID, "/", ".steamcommunity.com"));
|
||||
}
|
||||
}
|
||||
}
|
||||
71
SteamAuth/SteamAuth.csproj
Normal file
71
SteamAuth/SteamAuth.csproj
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SteamAuth</RootNamespace>
|
||||
<AssemblyName>SteamAuth</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<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.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="APIEndpoints.cs" />
|
||||
<Compile Include="AuthenticatorLinker.cs" />
|
||||
<Compile Include="Confirmation.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SessionData.cs" />
|
||||
<Compile Include="SteamGuardAccount.cs" />
|
||||
<Compile Include="SteamWeb.cs" />
|
||||
<Compile Include="TimeAligner.cs" />
|
||||
<Compile Include="UserLogin.cs" />
|
||||
<Compile Include="Util.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
28
SteamAuth/SteamAuth.sln
Normal file
28
SteamAuth/SteamAuth.sln
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SteamAuth", "SteamAuth.csproj", "{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestBed", "..\TestBed\TestBed.csproj", "{8A732227-C090-4011-9F0A-51180CFE6271}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5AD0934E-F6C4-4AE5-83AF-C788313B2A87}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8A732227-C090-4011-9F0A-51180CFE6271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8A732227-C090-4011-9F0A-51180CFE6271}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8A732227-C090-4011-9F0A-51180CFE6271}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8A732227-C090-4011-9F0A-51180CFE6271}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
456
SteamAuth/SteamGuardAccount.cs
Normal file
456
SteamAuth/SteamGuardAccount.cs
Normal file
@@ -0,0 +1,456 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SteamAuth
|
||||
{
|
||||
public class SteamGuardAccount
|
||||
{
|
||||
[JsonProperty("shared_secret")]
|
||||
public string SharedSecret { get; set; }
|
||||
|
||||
[JsonProperty("serial_number")]
|
||||
public string SerialNumber { get; set; }
|
||||
|
||||
[JsonProperty("revocation_code")]
|
||||
public string RevocationCode { get; set; }
|
||||
|
||||
[JsonProperty("uri")]
|
||||
public string URI { get; set; }
|
||||
|
||||
[JsonProperty("server_time")]
|
||||
public long ServerTime { get; set; }
|
||||
|
||||
[JsonProperty("account_name")]
|
||||
public string AccountName { get; set; }
|
||||
|
||||
[JsonProperty("token_gid")]
|
||||
public string TokenGID { get; set; }
|
||||
|
||||
[JsonProperty("identity_secret")]
|
||||
public string IdentitySecret { get; set; }
|
||||
|
||||
[JsonProperty("secret_1")]
|
||||
public string Secret1 { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
[JsonProperty("device_id")]
|
||||
public string DeviceID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set to true if the authenticator has actually been applied to the account.
|
||||
/// </summary>
|
||||
[JsonProperty("fully_enrolled")]
|
||||
public bool FullyEnrolled { get; set; }
|
||||
|
||||
public SessionData Session { get; set; }
|
||||
|
||||
private static byte[] steamGuardCodeTranslations = new byte[] { 50, 51, 52, 53, 54, 55, 56, 57, 66, 67, 68, 70, 71, 72, 74, 75, 77, 78, 80, 81, 82, 84, 86, 87, 88, 89 };
|
||||
|
||||
public bool DeactivateAuthenticator(int scheme = 2)
|
||||
{
|
||||
var postData = new NameValueCollection();
|
||||
postData.Add("steamid", this.Session.SteamID.ToString());
|
||||
postData.Add("steamguard_scheme", scheme.ToString());
|
||||
postData.Add("revocation_code", this.RevocationCode);
|
||||
postData.Add("access_token", this.Session.OAuthToken);
|
||||
|
||||
try
|
||||
{
|
||||
string response = SteamWeb.MobileLoginRequest(APIEndpoints.STEAMAPI_BASE + "/ITwoFactorService/RemoveAuthenticator/v0001", "POST", postData);
|
||||
var removeResponse = JsonConvert.DeserializeObject<RemoveAuthenticatorResponse>(response);
|
||||
|
||||
if (removeResponse == null || removeResponse.Response == null || !removeResponse.Response.Success) return false;
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public string GenerateSteamGuardCode()
|
||||
{
|
||||
return GenerateSteamGuardCodeForTime(TimeAligner.GetSteamTime());
|
||||
}
|
||||
|
||||
public string GenerateSteamGuardCodeForTime(long time)
|
||||
{
|
||||
if (this.SharedSecret == null || this.SharedSecret.Length == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
byte[] sharedSecretArray = Convert.FromBase64String(this.SharedSecret);
|
||||
byte[] timeArray = new byte[8];
|
||||
|
||||
time /= 30L;
|
||||
|
||||
for (int i = 8; i > 0; i--)
|
||||
{
|
||||
timeArray[i - 1] = (byte)time;
|
||||
time >>= 8;
|
||||
}
|
||||
|
||||
HMACSHA1 hmacGenerator = new HMACSHA1();
|
||||
hmacGenerator.Key = sharedSecretArray;
|
||||
byte[] hashedData = hmacGenerator.ComputeHash(timeArray);
|
||||
byte[] codeArray = new byte[5];
|
||||
try
|
||||
{
|
||||
byte b = (byte)(hashedData[19] & 0xF);
|
||||
int codePoint = (hashedData[b] & 0x7F) << 24 | (hashedData[b + 1] & 0xFF) << 16 | (hashedData[b + 2] & 0xFF) << 8 | (hashedData[b + 3] & 0xFF);
|
||||
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
codeArray[i] = steamGuardCodeTranslations[codePoint % steamGuardCodeTranslations.Length];
|
||||
codePoint /= steamGuardCodeTranslations.Length;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null; //Change later, catch-alls are bad!
|
||||
}
|
||||
return Encoding.UTF8.GetString(codeArray);
|
||||
}
|
||||
|
||||
public Confirmation[] FetchConfirmations()
|
||||
{
|
||||
string url = this.GenerateConfirmationURL();
|
||||
|
||||
CookieContainer cookies = new CookieContainer();
|
||||
this.Session.AddCookies(cookies);
|
||||
|
||||
string response = SteamWeb.Request(url, "GET", null, cookies);
|
||||
|
||||
/*So you're going to see this abomination and you're going to be upset.
|
||||
It's understandable. But the thing is, regex for HTML -- while awful -- makes this way faster than parsing a DOM, plus we don't need another library.
|
||||
And because the data is always in the same place and same format... It's not as if we're trying to naturally understand HTML here. Just extract strings.
|
||||
I'm sorry. */
|
||||
|
||||
Regex confIDRegex = new Regex("data-confid=\"(\\d+)\"");
|
||||
Regex confKeyRegex = new Regex("data-key=\"(\\d+)\"");
|
||||
Regex confDescRegex = new Regex("<div>((Confirm|Trade with|Sell -) .+)</div>");
|
||||
|
||||
if (response == null || !(confIDRegex.IsMatch(response) && confKeyRegex.IsMatch(response) && confDescRegex.IsMatch(response)))
|
||||
{
|
||||
if (response == null || !response.Contains("<div>Nothing to confirm</div>"))
|
||||
{
|
||||
throw new WGTokenInvalidException();
|
||||
}
|
||||
|
||||
return new Confirmation[0];
|
||||
}
|
||||
|
||||
MatchCollection confIDs = confIDRegex.Matches(response);
|
||||
MatchCollection confKeys = confKeyRegex.Matches(response);
|
||||
MatchCollection confDescs = confDescRegex.Matches(response);
|
||||
|
||||
List<Confirmation> ret = new List<Confirmation>();
|
||||
for (int i = 0; i < confIDs.Count; i++)
|
||||
{
|
||||
string confID = confIDs[i].Groups[1].Value;
|
||||
string confKey = confKeys[i].Groups[1].Value;
|
||||
string confDesc = confDescs[i].Groups[1].Value;
|
||||
Confirmation conf = new Confirmation()
|
||||
{
|
||||
ConfirmationDescription = confDesc,
|
||||
ConfirmationID = confID,
|
||||
ConfirmationKey = confKey
|
||||
};
|
||||
ret.Add(conf);
|
||||
}
|
||||
|
||||
return ret.ToArray();
|
||||
}
|
||||
|
||||
public async Task<Confirmation[]> FetchConfirmationsAsync()
|
||||
{
|
||||
string url = this.GenerateConfirmationURL();
|
||||
|
||||
CookieContainer cookies = new CookieContainer();
|
||||
this.Session.AddCookies(cookies);
|
||||
|
||||
string response = await SteamWeb.RequestAsync(url, "GET", null, cookies);
|
||||
|
||||
/*So you're going to see this abomination and you're going to be upset.
|
||||
It's understandable. But the thing is, regex for HTML -- while awful -- makes this way faster than parsing a DOM, plus we don't need another library.
|
||||
And because the data is always in the same place and same format... It's not as if we're trying to naturally understand HTML here. Just extract strings.
|
||||
I'm sorry. */
|
||||
|
||||
Regex confIDRegex = new Regex("data-confid=\"(\\d+)\"");
|
||||
Regex confKeyRegex = new Regex("data-key=\"(\\d+)\"");
|
||||
Regex confDescRegex = new Regex("<div>((Confirm|Trade with|Sell -) .+)</div>");
|
||||
|
||||
if (response == null || !(confIDRegex.IsMatch(response) && confKeyRegex.IsMatch(response) && confDescRegex.IsMatch(response)))
|
||||
{
|
||||
if (response == null || !response.Contains("<div>Nothing to confirm</div>"))
|
||||
{
|
||||
throw new WGTokenInvalidException();
|
||||
}
|
||||
|
||||
return new Confirmation[0];
|
||||
}
|
||||
|
||||
MatchCollection confIDs = confIDRegex.Matches(response);
|
||||
MatchCollection confKeys = confKeyRegex.Matches(response);
|
||||
MatchCollection confDescs = confDescRegex.Matches(response);
|
||||
|
||||
List<Confirmation> ret = new List<Confirmation>();
|
||||
for (int i = 0; i < confIDs.Count; i++)
|
||||
{
|
||||
string confID = confIDs[i].Groups[1].Value;
|
||||
string confKey = confKeys[i].Groups[1].Value;
|
||||
string confDesc = confDescs[i].Groups[1].Value;
|
||||
Confirmation conf = new Confirmation()
|
||||
{
|
||||
ConfirmationDescription = confDesc,
|
||||
ConfirmationID = confID,
|
||||
ConfirmationKey = confKey
|
||||
};
|
||||
ret.Add(conf);
|
||||
}
|
||||
|
||||
return ret.ToArray();
|
||||
}
|
||||
|
||||
public long GetConfirmationTradeOfferID(Confirmation conf)
|
||||
{
|
||||
var confDetails = _getConfirmationDetails(conf);
|
||||
if (confDetails == null || !confDetails.Success) return -1;
|
||||
|
||||
Regex tradeOfferIDRegex = new Regex("<div class=\"tradeoffer\" id=\"tradeofferid_(\\d+)\" >");
|
||||
if(!tradeOfferIDRegex.IsMatch(confDetails.HTML)) return -1;
|
||||
return long.Parse(tradeOfferIDRegex.Match(confDetails.HTML).Groups[1].Value);
|
||||
}
|
||||
|
||||
public bool AcceptConfirmation(Confirmation conf)
|
||||
{
|
||||
return _sendConfirmationAjax(conf, "allow");
|
||||
}
|
||||
|
||||
public bool DenyConfirmation(Confirmation conf)
|
||||
{
|
||||
return _sendConfirmationAjax(conf, "cancel");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes the Steam session. Necessary to perform confirmations if your session has expired or changed.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool RefreshSession()
|
||||
{
|
||||
string url = APIEndpoints.MOBILEAUTH_GETWGTOKEN;
|
||||
NameValueCollection postData = new NameValueCollection();
|
||||
postData.Add("access_token", this.Session.OAuthToken);
|
||||
|
||||
string response = SteamWeb.Request(url, "POST", postData);
|
||||
if (response == null) return false;
|
||||
|
||||
try
|
||||
{
|
||||
var refreshResponse = JsonConvert.DeserializeObject<RefreshSessionDataResponse>(response);
|
||||
if (refreshResponse == null || refreshResponse.Response == null || String.IsNullOrEmpty(refreshResponse.Response.Token))
|
||||
return false;
|
||||
|
||||
string token = this.Session.SteamID + "%7C%7C" + refreshResponse.Response.Token;
|
||||
string tokenSecure = this.Session.SteamID + "%7C%7C" + refreshResponse.Response.TokenSecure;
|
||||
|
||||
this.Session.SteamLogin = token;
|
||||
this.Session.SteamLoginSecure = tokenSecure;
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes the Steam session. Necessary to perform confirmations if your session has expired or changed.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> RefreshSessionAsync()
|
||||
{
|
||||
string url = APIEndpoints.MOBILEAUTH_GETWGTOKEN;
|
||||
NameValueCollection postData = new NameValueCollection();
|
||||
postData.Add("access_token", this.Session.OAuthToken);
|
||||
|
||||
string response = await SteamWeb.RequestAsync(url, "POST", postData);
|
||||
if (response == null) return false;
|
||||
|
||||
try
|
||||
{
|
||||
var refreshResponse = JsonConvert.DeserializeObject<RefreshSessionDataResponse>(response);
|
||||
if (refreshResponse == null || refreshResponse.Response == null || String.IsNullOrEmpty(refreshResponse.Response.Token))
|
||||
return false;
|
||||
|
||||
string token = this.Session.SteamID + "%7C%7C" + refreshResponse.Response.Token;
|
||||
string tokenSecure = this.Session.SteamID + "%7C%7C" + refreshResponse.Response.TokenSecure;
|
||||
|
||||
this.Session.SteamLogin = token;
|
||||
this.Session.SteamLoginSecure = tokenSecure;
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private ConfirmationDetailsResponse _getConfirmationDetails(Confirmation conf)
|
||||
{
|
||||
string url = APIEndpoints.COMMUNITY_BASE + "/mobileconf/details/" + conf.ConfirmationID + "?";
|
||||
string queryString = GenerateConfirmationQueryParams("details");
|
||||
url += queryString;
|
||||
|
||||
CookieContainer cookies = new CookieContainer();
|
||||
this.Session.AddCookies(cookies);
|
||||
string referer = GenerateConfirmationURL();
|
||||
|
||||
string response = SteamWeb.Request(url, "GET", null, cookies, null);
|
||||
if (String.IsNullOrEmpty(response)) return null;
|
||||
|
||||
var confResponse = JsonConvert.DeserializeObject<ConfirmationDetailsResponse>(response);
|
||||
if (confResponse == null) return null;
|
||||
return confResponse;
|
||||
}
|
||||
|
||||
private bool _sendConfirmationAjax(Confirmation conf, string op)
|
||||
{
|
||||
string url = APIEndpoints.COMMUNITY_BASE + "/mobileconf/ajaxop";
|
||||
string queryString = "?op=" + op + "&";
|
||||
queryString += GenerateConfirmationQueryParams(op);
|
||||
queryString += "&cid=" + conf.ConfirmationID + "&ck=" + conf.ConfirmationKey;
|
||||
url += queryString;
|
||||
|
||||
CookieContainer cookies = new CookieContainer();
|
||||
this.Session.AddCookies(cookies);
|
||||
string referer = GenerateConfirmationURL();
|
||||
|
||||
string response = SteamWeb.Request(url, "GET", null, cookies, null);
|
||||
if (response == null) return false;
|
||||
|
||||
SendConfirmationResponse confResponse = JsonConvert.DeserializeObject<SendConfirmationResponse>(response);
|
||||
return confResponse.Success;
|
||||
}
|
||||
|
||||
public string GenerateConfirmationURL(string tag = "conf")
|
||||
{
|
||||
string endpoint = APIEndpoints.COMMUNITY_BASE + "/mobileconf/conf?";
|
||||
string queryString = GenerateConfirmationQueryParams(tag);
|
||||
return endpoint + queryString;
|
||||
}
|
||||
|
||||
public string GenerateConfirmationQueryParams(string tag)
|
||||
{
|
||||
if (String.IsNullOrEmpty(DeviceID))
|
||||
throw new ArgumentException("Device ID is not present");
|
||||
|
||||
long time = TimeAligner.GetSteamTime();
|
||||
return "p=" + this.DeviceID + "&a=" + this.Session.SteamID.ToString() + "&k=" + _generateConfirmationHashForTime(time, tag) + "&t=" + time + "&m=android&tag=" + tag;
|
||||
}
|
||||
|
||||
private string _generateConfirmationHashForTime(long time, string tag)
|
||||
{
|
||||
byte[] decode = Convert.FromBase64String(this.IdentitySecret);
|
||||
int n2 = 8;
|
||||
if (tag != null)
|
||||
{
|
||||
if (tag.Length > 32)
|
||||
{
|
||||
n2 = 8 + 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
n2 = 8 + tag.Length;
|
||||
}
|
||||
}
|
||||
byte[] array = new byte[n2];
|
||||
int n3 = 8;
|
||||
while (true)
|
||||
{
|
||||
int n4 = n3 - 1;
|
||||
if (n3 <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
array[n4] = (byte)time;
|
||||
time >>= 8;
|
||||
n3 = n4;
|
||||
}
|
||||
if (tag != null)
|
||||
{
|
||||
Array.Copy(Encoding.UTF8.GetBytes(tag), 0, array, 8, n2 - 8);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
HMACSHA1 hmacGenerator = new HMACSHA1();
|
||||
hmacGenerator.Key = decode;
|
||||
byte[] hashedData = hmacGenerator.ComputeHash(array);
|
||||
string encodedData = Convert.ToBase64String(hashedData, Base64FormattingOptions.None);
|
||||
string hash = WebUtility.UrlEncode(encodedData);
|
||||
return hash;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null; //Fix soon: catch-all is BAD!
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Determine how to detect an invalid session.
|
||||
public class WGTokenInvalidException : Exception
|
||||
{
|
||||
}
|
||||
|
||||
private class RefreshSessionDataResponse
|
||||
{
|
||||
[JsonProperty("response")]
|
||||
public RefreshSessionDataInternalResponse Response { get; set; }
|
||||
internal class RefreshSessionDataInternalResponse
|
||||
{
|
||||
[JsonProperty("token")]
|
||||
public string Token { get; set; }
|
||||
|
||||
[JsonProperty("token_secure")]
|
||||
public string TokenSecure { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
private class RemoveAuthenticatorResponse
|
||||
{
|
||||
[JsonProperty("response")]
|
||||
public RemoveAuthenticatorInternalResponse Response { get; set; }
|
||||
|
||||
internal class RemoveAuthenticatorInternalResponse
|
||||
{
|
||||
[JsonProperty("success")]
|
||||
public bool Success { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
private class SendConfirmationResponse
|
||||
{
|
||||
[JsonProperty("success")]
|
||||
public bool Success { get; set; }
|
||||
}
|
||||
|
||||
private class ConfirmationDetailsResponse
|
||||
{
|
||||
[JsonProperty("success")]
|
||||
public bool Success { get; set; }
|
||||
|
||||
[JsonProperty("html")]
|
||||
public string HTML { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
137
SteamAuth/SteamWeb.cs
Normal file
137
SteamAuth/SteamWeb.cs
Normal file
@@ -0,0 +1,137 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SteamAuth
|
||||
{
|
||||
public class SteamWeb
|
||||
{
|
||||
/// <summary>
|
||||
/// Perform a mobile login request
|
||||
/// </summary>
|
||||
/// <param name="url">API url</param>
|
||||
/// <param name="method">GET or POST</param>
|
||||
/// <param name="data">Name-data pairs</param>
|
||||
/// <param name="cookies">current cookie container</param>
|
||||
/// <returns>response body</returns>
|
||||
public static string MobileLoginRequest(string url, string method, NameValueCollection data = null, CookieContainer cookies = null, NameValueCollection headers = null)
|
||||
{
|
||||
return Request(url, method, data, cookies, headers, APIEndpoints.COMMUNITY_BASE + "/mobilelogin?oauth_client_id=DE45CD61&oauth_scope=read_profile%20write_profile%20read_client%20write_client");
|
||||
}
|
||||
|
||||
public static string Request(string url, string method, NameValueCollection data = null, CookieContainer cookies = null, NameValueCollection headers = null, string referer = APIEndpoints.COMMUNITY_BASE)
|
||||
{
|
||||
string query = (data == null ? string.Empty : string.Join("&", Array.ConvertAll(data.AllKeys, key => String.Format("{0}={1}", WebUtility.UrlEncode(key), WebUtility.UrlEncode(data[key])))));
|
||||
if (method == "GET")
|
||||
{
|
||||
url += (url.Contains("?") ? "&" : "?") + query;
|
||||
}
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.Method = method;
|
||||
request.Accept = "text/javascript, text/html, application/xml, text/xml, */*";
|
||||
request.UserAgent = "Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; Google Nexus 4 - 4.1.1 - API 16 - 768x1280 Build/JRO03S) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";
|
||||
request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
|
||||
request.Referer = referer;
|
||||
|
||||
if (headers != null)
|
||||
{
|
||||
request.Headers.Add(headers);
|
||||
}
|
||||
|
||||
if (cookies != null)
|
||||
{
|
||||
request.CookieContainer = cookies;
|
||||
}
|
||||
|
||||
if (method == "POST")
|
||||
{
|
||||
request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
|
||||
request.ContentLength = query.Length;
|
||||
|
||||
StreamWriter requestStream = new StreamWriter(request.GetRequestStream());
|
||||
requestStream.Write(query);
|
||||
requestStream.Close();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
||||
{
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
using (StreamReader responseStream = new StreamReader(response.GetResponseStream()))
|
||||
{
|
||||
string responseData = responseStream.ReadToEnd();
|
||||
return responseData;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task<string> RequestAsync(string url, string method, NameValueCollection data = null, CookieContainer cookies = null, NameValueCollection headers = null, string referer = APIEndpoints.COMMUNITY_BASE)
|
||||
{
|
||||
string query = (data == null ? string.Empty : string.Join("&", Array.ConvertAll(data.AllKeys, key => String.Format("{0}={1}", WebUtility.UrlEncode(key), WebUtility.UrlEncode(data[key])))));
|
||||
if (method == "GET")
|
||||
{
|
||||
url += (url.Contains("?") ? "&" : "?") + query;
|
||||
}
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.Method = method;
|
||||
request.Accept = "text/javascript, text/html, application/xml, text/xml, */*";
|
||||
request.UserAgent = "Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; Google Nexus 4 - 4.1.1 - API 16 - 768x1280 Build/JRO03S) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";
|
||||
request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
|
||||
request.Referer = referer;
|
||||
|
||||
if (headers != null)
|
||||
{
|
||||
request.Headers.Add(headers);
|
||||
}
|
||||
|
||||
if (cookies != null)
|
||||
{
|
||||
request.CookieContainer = cookies;
|
||||
}
|
||||
|
||||
if (method == "POST")
|
||||
{
|
||||
request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
|
||||
request.ContentLength = query.Length;
|
||||
|
||||
StreamWriter requestStream = new StreamWriter(request.GetRequestStream());
|
||||
requestStream.Write(query);
|
||||
requestStream.Close();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
HttpWebResponse response = (HttpWebResponse) await request.GetResponseAsync();
|
||||
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
using (StreamReader responseStream = new StreamReader(response.GetResponseStream()))
|
||||
{
|
||||
string responseData = responseStream.ReadToEnd();
|
||||
return responseData;
|
||||
}
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
84
SteamAuth/TimeAligner.cs
Normal file
84
SteamAuth/TimeAligner.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SteamAuth
|
||||
{
|
||||
/// <summary>
|
||||
/// Class to help align system time with the Steam server time. Not super advanced; probably not taking some things into account that it should.
|
||||
/// Necessary to generate up-to-date codes. In general, this will have an error of less than a second, assuming Steam is operational.
|
||||
/// </summary>
|
||||
public class TimeAligner
|
||||
{
|
||||
private static bool _aligned = false;
|
||||
private static int _timeDifference = 0;
|
||||
|
||||
public static long GetSteamTime()
|
||||
{
|
||||
if (!TimeAligner._aligned)
|
||||
{
|
||||
TimeAligner.AlignTime();
|
||||
}
|
||||
return Util.GetSystemUnixTime() + _timeDifference;
|
||||
}
|
||||
|
||||
public static async Task<long> GetSteamTimeAsync()
|
||||
{
|
||||
if (!TimeAligner._aligned)
|
||||
{
|
||||
await TimeAligner.AlignTimeAsync();
|
||||
}
|
||||
return Util.GetSystemUnixTime() + _timeDifference;
|
||||
}
|
||||
|
||||
public static void AlignTime()
|
||||
{
|
||||
long currentTime = Util.GetSystemUnixTime();
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
try
|
||||
{
|
||||
string response = client.UploadString(APIEndpoints.TWO_FACTOR_TIME_QUERY, "steamid=0");
|
||||
TimeQuery query = JsonConvert.DeserializeObject<TimeQuery>(response);
|
||||
TimeAligner._timeDifference = (int)(query.Response.ServerTime - currentTime);
|
||||
TimeAligner._aligned = true;
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task AlignTimeAsync()
|
||||
{
|
||||
long currentTime = Util.GetSystemUnixTime();
|
||||
WebClient client = new WebClient();
|
||||
try
|
||||
{
|
||||
string response = await client.UploadStringTaskAsync(new Uri(APIEndpoints.TWO_FACTOR_TIME_QUERY), "steamid=0");
|
||||
TimeQuery query = JsonConvert.DeserializeObject<TimeQuery>(response);
|
||||
TimeAligner._timeDifference = (int)(query.Response.ServerTime - currentTime);
|
||||
TimeAligner._aligned = true;
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
internal class TimeQuery
|
||||
{
|
||||
[JsonProperty("response")]
|
||||
internal TimeQueryResponse Response { get; set; }
|
||||
|
||||
internal class TimeQueryResponse
|
||||
{
|
||||
[JsonProperty("server_time")]
|
||||
public long ServerTime { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
254
SteamAuth/UserLogin.cs
Normal file
254
SteamAuth/UserLogin.cs
Normal file
@@ -0,0 +1,254 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace SteamAuth
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles logging the user into the mobile Steam website. Necessary to generate OAuth token and session cookies.
|
||||
/// </summary>
|
||||
public class UserLogin
|
||||
{
|
||||
public string Username;
|
||||
public string Password;
|
||||
public ulong SteamID;
|
||||
|
||||
public bool RequiresCaptcha;
|
||||
public string CaptchaGID = null;
|
||||
public string CaptchaText = null;
|
||||
|
||||
public bool RequiresEmail;
|
||||
public string EmailDomain = null;
|
||||
public string EmailCode = null;
|
||||
|
||||
public bool Requires2FA;
|
||||
public string TwoFactorCode = null;
|
||||
|
||||
public SessionData Session = null;
|
||||
public bool LoggedIn = false;
|
||||
|
||||
private CookieContainer _cookies = new CookieContainer();
|
||||
|
||||
public UserLogin(string username, string password)
|
||||
{
|
||||
this.Username = username;
|
||||
this.Password = password;
|
||||
}
|
||||
|
||||
public LoginResult DoLogin()
|
||||
{
|
||||
var postData = new NameValueCollection();
|
||||
var cookies = _cookies;
|
||||
string response = null;
|
||||
|
||||
if (cookies.Count == 0)
|
||||
{
|
||||
//Generate a SessionID
|
||||
cookies.Add(new Cookie("mobileClientVersion", "0 (2.1.3)", "/", ".steamcommunity.com"));
|
||||
cookies.Add(new Cookie("mobileClient", "android", "/", ".steamcommunity.com"));
|
||||
cookies.Add(new Cookie("Steam_Language", "english", "/", ".steamcommunity.com"));
|
||||
|
||||
NameValueCollection headers = new NameValueCollection();
|
||||
headers.Add("X-Requested-With", "com.valvesoftware.android.steam.community");
|
||||
|
||||
SteamWeb.MobileLoginRequest("https://steamcommunity.com/login?oauth_client_id=DE45CD61&oauth_scope=read_profile%20write_profile%20read_client%20write_client", "GET", null, cookies, headers);
|
||||
}
|
||||
|
||||
postData.Add("username", this.Username);
|
||||
response = SteamWeb.MobileLoginRequest(APIEndpoints.COMMUNITY_BASE + "/login/getrsakey", "POST", postData, cookies);
|
||||
if (response == null || response.Contains("<BODY>\nAn error occurred while processing your request.")) return LoginResult.GeneralFailure;
|
||||
|
||||
var rsaResponse = JsonConvert.DeserializeObject<RSAResponse>(response);
|
||||
|
||||
if (!rsaResponse.Success)
|
||||
{
|
||||
return LoginResult.BadRSA;
|
||||
}
|
||||
|
||||
RNGCryptoServiceProvider secureRandom = new RNGCryptoServiceProvider();
|
||||
byte[] encryptedPasswordBytes;
|
||||
using (var rsaEncryptor = new RSACryptoServiceProvider())
|
||||
{
|
||||
var passwordBytes = Encoding.ASCII.GetBytes(this.Password);
|
||||
var rsaParameters = rsaEncryptor.ExportParameters(false);
|
||||
rsaParameters.Exponent = Util.HexStringToByteArray(rsaResponse.Exponent);
|
||||
rsaParameters.Modulus = Util.HexStringToByteArray(rsaResponse.Modulus);
|
||||
rsaEncryptor.ImportParameters(rsaParameters);
|
||||
encryptedPasswordBytes = rsaEncryptor.Encrypt(passwordBytes, false);
|
||||
}
|
||||
|
||||
string encryptedPassword = Convert.ToBase64String(encryptedPasswordBytes);
|
||||
|
||||
postData.Clear();
|
||||
postData.Add("username", this.Username);
|
||||
postData.Add("password", encryptedPassword);
|
||||
|
||||
postData.Add("twofactorcode", this.TwoFactorCode ?? "");
|
||||
|
||||
postData.Add("captchagid", this.RequiresCaptcha ? this.CaptchaGID : "-1");
|
||||
postData.Add("captcha_text", this.RequiresCaptcha ? this.CaptchaText : "");
|
||||
|
||||
postData.Add("emailsteamid", (this.Requires2FA || this.RequiresEmail) ? this.SteamID.ToString() : "");
|
||||
postData.Add("emailauth", this.RequiresEmail ? this.EmailCode : "");
|
||||
|
||||
postData.Add("rsatimestamp", rsaResponse.Timestamp);
|
||||
postData.Add("remember_login", "false");
|
||||
postData.Add("oauth_client_id", "DE45CD61");
|
||||
postData.Add("oauth_scope", "read_profile write_profile read_client write_client");
|
||||
postData.Add("loginfriendlyname", "#login_emailauth_friendlyname_mobile");
|
||||
postData.Add("donotcache", Util.GetSystemUnixTime().ToString());
|
||||
|
||||
response = SteamWeb.MobileLoginRequest(APIEndpoints.COMMUNITY_BASE + "/login/dologin", "POST", postData, cookies);
|
||||
if (response == null) return LoginResult.GeneralFailure;
|
||||
|
||||
var loginResponse = JsonConvert.DeserializeObject<LoginResponse>(response);
|
||||
|
||||
if (loginResponse.Message != null && loginResponse.Message.Contains("Incorrect login"))
|
||||
{
|
||||
return LoginResult.BadCredentials;
|
||||
}
|
||||
|
||||
if (loginResponse.CaptchaNeeded)
|
||||
{
|
||||
this.RequiresCaptcha = true;
|
||||
this.CaptchaGID = loginResponse.CaptchaGID;
|
||||
return LoginResult.NeedCaptcha;
|
||||
}
|
||||
|
||||
if (loginResponse.EmailAuthNeeded)
|
||||
{
|
||||
this.RequiresEmail = true;
|
||||
this.SteamID = loginResponse.EmailSteamID;
|
||||
return LoginResult.NeedEmail;
|
||||
}
|
||||
|
||||
if (loginResponse.TwoFactorNeeded && !loginResponse.Success)
|
||||
{
|
||||
this.Requires2FA = true;
|
||||
return LoginResult.Need2FA;
|
||||
}
|
||||
|
||||
if (loginResponse.Message != null && loginResponse.Message.Contains("too many login failures"))
|
||||
{
|
||||
return LoginResult.TooManyFailedLogins;
|
||||
}
|
||||
|
||||
if (loginResponse.OAuthData == null || loginResponse.OAuthData.OAuthToken == null || loginResponse.OAuthData.OAuthToken.Length == 0)
|
||||
{
|
||||
return LoginResult.GeneralFailure;
|
||||
}
|
||||
|
||||
if (!loginResponse.LoginComplete)
|
||||
{
|
||||
return LoginResult.BadCredentials;
|
||||
}
|
||||
else
|
||||
{
|
||||
var readableCookies = cookies.GetCookies(new Uri("https://steamcommunity.com"));
|
||||
var oAuthData = loginResponse.OAuthData;
|
||||
|
||||
SessionData session = new SessionData();
|
||||
session.OAuthToken = oAuthData.OAuthToken;
|
||||
session.SteamID = oAuthData.SteamID;
|
||||
session.SteamLogin = session.SteamID + "%7C%7C" + oAuthData.SteamLogin;
|
||||
session.SteamLoginSecure = session.SteamID + "%7C%7C" + oAuthData.SteamLoginSecure;
|
||||
session.WebCookie = oAuthData.Webcookie;
|
||||
session.SessionID = readableCookies["sessionid"].Value;
|
||||
this.Session = session;
|
||||
this.LoggedIn = true;
|
||||
return LoginResult.LoginOkay;
|
||||
}
|
||||
|
||||
return LoginResult.GeneralFailure;
|
||||
}
|
||||
|
||||
private class LoginResponse
|
||||
{
|
||||
[JsonProperty("success")]
|
||||
public bool Success { get; set; }
|
||||
|
||||
[JsonProperty("login_complete")]
|
||||
public bool LoginComplete { get; set; }
|
||||
|
||||
[JsonProperty("oauth")]
|
||||
public string OAuthDataString { get; set; }
|
||||
|
||||
public OAuth OAuthData
|
||||
{
|
||||
get
|
||||
{
|
||||
return OAuthDataString != null ? JsonConvert.DeserializeObject<OAuth>(OAuthDataString) : null;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("captcha_needed")]
|
||||
public bool CaptchaNeeded { get; set; }
|
||||
|
||||
[JsonProperty("captcha_gid")]
|
||||
public string CaptchaGID { get; set; }
|
||||
|
||||
[JsonProperty("emailsteamid")]
|
||||
public ulong EmailSteamID { get; set; }
|
||||
|
||||
[JsonProperty("emailauth_needed")]
|
||||
public bool EmailAuthNeeded { get; set; }
|
||||
|
||||
[JsonProperty("requires_twofactor")]
|
||||
public bool TwoFactorNeeded { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string Message { get; set; }
|
||||
|
||||
internal class OAuth
|
||||
{
|
||||
[JsonProperty("steamid")]
|
||||
public ulong SteamID { get; set; }
|
||||
|
||||
[JsonProperty("oauth_token")]
|
||||
public string OAuthToken { get; set; }
|
||||
|
||||
[JsonProperty("wgtoken")]
|
||||
public string SteamLogin { get; set; }
|
||||
|
||||
[JsonProperty("wgtoken_secure")]
|
||||
public string SteamLoginSecure { get; set; }
|
||||
|
||||
[JsonProperty("webcookie")]
|
||||
public string Webcookie { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
private class RSAResponse
|
||||
{
|
||||
[JsonProperty("success")]
|
||||
public bool Success { get; set; }
|
||||
|
||||
[JsonProperty("publickey_exp")]
|
||||
public string Exponent { get; set; }
|
||||
|
||||
[JsonProperty("publickey_mod")]
|
||||
public string Modulus { get; set; }
|
||||
|
||||
[JsonProperty("timestamp")]
|
||||
public string Timestamp { get; set; }
|
||||
|
||||
[JsonProperty("steamid")]
|
||||
public ulong SteamID { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public enum LoginResult
|
||||
{
|
||||
LoginOkay,
|
||||
GeneralFailure,
|
||||
BadRSA,
|
||||
BadCredentials,
|
||||
NeedCaptcha,
|
||||
Need2FA,
|
||||
NeedEmail,
|
||||
TooManyFailedLogins,
|
||||
}
|
||||
}
|
||||
24
SteamAuth/Util.cs
Normal file
24
SteamAuth/Util.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace SteamAuth
|
||||
{
|
||||
public class Util
|
||||
{
|
||||
public static long GetSystemUnixTime()
|
||||
{
|
||||
return (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
|
||||
}
|
||||
|
||||
public static byte[] HexStringToByteArray(string hex)
|
||||
{
|
||||
int hexLen = hex.Length;
|
||||
byte[] ret = new byte[hexLen / 2];
|
||||
for (int i = 0; i < hexLen; i += 2)
|
||||
{
|
||||
ret[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
4
SteamAuth/packages.config
Normal file
4
SteamAuth/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net452" />
|
||||
</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.
BIN
packages/Newtonsoft.Json.8.0.2/Newtonsoft.Json.8.0.2.nupkg
vendored
Normal file
BIN
packages/Newtonsoft.Json.8.0.2/Newtonsoft.Json.8.0.2.nupkg
vendored
Normal file
Binary file not shown.
BIN
packages/Newtonsoft.Json.8.0.2/lib/net20/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.8.0.2/lib/net20/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
@@ -76,38 +76,6 @@
|
||||
<param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param>
|
||||
<param name="dateTimeKindHandling">The <see cref="T:System.DateTimeKind" /> used when reading <see cref="T:System.DateTime"/> values from BSON.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -926,24 +894,24 @@
|
||||
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
|
||||
<member name="T:Newtonsoft.Json.IArrayPool`1">
|
||||
<summary>
|
||||
Provides an interface for using pooled buffers.
|
||||
Provides an interface for using pooled arrays.
|
||||
</summary>
|
||||
<typeparam name="T">The buffer type content.</typeparam>
|
||||
<typeparam name="T">The array type content.</typeparam>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Rent(System.Int32)">
|
||||
<summary>
|
||||
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
|
||||
Rent a array from the pool. This array must be returned when it is no longer needed.
|
||||
</summary>
|
||||
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
|
||||
<returns>The rented buffer from the pool.</returns>
|
||||
<param name="minimumLength">The minimum required length of the array. The returned array may be longer.</param>
|
||||
<returns>The rented array from the pool. This array must be returned when it is no longer needed.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Return(`0[])">
|
||||
<summary>
|
||||
Return a buffer to the pool.
|
||||
Return an array to the pool.
|
||||
</summary>
|
||||
<param name="buffer">The buffer that is being returned.</param>
|
||||
<param name="array">The array that is being returned.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.JsonConstructorAttribute">
|
||||
<summary>
|
||||
@@ -2177,38 +2145,6 @@
|
||||
</summary>
|
||||
<param name="token">The token to read from.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -4489,9 +4425,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.UnderlyingName">
|
||||
<summary>
|
||||
@@ -4806,6 +4742,11 @@
|
||||
Gets or sets the extension data getter.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonObjectContract.ExtensionDataValueType">
|
||||
<summary>
|
||||
Gets or sets the extension data value type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.JsonObjectContract.#ctor(System.Type)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.JsonObjectContract"/> class.
|
||||
@@ -6418,7 +6359,7 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.Converters">
|
||||
<summary>
|
||||
Gets or sets a collection <see cref="T:Newtonsoft.Json.JsonConverter"/> that will be used during serialization.
|
||||
Gets or sets a <see cref="T:Newtonsoft.Json.JsonConverter"/> collection that will be used during serialization.
|
||||
</summary>
|
||||
<value>The converters.</value>
|
||||
</member>
|
||||
@@ -6432,6 +6373,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializerSettings.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
<value>The type name handling.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.MetadataPropertyHandling">
|
||||
@@ -6655,6 +6601,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
@@ -6730,7 +6688,7 @@
|
||||
</summary>
|
||||
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the reader's character buffer pool.
|
||||
</summary>
|
||||
@@ -6743,21 +6701,13 @@
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -6769,7 +6719,25 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -6864,9 +6832,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Required">
|
||||
<summary>
|
||||
@@ -6921,9 +6889,9 @@
|
||||
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the writer's character buffer pool.
|
||||
Gets or sets the writer's character array pool.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
|
||||
@@ -7515,6 +7483,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
@@ -8121,6 +8101,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializer.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializer.TypeNameAssemblyFormat">
|
||||
<summary>
|
||||
@@ -9036,6 +9021,11 @@
|
||||
<summary>
|
||||
Specifies type name handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="T:Newtonsoft.Json.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.TypeNameHandling.None">
|
||||
<summary>
|
||||
@@ -9590,6 +9580,12 @@
|
||||
</summary>
|
||||
<param name="ws">The string of white space characters.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Releases unmanaged and - optionally - managed resources
|
||||
</summary>
|
||||
<param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.SetWriteState(Newtonsoft.Json.JsonToken,System.Object)">
|
||||
<summary>
|
||||
Sets the state of the JsonWriter,
|
||||
BIN
packages/Newtonsoft.Json.8.0.2/lib/net35/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.8.0.2/lib/net35/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
@@ -59,46 +59,6 @@
|
||||
<param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param>
|
||||
<param name="dateTimeKindHandling">The <see cref="T:System.DateTimeKind" /> used when reading <see cref="T:System.DateTime"/> values from BSON.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -977,24 +937,24 @@
|
||||
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
|
||||
<member name="T:Newtonsoft.Json.IArrayPool`1">
|
||||
<summary>
|
||||
Provides an interface for using pooled buffers.
|
||||
Provides an interface for using pooled arrays.
|
||||
</summary>
|
||||
<typeparam name="T">The buffer type content.</typeparam>
|
||||
<typeparam name="T">The array type content.</typeparam>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Rent(System.Int32)">
|
||||
<summary>
|
||||
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
|
||||
Rent a array from the pool. This array must be returned when it is no longer needed.
|
||||
</summary>
|
||||
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
|
||||
<returns>The rented buffer from the pool.</returns>
|
||||
<param name="minimumLength">The minimum required length of the array. The returned array may be longer.</param>
|
||||
<returns>The rented array from the pool. This array must be returned when it is no longer needed.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Return(`0[])">
|
||||
<summary>
|
||||
Return a buffer to the pool.
|
||||
Return an array to the pool.
|
||||
</summary>
|
||||
<param name="buffer">The buffer that is being returned.</param>
|
||||
<param name="array">The array that is being returned.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.JsonConstructorAttribute">
|
||||
<summary>
|
||||
@@ -2239,44 +2199,6 @@
|
||||
</summary>
|
||||
<param name="token">The token to read from.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -4597,9 +4519,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.UnderlyingName">
|
||||
<summary>
|
||||
@@ -4914,6 +4836,11 @@
|
||||
Gets or sets the extension data getter.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonObjectContract.ExtensionDataValueType">
|
||||
<summary>
|
||||
Gets or sets the extension data value type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.JsonObjectContract.#ctor(System.Type)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.JsonObjectContract"/> class.
|
||||
@@ -5468,7 +5395,7 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.Converters">
|
||||
<summary>
|
||||
Gets or sets a collection <see cref="T:Newtonsoft.Json.JsonConverter"/> that will be used during serialization.
|
||||
Gets or sets a <see cref="T:Newtonsoft.Json.JsonConverter"/> collection that will be used during serialization.
|
||||
</summary>
|
||||
<value>The converters.</value>
|
||||
</member>
|
||||
@@ -5482,6 +5409,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializerSettings.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
<value>The type name handling.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.MetadataPropertyHandling">
|
||||
@@ -5705,6 +5637,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
@@ -5786,7 +5730,7 @@
|
||||
</summary>
|
||||
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the reader's character buffer pool.
|
||||
</summary>
|
||||
@@ -5799,21 +5743,13 @@
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -5825,7 +5761,13 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -5835,7 +5777,19 @@
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.DateTimeOffset"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.Close">
|
||||
<summary>
|
||||
@@ -5926,9 +5880,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Required">
|
||||
<summary>
|
||||
@@ -5983,9 +5937,9 @@
|
||||
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the writer's character buffer pool.
|
||||
Gets or sets the writer's character array pool.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
|
||||
@@ -6583,6 +6537,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
@@ -7262,6 +7228,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializer.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializer.TypeNameAssemblyFormat">
|
||||
<summary>
|
||||
@@ -8177,6 +8148,11 @@
|
||||
<summary>
|
||||
Specifies type name handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="T:Newtonsoft.Json.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.TypeNameHandling.None">
|
||||
<summary>
|
||||
@@ -8743,6 +8719,12 @@
|
||||
</summary>
|
||||
<param name="ws">The string of white space characters.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Releases unmanaged and - optionally - managed resources
|
||||
</summary>
|
||||
<param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.SetWriteState(Newtonsoft.Json.JsonToken,System.Object)">
|
||||
<summary>
|
||||
Sets the state of the JsonWriter,
|
||||
BIN
packages/Newtonsoft.Json.8.0.2/lib/net40/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.8.0.2/lib/net40/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
@@ -59,46 +59,6 @@
|
||||
<param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param>
|
||||
<param name="dateTimeKindHandling">The <see cref="T:System.DateTimeKind" /> used when reading <see cref="T:System.DateTime"/> values from BSON.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -973,24 +933,24 @@
|
||||
Floating point numbers are parsed to <see cref="F:Newtonsoft.Json.FloatParseHandling.Decimal"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
|
||||
<member name="T:Newtonsoft.Json.IArrayPool`1">
|
||||
<summary>
|
||||
Provides an interface for using pooled buffers.
|
||||
Provides an interface for using pooled arrays.
|
||||
</summary>
|
||||
<typeparam name="T">The buffer type content.</typeparam>
|
||||
<typeparam name="T">The array type content.</typeparam>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Rent(System.Int32)">
|
||||
<summary>
|
||||
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
|
||||
Rent a array from the pool. This array must be returned when it is no longer needed.
|
||||
</summary>
|
||||
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
|
||||
<returns>The rented buffer from the pool.</returns>
|
||||
<param name="minimumLength">The minimum required length of the array. The returned array may be longer.</param>
|
||||
<returns>The rented array from the pool. This array must be returned when it is no longer needed.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Return(`0[])">
|
||||
<summary>
|
||||
Return a buffer to the pool.
|
||||
Return an array to the pool.
|
||||
</summary>
|
||||
<param name="buffer">The buffer that is being returned.</param>
|
||||
<param name="array">The array that is being returned.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.JsonDictionaryAttribute">
|
||||
<summary>
|
||||
@@ -2331,44 +2291,6 @@
|
||||
</summary>
|
||||
<param name="token">The token to read from.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -4779,9 +4701,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.UnderlyingName">
|
||||
<summary>
|
||||
@@ -5096,6 +5018,11 @@
|
||||
Gets or sets the extension data getter.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonObjectContract.ExtensionDataValueType">
|
||||
<summary>
|
||||
Gets or sets the extension data value type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.JsonObjectContract.#ctor(System.Type)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.JsonObjectContract"/> class.
|
||||
@@ -5676,7 +5603,7 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.Converters">
|
||||
<summary>
|
||||
Gets or sets a collection <see cref="T:Newtonsoft.Json.JsonConverter"/> that will be used during serialization.
|
||||
Gets or sets a <see cref="T:Newtonsoft.Json.JsonConverter"/> collection that will be used during serialization.
|
||||
</summary>
|
||||
<value>The converters.</value>
|
||||
</member>
|
||||
@@ -5690,6 +5617,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializerSettings.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
<value>The type name handling.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.MetadataPropertyHandling">
|
||||
@@ -5913,6 +5845,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
@@ -5994,7 +5938,7 @@
|
||||
</summary>
|
||||
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the reader's character buffer pool.
|
||||
</summary>
|
||||
@@ -6007,21 +5951,13 @@
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -6033,7 +5969,13 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -6043,7 +5985,19 @@
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.DateTimeOffset"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.Close">
|
||||
<summary>
|
||||
@@ -6134,9 +6088,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Required">
|
||||
<summary>
|
||||
@@ -6191,9 +6145,9 @@
|
||||
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the writer's character buffer pool.
|
||||
Gets or sets the writer's character array pool.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
|
||||
@@ -6791,6 +6745,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
@@ -7569,6 +7535,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializer.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializer.TypeNameAssemblyFormat">
|
||||
<summary>
|
||||
@@ -8484,6 +8455,11 @@
|
||||
<summary>
|
||||
Specifies type name handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="T:Newtonsoft.Json.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.TypeNameHandling.None">
|
||||
<summary>
|
||||
@@ -9050,6 +9026,12 @@
|
||||
</summary>
|
||||
<param name="ws">The string of white space characters.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Releases unmanaged and - optionally - managed resources
|
||||
</summary>
|
||||
<param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.SetWriteState(Newtonsoft.Json.JsonToken,System.Object)">
|
||||
<summary>
|
||||
Sets the state of the JsonWriter,
|
||||
BIN
packages/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
@@ -76,46 +76,6 @@
|
||||
<param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param>
|
||||
<param name="dateTimeKindHandling">The <see cref="T:System.DateTimeKind" /> used when reading <see cref="T:System.DateTime"/> values from BSON.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -1084,24 +1044,24 @@
|
||||
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
|
||||
<member name="T:Newtonsoft.Json.IArrayPool`1">
|
||||
<summary>
|
||||
Provides an interface for using pooled buffers.
|
||||
Provides an interface for using pooled arrays.
|
||||
</summary>
|
||||
<typeparam name="T">The buffer type content.</typeparam>
|
||||
<typeparam name="T">The array type content.</typeparam>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Rent(System.Int32)">
|
||||
<summary>
|
||||
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
|
||||
Rent a array from the pool. This array must be returned when it is no longer needed.
|
||||
</summary>
|
||||
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
|
||||
<returns>The rented buffer from the pool.</returns>
|
||||
<param name="minimumLength">The minimum required length of the array. The returned array may be longer.</param>
|
||||
<returns>The rented array from the pool. This array must be returned when it is no longer needed.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Return(`0[])">
|
||||
<summary>
|
||||
Return a buffer to the pool.
|
||||
Return an array to the pool.
|
||||
</summary>
|
||||
<param name="buffer">The buffer that is being returned.</param>
|
||||
<param name="array">The array that is being returned.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.IJsonLineInfo">
|
||||
<summary>
|
||||
@@ -2158,9 +2118,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Required">
|
||||
<summary>
|
||||
@@ -2395,6 +2355,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
@@ -2580,6 +2552,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializer.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializer.TypeNameAssemblyFormat">
|
||||
<summary>
|
||||
@@ -2890,7 +2867,7 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.Converters">
|
||||
<summary>
|
||||
Gets or sets a collection <see cref="T:Newtonsoft.Json.JsonConverter"/> that will be used during serialization.
|
||||
Gets or sets a <see cref="T:Newtonsoft.Json.JsonConverter"/> collection that will be used during serialization.
|
||||
</summary>
|
||||
<value>The converters.</value>
|
||||
</member>
|
||||
@@ -2904,6 +2881,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializerSettings.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
<value>The type name handling.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.MetadataPropertyHandling">
|
||||
@@ -3049,7 +3031,7 @@
|
||||
</summary>
|
||||
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the reader's character buffer pool.
|
||||
</summary>
|
||||
@@ -3062,21 +3044,13 @@
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -3088,7 +3062,13 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -3098,7 +3078,19 @@
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.DateTimeOffset"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.Close">
|
||||
<summary>
|
||||
@@ -3134,9 +3126,9 @@
|
||||
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the writer's character buffer pool.
|
||||
Gets or sets the writer's character array pool.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
|
||||
@@ -3576,6 +3568,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
@@ -4047,6 +4051,12 @@
|
||||
</summary>
|
||||
<param name="ws">The string of white space characters.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Releases unmanaged and - optionally - managed resources
|
||||
</summary>
|
||||
<param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.SetWriteState(Newtonsoft.Json.JsonToken,System.Object)">
|
||||
<summary>
|
||||
Sets the state of the JsonWriter,
|
||||
@@ -6213,44 +6223,6 @@
|
||||
</summary>
|
||||
<param name="token">The token to read from.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -8460,6 +8432,11 @@
|
||||
Gets or sets the extension data getter.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonObjectContract.ExtensionDataValueType">
|
||||
<summary>
|
||||
Gets or sets the extension data value type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.JsonObjectContract.#ctor(System.Type)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.JsonObjectContract"/> class.
|
||||
@@ -8496,9 +8473,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.UnderlyingName">
|
||||
<summary>
|
||||
@@ -8863,6 +8840,11 @@
|
||||
<summary>
|
||||
Specifies type name handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="T:Newtonsoft.Json.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.TypeNameHandling.None">
|
||||
<summary>
|
||||
BIN
packages/Newtonsoft.Json.8.0.2/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.8.0.2/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
@@ -76,46 +76,6 @@
|
||||
<param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param>
|
||||
<param name="dateTimeKindHandling">The <see cref="T:System.DateTimeKind" /> used when reading <see cref="T:System.DateTime"/> values from BSON.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -857,24 +817,24 @@
|
||||
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
|
||||
<member name="T:Newtonsoft.Json.IArrayPool`1">
|
||||
<summary>
|
||||
Provides an interface for using pooled buffers.
|
||||
Provides an interface for using pooled arrays.
|
||||
</summary>
|
||||
<typeparam name="T">The buffer type content.</typeparam>
|
||||
<typeparam name="T">The array type content.</typeparam>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Rent(System.Int32)">
|
||||
<summary>
|
||||
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
|
||||
Rent a array from the pool. This array must be returned when it is no longer needed.
|
||||
</summary>
|
||||
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
|
||||
<returns>The rented buffer from the pool.</returns>
|
||||
<param name="minimumLength">The minimum required length of the array. The returned array may be longer.</param>
|
||||
<returns>The rented array from the pool. This array must be returned when it is no longer needed.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Return(`0[])">
|
||||
<summary>
|
||||
Return a buffer to the pool.
|
||||
Return an array to the pool.
|
||||
</summary>
|
||||
<param name="buffer">The buffer that is being returned.</param>
|
||||
<param name="array">The array that is being returned.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.IJsonLineInfo">
|
||||
<summary>
|
||||
@@ -1719,9 +1679,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Required">
|
||||
<summary>
|
||||
@@ -1956,6 +1916,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
@@ -2123,6 +2095,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializer.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializer.TypeNameAssemblyFormat">
|
||||
<summary>
|
||||
@@ -2433,7 +2410,7 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.Converters">
|
||||
<summary>
|
||||
Gets or sets a collection <see cref="T:Newtonsoft.Json.JsonConverter"/> that will be used during serialization.
|
||||
Gets or sets a <see cref="T:Newtonsoft.Json.JsonConverter"/> collection that will be used during serialization.
|
||||
</summary>
|
||||
<value>The converters.</value>
|
||||
</member>
|
||||
@@ -2447,6 +2424,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializerSettings.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
<value>The type name handling.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.MetadataPropertyHandling">
|
||||
@@ -2592,7 +2574,7 @@
|
||||
</summary>
|
||||
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the reader's character buffer pool.
|
||||
</summary>
|
||||
@@ -2605,21 +2587,13 @@
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -2631,7 +2605,13 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -2641,7 +2621,19 @@
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.DateTimeOffset"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.Close">
|
||||
<summary>
|
||||
@@ -2677,9 +2669,9 @@
|
||||
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the writer's character buffer pool.
|
||||
Gets or sets the writer's character array pool.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
|
||||
@@ -3119,6 +3111,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
@@ -3590,6 +3594,12 @@
|
||||
</summary>
|
||||
<param name="ws">The string of white space characters.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Releases unmanaged and - optionally - managed resources
|
||||
</summary>
|
||||
<param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.SetWriteState(Newtonsoft.Json.JsonToken,System.Object)">
|
||||
<summary>
|
||||
Sets the state of the JsonWriter,
|
||||
@@ -5504,44 +5514,6 @@
|
||||
</summary>
|
||||
<param name="token">The token to read from.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -7619,6 +7591,11 @@
|
||||
Gets or sets the extension data getter.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonObjectContract.ExtensionDataValueType">
|
||||
<summary>
|
||||
Gets or sets the extension data value type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.JsonObjectContract.#ctor(System.Type)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.JsonObjectContract"/> class.
|
||||
@@ -7655,9 +7632,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.UnderlyingName">
|
||||
<summary>
|
||||
@@ -8052,6 +8029,11 @@
|
||||
<summary>
|
||||
Specifies type name handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="T:Newtonsoft.Json.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.TypeNameHandling.None">
|
||||
<summary>
|
||||
BIN
packages/Newtonsoft.Json.8.0.2/lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.8.0.2/lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
@@ -76,46 +76,6 @@
|
||||
<param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param>
|
||||
<param name="dateTimeKindHandling">The <see cref="T:System.DateTimeKind" /> used when reading <see cref="T:System.DateTime"/> values from BSON.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Bson.BsonReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -956,24 +916,24 @@
|
||||
Causes child objects to be indented according to the <see cref="P:Newtonsoft.Json.JsonTextWriter.Indentation"/> and <see cref="P:Newtonsoft.Json.JsonTextWriter.IndentChar"/> settings.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.IJsonBufferPool`1">
|
||||
<member name="T:Newtonsoft.Json.IArrayPool`1">
|
||||
<summary>
|
||||
Provides an interface for using pooled buffers.
|
||||
Provides an interface for using pooled arrays.
|
||||
</summary>
|
||||
<typeparam name="T">The buffer type content.</typeparam>
|
||||
<typeparam name="T">The array type content.</typeparam>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.RentBuffer(System.Int32)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Rent(System.Int32)">
|
||||
<summary>
|
||||
Rent a buffer from the pool. This buffer must be returned when it is no longer needed.
|
||||
Rent a array from the pool. This array must be returned when it is no longer needed.
|
||||
</summary>
|
||||
<param name="minSize">The minimum required size of the buffer. The returned buffer may be larger.</param>
|
||||
<returns>The rented buffer from the pool.</returns>
|
||||
<param name="minimumLength">The minimum required length of the array. The returned array may be longer.</param>
|
||||
<returns>The rented array from the pool. This array must be returned when it is no longer needed.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.IJsonBufferPool`1.ReturnBuffer(`0[]@)">
|
||||
<member name="M:Newtonsoft.Json.IArrayPool`1.Return(`0[])">
|
||||
<summary>
|
||||
Return a buffer to the pool.
|
||||
Return an array to the pool.
|
||||
</summary>
|
||||
<param name="buffer">The buffer that is being returned.</param>
|
||||
<param name="array">The array that is being returned.</param>
|
||||
</member>
|
||||
<member name="T:Newtonsoft.Json.IJsonLineInfo">
|
||||
<summary>
|
||||
@@ -1969,9 +1929,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonPropertyAttribute.Required">
|
||||
<summary>
|
||||
@@ -2206,6 +2166,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
@@ -2373,6 +2345,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializer.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializer.TypeNameAssemblyFormat">
|
||||
<summary>
|
||||
@@ -2683,7 +2660,7 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.Converters">
|
||||
<summary>
|
||||
Gets or sets a collection <see cref="T:Newtonsoft.Json.JsonConverter"/> that will be used during serialization.
|
||||
Gets or sets a <see cref="T:Newtonsoft.Json.JsonConverter"/> collection that will be used during serialization.
|
||||
</summary>
|
||||
<value>The converters.</value>
|
||||
</member>
|
||||
@@ -2697,6 +2674,11 @@
|
||||
<summary>
|
||||
Gets or sets how type name writing and reading is handled by the serializer.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="P:Newtonsoft.Json.JsonSerializerSettings.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
<value>The type name handling.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonSerializerSettings.MetadataPropertyHandling">
|
||||
@@ -2842,7 +2824,7 @@
|
||||
</summary>
|
||||
<param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextReader.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the reader's character buffer pool.
|
||||
</summary>
|
||||
@@ -2855,21 +2837,13 @@
|
||||
true if the next token was read successfully; false if there are no more tokens to read.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsInt32">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -2881,7 +2855,13 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDateTime">
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
@@ -2891,7 +2871,19 @@
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.DateTimeOffset"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonTextReader.Close">
|
||||
<summary>
|
||||
@@ -2927,9 +2919,9 @@
|
||||
Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.BufferPool">
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.ArrayPool">
|
||||
<summary>
|
||||
Gets or sets the writer's character buffer pool.
|
||||
Gets or sets the writer's character array pool.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.JsonTextWriter.Indentation">
|
||||
@@ -3369,6 +3361,18 @@
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsDouble">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsBoolean">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonValidatingReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
@@ -3840,6 +3844,12 @@
|
||||
</summary>
|
||||
<param name="ws">The string of white space characters.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.Dispose(System.Boolean)">
|
||||
<summary>
|
||||
Releases unmanaged and - optionally - managed resources
|
||||
</summary>
|
||||
<param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.JsonWriter.SetWriteState(Newtonsoft.Json.JsonToken,System.Object)">
|
||||
<summary>
|
||||
Sets the state of the JsonWriter,
|
||||
@@ -5792,44 +5802,6 @@
|
||||
</summary>
|
||||
<param name="token">The token to read from.</param>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsBytes">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Byte"/>[].
|
||||
</summary>
|
||||
<returns>
|
||||
A <see cref="T:System.Byte"/>[] or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDecimal">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsInt32">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsString">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.String"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.String"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTime">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTimeOffset">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream as a <see cref="T:System.Nullable`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Nullable`1"/>. This method will return <c>null</c> at the end of an array.</returns>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Linq.JTokenReader.Read">
|
||||
<summary>
|
||||
Reads the next JSON token from the stream.
|
||||
@@ -7940,6 +7912,11 @@
|
||||
Gets or sets the extension data getter.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonObjectContract.ExtensionDataValueType">
|
||||
<summary>
|
||||
Gets or sets the extension data value type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Newtonsoft.Json.Serialization.JsonObjectContract.#ctor(System.Type)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Newtonsoft.Json.Serialization.JsonObjectContract"/> class.
|
||||
@@ -7976,9 +7953,9 @@
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.Order">
|
||||
<summary>
|
||||
Gets or sets the order of serialization and deserialization of a member.
|
||||
Gets or sets the order of serialization of a member.
|
||||
</summary>
|
||||
<value>The numeric order of serialization or deserialization.</value>
|
||||
<value>The numeric order of serialization.</value>
|
||||
</member>
|
||||
<member name="P:Newtonsoft.Json.Serialization.JsonProperty.UnderlyingName">
|
||||
<summary>
|
||||
@@ -8373,6 +8350,11 @@
|
||||
<summary>
|
||||
Specifies type name handling options for the <see cref="T:Newtonsoft.Json.JsonSerializer"/>.
|
||||
</summary>
|
||||
<remarks>
|
||||
<see cref="T:Newtonsoft.Json.TypeNameHandling"/> should be used with caution when your application deserializes JSON from an external source.
|
||||
Incoming types should be validated with a custom <see cref="T:System.Runtime.Serialization.SerializationBinder"/>
|
||||
when deserializing with a value other than <c>TypeNameHandling.None</c>.
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Newtonsoft.Json.TypeNameHandling.None">
|
||||
<summary>
|
||||
BIN
packages/SteamKit2.1.6.5/SteamKit2.1.6.5.nupkg
vendored
BIN
packages/SteamKit2.1.6.5/SteamKit2.1.6.5.nupkg
vendored
Binary file not shown.
BIN
packages/SteamKit2.1.6.5/lib/net40/SteamKit2.dll
vendored
BIN
packages/SteamKit2.1.6.5/lib/net40/SteamKit2.dll
vendored
Binary file not shown.
BIN
packages/SteamKit2.1.7.0/SteamKit2.1.7.0.nupkg
vendored
Normal file
BIN
packages/SteamKit2.1.7.0/SteamKit2.1.7.0.nupkg
vendored
Normal file
Binary file not shown.
BIN
packages/SteamKit2.1.7.0/lib/net45/SteamKit2.dll
vendored
Normal file
BIN
packages/SteamKit2.1.7.0/lib/net45/SteamKit2.dll
vendored
Normal file
Binary file not shown.
@@ -821,6 +821,12 @@
|
||||
The connection timeout.
|
||||
</value>
|
||||
</member>
|
||||
<member name="P:SteamKit2.Internal.CMClient.DebugNetworkListener">
|
||||
<summary>
|
||||
Gets or sets the network listening interface. Use this for debugging only.
|
||||
For your convenience, you can use <see cref="T:SteamKit2.NetHookNetworkListener"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.Internal.CMClient.#ctor(System.Net.Sockets.ProtocolType)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.Internal.CMClient"/> class with a specific connection type.
|
||||
@@ -1492,14 +1498,14 @@
|
||||
Smart list of CM servers.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SmartCMServerList.ScoreExpiryTimeSpan">
|
||||
<member name="P:SteamKit2.SmartCMServerList.BadConnectionMemoryTimeSpan">
|
||||
<summary>
|
||||
Determines after how much time a server's score should expire and be reset to it's base value.
|
||||
Determines how long a server's bad connection state is remembered for.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SmartCMServerList.ResetOldScores">
|
||||
<summary>
|
||||
Resets the scores of all servers which had their scores last updated a <see cref="P:SteamKit2.SmartCMServerList.ScoreExpiryTimeSpan"/> ago.
|
||||
Resets the scores of all servers which has a last bad connection more than <see cref="P:SteamKit2.SmartCMServerList.BadConnectionMemoryTimeSpan"/> ago.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SmartCMServerList.TryAdd(System.Net.IPEndPoint)">
|
||||
@@ -1516,9 +1522,18 @@
|
||||
<param name="endPoints">The collection of <see cref="T:System.Net.IPEndPoint"/>s to add.</param>
|
||||
<returns>false if any of the specified servers are already in the list, true otherwise.</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SmartCMServerList.ResetAllScores">
|
||||
<member name="M:SteamKit2.SmartCMServerList.MergeWithList(System.Collections.Generic.IEnumerable{System.Net.IPEndPoint})">
|
||||
<summary>
|
||||
Explicitly resets the quality of every stored server.
|
||||
Merges the list with a new list of servers provided to us by the Steam servers.
|
||||
This adds the new list of <see cref="T:System.Net.IPEndPoint"/>s to the beginning of the list,
|
||||
ensuring that any pre-existing servers are moved into their new place in order near
|
||||
the beginning of the list.
|
||||
</summary>
|
||||
<param name="listToMerge">The <see cref="T:System.Net.IPEndPoint"/>s to merge into this <see cref="T:SteamKit2.SmartCMServerList"/>.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SmartCMServerList.ResetBadServers">
|
||||
<summary>
|
||||
Explicitly resets the known state of all servers.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SmartCMServerList.Clear">
|
||||
@@ -1853,6 +1868,7 @@
|
||||
<summary>
|
||||
Requests details for a specific item of user generated content from the Steam servers.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamCloud.UGCDetailsCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="ugcId">The unique user generated content id.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamCloud.UGCDetailsCallback"/>.</returns>
|
||||
@@ -1861,6 +1877,7 @@
|
||||
<summary>
|
||||
Requests details for a specific file in the user's Cloud storage.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamCloud.SingleFileInfoCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="appid">The app id of the game.</param>
|
||||
<param name="filename">The path to the file being requested.</param>
|
||||
@@ -1870,6 +1887,7 @@
|
||||
<summary>
|
||||
Commit a Cloud file at the given path to make its UGC handle publicly visible.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamCloud.ShareFileCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="appid">The app id of the game.</param>
|
||||
<param name="filename">The path to the file being requested.</param>
|
||||
@@ -2009,9 +2027,8 @@
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamGameServer.LogOff">
|
||||
<summary>
|
||||
Logs the game server off of the Steam3 network.
|
||||
This method does not disconnect the client.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamUser.LoggedOffCallback"/>.
|
||||
Informs the Steam servers that this client wishes to log off from the network.
|
||||
The Steam server will disconnect the client, and a <see cref="T:SteamKit2.SteamClient.DisconnectedCallback"/> will be posted.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamGameServer.SendStatus(SteamKit2.SteamGameServer.StatusDetails)">
|
||||
@@ -2139,6 +2156,7 @@
|
||||
<summary>
|
||||
Requests a list of servers from the Steam game master server.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamMasterServer.QueryCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="details">The details for the request.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamMasterServer.QueryCallback"/>.</returns>
|
||||
@@ -2242,6 +2260,7 @@
|
||||
<summary>
|
||||
Adds a screenshot to the user's screenshot library. The screenshot image and thumbnail must already exist on the UFS.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamScreenshots.ScreenshotAddedCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="details">The details of the screenshot.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamScreenshots.ScreenshotAddedCallback"/>.</returns>
|
||||
@@ -2428,6 +2447,7 @@
|
||||
<summary>
|
||||
Sends a message.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamUnifiedMessages.ServiceMethodResponse"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<typeparam name="TResponse">The type of the protobuf object which is the response to the RPC call.</typeparam>
|
||||
<param name="expr">RPC call expression, e.g. x => x.SomeMethodCall(message);</param>
|
||||
@@ -2438,6 +2458,7 @@
|
||||
<summary>
|
||||
Sends a message.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamUnifiedMessages.ServiceMethodResponse"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<typeparam name="TRequest">The type of a protobuf object.</typeparam>
|
||||
<param name="name">Name of the RPC endpoint. Takes the format ServiceName.RpcName</param>
|
||||
@@ -2656,6 +2677,7 @@
|
||||
<summary>
|
||||
Enumerates the list of published files for the current logged in user.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamWorkshop.UserPublishedFilesCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="details">The specific details of the request.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamWorkshop.UserPublishedFilesCallback"/>.</returns>
|
||||
@@ -2664,6 +2686,7 @@
|
||||
<summary>
|
||||
Enumerates the list of subscribed files for the current logged in user.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamWorkshop.UserSubscribedFilesCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="details">The specific details of the request.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamWorkshop.UserSubscribedFilesCallback"/>.</returns>
|
||||
@@ -2672,6 +2695,7 @@
|
||||
<summary>
|
||||
Enumerates the list of published files for the current logged in user based on user action.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamWorkshop.UserActionPublishedFilesCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="details">The specific details of the request.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamWorkshop.UserActionPublishedFilesCallback"/>.</returns>
|
||||
@@ -2740,6 +2764,7 @@
|
||||
<summary>
|
||||
Enumerates the list of all published files on the Steam workshop.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamWorkshop.PublishedFilesCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="details">The specific details of the request.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamWorkshop.PublishedFilesCallback"/>.</returns>
|
||||
@@ -2767,6 +2792,7 @@
|
||||
<summary>
|
||||
Asks the Steam back-end for a leaderboard by name for a given appid.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamUserStats.FindOrCreateLeaderboardCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="appId">The AppID to request a leaderboard for.</param>
|
||||
<param name="name">Name of the leaderboard to request.</param>
|
||||
@@ -2776,6 +2802,7 @@
|
||||
<summary>
|
||||
Asks the Steam back-end for a leaderboard by name, and will create it if it's not yet.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamUserStats.FindOrCreateLeaderboardCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="appId">The AppID to request a leaderboard for.</param>
|
||||
<param name="name">Name of the leaderboard to create.</param>
|
||||
@@ -2787,6 +2814,7 @@
|
||||
<summary>
|
||||
Asks the Steam back-end for a set of rows in the leaderboard.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamUserStats.LeaderboardEntriesCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="appId">The AppID to request leaderboard rows for.</param>
|
||||
<param name="id">ID of the leaderboard to view.</param>
|
||||
@@ -2896,6 +2924,79 @@
|
||||
Gets the list of leaderboard entries this response contains.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobManager.StartJob(SteamKit2.AsyncJob)">
|
||||
<summary>
|
||||
Tracks a job with this manager.
|
||||
</summary>
|
||||
<param name="asyncJob">The asynchronous job to track.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobManager.TryCompleteJob(SteamKit2.JobID,SteamKit2.CallbackMsg)">
|
||||
<summary>
|
||||
Passes a callback to a pending async job.
|
||||
If the given callback completes the job, the job is removed from this manager.
|
||||
</summary>
|
||||
<param name="jobId">The JobID.</param>
|
||||
<param name="callback">The callback.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobManager.HeartbeatJob(SteamKit2.JobID)">
|
||||
<summary>
|
||||
Extends the lifetime of a job.
|
||||
</summary>
|
||||
<param name="jobId">The job identifier.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobManager.FailJob(SteamKit2.JobID)">
|
||||
<summary>
|
||||
Marks a certain job as remotely failed.
|
||||
</summary>
|
||||
<param name="jobId">The job identifier.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobManager.CancelPendingJobs">
|
||||
<summary>
|
||||
Cancels and clears all jobs being tracked.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobManager.SetTimeoutsEnabled(System.Boolean)">
|
||||
<summary>
|
||||
Enables or disables periodic checks for job timeouts.
|
||||
</summary>
|
||||
<param name="enable">Whether or not job timeout checks should be enabled.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobManager.CancelTimedoutJobs">
|
||||
<summary>
|
||||
This is called periodically to cancel and clear out any jobs that have timed out (no response from Steam).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobManager.GetJob(SteamKit2.JobID,System.Boolean)">
|
||||
<summary>
|
||||
Retrieves a job from this manager, and optionally removes it from tracking.
|
||||
</summary>
|
||||
<param name="jobId">The JobID.</param>
|
||||
<param name="andRemove">If set to <c>true</c>, this job is removed from tracking.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:SteamKit2.AsyncJobFailedException">
|
||||
<summary>
|
||||
Thrown when Steam encounters a remote error with a pending <see cref="T:SteamKit2.AsyncJob"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobFailedException.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.AsyncJobFailedException"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobFailedException.#ctor(System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.AsyncJobFailedException"/> class.
|
||||
</summary>
|
||||
<param name="message">The message that describes the error.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobFailedException.#ctor(System.String,System.Exception)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.AsyncJobFailedException"/> class.
|
||||
</summary>
|
||||
<param name="message">The error message that explains the reason for the exception.</param>
|
||||
<param name="innerException">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>
|
||||
</member>
|
||||
<member name="T:SteamKit2.Callback`1">
|
||||
<summary>
|
||||
This utility class is used for binding a callback to a function.
|
||||
@@ -3229,19 +3330,20 @@
|
||||
Helper class to load servers from the Steam Directory Web API.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamDirectory.Initialize(System.Int32)">
|
||||
<member name="M:SteamKit2.SteamDirectory.Initialize(System.UInt32)">
|
||||
<summary>
|
||||
Initializes <see cref="T:SteamKit2.Internal.CMClient"/>'s server list with servers from the Steam Directory.
|
||||
</summary>
|
||||
<param name="cellid">Cell ID</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamDirectory.LoadAsync(System.Int32)">
|
||||
<member name="M:SteamKit2.SteamDirectory.LoadAsync(System.UInt32)">
|
||||
<summary>
|
||||
Load a list of servers from the Steam Directory.
|
||||
</summary>
|
||||
<param name="cellid">Cell ID</param>
|
||||
<returns>A <see cref="T:System.Threading.Tasks.Task"/> with the Result set to an enumerable list of <see cref="T:System.Net.IPEndPoint"/>s.</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamDirectory.LoadAsync(System.Int32,System.Threading.CancellationToken)">
|
||||
<member name="M:SteamKit2.SteamDirectory.LoadAsync(System.UInt32,System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
Load a list of servers from the Steam Directory.
|
||||
</summary>
|
||||
@@ -3536,45 +3638,6 @@
|
||||
A <see cref="T:System.String"/> that represents this instance.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:SteamKit2.JobID">
|
||||
<summary>
|
||||
Represents an identifier of a network task known as a job.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:SteamKit2.JobID.Invalid">
|
||||
<summary>
|
||||
Represents an invalid JobID.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.JobID.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.JobID"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.JobID.#ctor(System.UInt64)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.JobID"/> class.
|
||||
</summary>
|
||||
<param name="jobId">The Job ID to initialize this instance with.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.JobID.op_Implicit(SteamKit2.JobID)~System.UInt64">
|
||||
<summary>
|
||||
Performs an implicit conversion from <see cref="T:SteamKit2.JobID"/> to <see cref="T:System.UInt64"/>.
|
||||
</summary>
|
||||
<param name="jobId">The Job ID.</param>
|
||||
<returns>
|
||||
The result of the conversion.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.JobID.op_Implicit(System.UInt64)~SteamKit2.JobID">
|
||||
<summary>
|
||||
Performs an implicit conversion from <see cref="T:System.UInt64"/> to <see cref="T:SteamKit2.JobID"/>.
|
||||
</summary>
|
||||
<param name="jobId">The Job ID.</param>
|
||||
<returns>
|
||||
The result of the conversion.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:SteamKit2.UGCHandle">
|
||||
<summary>
|
||||
Represents a single unique handle to a piece of User Generated Content.
|
||||
@@ -3699,6 +3762,195 @@
|
||||
<param name="encryptionKey">The encryption key.</param>
|
||||
<returns><c>true</c> if the file names were successfully decrypted; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="T:SteamKit2.JobID">
|
||||
<summary>
|
||||
Represents an identifier of a network task known as a job.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:SteamKit2.JobID.Invalid">
|
||||
<summary>
|
||||
Represents an invalid JobID.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.JobID.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.JobID"/> class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.JobID.#ctor(System.UInt64)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.JobID"/> class.
|
||||
</summary>
|
||||
<param name="jobId">The Job ID to initialize this instance with.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.JobID.op_Implicit(SteamKit2.JobID)~System.UInt64">
|
||||
<summary>
|
||||
Performs an implicit conversion from <see cref="T:SteamKit2.JobID"/> to <see cref="T:System.UInt64"/>.
|
||||
</summary>
|
||||
<param name="jobId">The Job ID.</param>
|
||||
<returns>
|
||||
The result of the conversion.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.JobID.op_Implicit(System.UInt64)~SteamKit2.JobID">
|
||||
<summary>
|
||||
Performs an implicit conversion from <see cref="T:System.UInt64"/> to <see cref="T:SteamKit2.JobID"/>.
|
||||
</summary>
|
||||
<param name="jobId">The Job ID.</param>
|
||||
<returns>
|
||||
The result of the conversion.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.JobID.op_Implicit(SteamKit2.AsyncJob)~SteamKit2.JobID">
|
||||
<summary>
|
||||
Performs an implicit conversion from <see cref="T:SteamKit2.AsyncJob"/> to <see cref="T:SteamKit2.JobID"/>.
|
||||
</summary>
|
||||
<param name="asyncJob">The asynchronous job.</param>
|
||||
<returns>
|
||||
The result of the conversion.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:SteamKit2.AsyncJob">
|
||||
<summary>
|
||||
The base class for awaitable versions of a <see cref="P:SteamKit2.AsyncJob.JobID"/>.
|
||||
Should not be used or constructed directly, but rather with <see cref="T:SteamKit2.AsyncJob`1"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.AsyncJob.JobID">
|
||||
<summary>
|
||||
Gets the <see cref="P:SteamKit2.AsyncJob.JobID"/> for this job.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.AsyncJob.Timeout">
|
||||
<summary>
|
||||
Gets or sets the period of time before this job will be considered timed out and will be canceled. By default this is 10 seconds.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJob.AddResult(SteamKit2.CallbackMsg)">
|
||||
<summary>
|
||||
Adds a callback to the async job's result set.
|
||||
</summary>
|
||||
<param name="callback">The callback.</param>
|
||||
<returns><c>true</c> if this result completes the set; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJob.SetFailed(System.Boolean)">
|
||||
<summary>
|
||||
Sets this job as failed, either remotely or due to a message timeout.
|
||||
</summary>
|
||||
<param name="dueToRemoteFailure">
|
||||
If set to <c>true</c> this job is marked as failed because Steam informed us of a job failure;
|
||||
otherwise, this job has failed due to a message timeout.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJob.Heartbeat">
|
||||
<summary>
|
||||
Marks this job as having received a heartbeat and extends the job's timeout.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:SteamKit2.AsyncJob`1">
|
||||
<summary>
|
||||
Represents an awaitable version of a <see cref="T:SteamKit2.JobID"/>.
|
||||
Can either be converted to a TPL <see cref="T:System.Threading.Tasks.Task"/> with <see cref="M:SteamKit2.AsyncJob`1.ToTask"/> or can be awaited directly.
|
||||
</summary>
|
||||
<typeparam name="T">The callback type that will be returned by this async job.</typeparam>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJob`1.#ctor(SteamKit2.SteamClient,SteamKit2.JobID)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.AsyncJob`1" /> class.
|
||||
</summary>
|
||||
<param name="client">The <see cref="T:SteamKit2.SteamClient"/> that this job will be associated with.</param>
|
||||
<param name="jobId">The Job ID value associated with this async job.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJob`1.ToTask">
|
||||
<summary>
|
||||
Converts this <see cref="T:SteamKit2.AsyncJob`1"/> instance into a TPL <see cref="T:System.Threading.Tasks.Task`1"/>.
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJob`1.GetAwaiter">
|
||||
<summary>Gets an awaiter used to await this <see cref="T:SteamKit2.AsyncJob`1"/>.</summary>
|
||||
<returns>An awaiter instance.</returns>
|
||||
<remarks>This method is intended for compiler use rather than use directly in code.</remarks>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJob`1.AddResult(SteamKit2.CallbackMsg)">
|
||||
<summary>
|
||||
Adds a callback to the async job's result set. For an <see cref="T:SteamKit2.AsyncJob`1"/>, this always completes the set.
|
||||
</summary>
|
||||
<param name="callback">The callback.</param>
|
||||
<returns>Always <c>true</c>.</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJob`1.SetFailed(System.Boolean)">
|
||||
<summary>
|
||||
Sets this job as failed, either remotely or due to a message timeout.
|
||||
</summary>
|
||||
<param name="dueToRemoteFailure">
|
||||
If set to <c>true</c> this job is marked as failed because Steam informed us of a job failure;
|
||||
otherwise, this job has failed due to a message timeout.
|
||||
</param>
|
||||
</member>
|
||||
<member name="T:SteamKit2.AsyncJobMultiple`1">
|
||||
<summary>
|
||||
Represents an awaitable version of a <see cref="T:SteamKit2.JobID"/>.
|
||||
Can either be converted to a TPL <see cref="T:System.Threading.Tasks.Task"/> with <see cref="M:SteamKit2.AsyncJobMultiple`1.ToTask"/> or can be awaited directly.
|
||||
This type of async job can contain multiple callback results.
|
||||
</summary>
|
||||
<typeparam name="T">The callback type that will be returned by this async job.</typeparam>
|
||||
</member>
|
||||
<member name="T:SteamKit2.AsyncJobMultiple`1.ResultSet">
|
||||
<summary>
|
||||
The set of callback results for an <see cref="T:SteamKit2.AsyncJobMultiple`1"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.AsyncJobMultiple`1.ResultSet.Complete">
|
||||
<summary>
|
||||
Gets a value indicating whether this <see cref="T:SteamKit2.AsyncJobMultiple`1.ResultSet" /> is complete and contains every result sent by Steam.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.AsyncJobMultiple`1.ResultSet.Failed">
|
||||
<summary>
|
||||
Gets a value indicating whether the parent <see cref="T:SteamKit2.AsyncJobMultiple`1" /> received an incomplete result set and then encountered a remote failure.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.AsyncJobMultiple`1.ResultSet.Results">
|
||||
<summary>
|
||||
Gets a read only collection of callback results for this async job.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobMultiple`1.#ctor(SteamKit2.SteamClient,SteamKit2.JobID,System.Predicate{`0})">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.AsyncJob`1" /> class.
|
||||
</summary>
|
||||
<param name="client">The <see cref="T:SteamKit2.SteamClient"/> that this job will be associated with.</param>
|
||||
<param name="jobId">The Job ID value associated with this async job.</param>
|
||||
<param name="finishCondition">The condition that must be fulfilled for the result set to be considered complete.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobMultiple`1.ToTask">
|
||||
<summary>
|
||||
Converts this <see cref="T:SteamKit2.AsyncJob`1"/> instance into a TPL <see cref="T:System.Threading.Tasks.Task`1"/>.
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobMultiple`1.GetAwaiter">
|
||||
<summary>Gets an awaiter used to await this <see cref="T:SteamKit2.AsyncJob`1"/>.</summary>
|
||||
<returns>An awaiter instance.</returns>
|
||||
<remarks>This method is intended for compiler use rather than use directly in code.</remarks>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobMultiple`1.AddResult(SteamKit2.CallbackMsg)">
|
||||
<summary>
|
||||
Adds a callback to the async job's result set.
|
||||
</summary>
|
||||
<param name="callback">The callback.</param>
|
||||
<returns><c>true</c> if this result completes the set; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.AsyncJobMultiple`1.SetFailed(System.Boolean)">
|
||||
<summary>
|
||||
Sets this job as failed, either remotely or due to a message timeout.
|
||||
</summary>
|
||||
<param name="dueToRemoteFailure">
|
||||
If set to <c>true</c> this job is marked as failed because Steam informed us of a job failure;
|
||||
otherwise, this job has failed due to a message timeout.
|
||||
</param>
|
||||
</member>
|
||||
<member name="T:SteamKit2.MessageObject">
|
||||
<summary>
|
||||
Represents a <see cref="T:SteamKit2.KeyValue"/> backed MessageObject structure, which are often sent by the Steam servers.
|
||||
@@ -3840,6 +4092,60 @@
|
||||
The result of the operator.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:SteamKit2.IDebugNetworkListener">
|
||||
<summary>
|
||||
This is a debug utility, do not use it to implement your business logic.
|
||||
|
||||
This interface is used for logging network messages sent to and received from the Steam server that the client is connected to.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.IDebugNetworkListener.OnIncomingNetworkMessage(SteamKit2.EMsg,System.Byte[])">
|
||||
<summary>
|
||||
Called when a packet is received from the Steam server.
|
||||
</summary>
|
||||
<param name="msgType">Network message type of this packet message.</param>
|
||||
<param name="data">Raw packet data that was received.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.IDebugNetworkListener.OnOutgoingNetworkMessage(SteamKit2.EMsg,System.Byte[])">
|
||||
<summary>
|
||||
Called when a packet is about to be sent to the Steam server.
|
||||
</summary>
|
||||
<param name="msgType">Network message type of this packet message.</param>
|
||||
<param name="data">Raw packet data that will be sent.</param>
|
||||
</member>
|
||||
<member name="T:SteamKit2.NetHookNetworkListener">
|
||||
<summary>
|
||||
Dump any network messages sent to and received from the Steam server that the client is connected to.
|
||||
These messages are dumped to file, and can be analyzed further with NetHookAnalyzer, a hex editor, or your own purpose-built tools.
|
||||
|
||||
Be careful with this, sensitive data may be written to the disk (such as your Steam password).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.NetHookNetworkListener.#ctor">
|
||||
<summary>
|
||||
Will create a folder in path "%assembly%/nethook/%currenttime%/"
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.NetHookNetworkListener.#ctor(System.String)">
|
||||
<summary>
|
||||
Log to your own folder.
|
||||
</summary>
|
||||
<param name="path">Path to folder.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.NetHookNetworkListener.OnIncomingNetworkMessage(SteamKit2.EMsg,System.Byte[])">
|
||||
<summary>
|
||||
Called when a packet is received from the Steam server.
|
||||
</summary>
|
||||
<param name="msgType">Network message type of this packet message.</param>
|
||||
<param name="data">Raw packet data that was received.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.NetHookNetworkListener.OnOutgoingNetworkMessage(SteamKit2.EMsg,System.Byte[])">
|
||||
<summary>
|
||||
Called when a packet is about to be sent to the Steam server.
|
||||
</summary>
|
||||
<param name="msgType">Network message type of this packet message.</param>
|
||||
<param name="data">Raw packet data that will be sent.</param>
|
||||
</member>
|
||||
<member name="P:SteamKit2.UdpPacket.IsValid">
|
||||
<summary>
|
||||
Gets a value indicating whether this instance is valid.
|
||||
@@ -4356,7 +4662,7 @@
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamApps.PICSProductInfoCallback.ResponsePending">
|
||||
<summary>
|
||||
Gets if the are more product information responses pending
|
||||
Gets if there are more product information responses pending
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamApps.PICSProductInfoCallback.UnknownPackages">
|
||||
@@ -4507,6 +4813,7 @@
|
||||
<summary>
|
||||
Requests an app ownership ticket for the specified AppID.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.AppOwnershipTicketCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="appid">The appid to request the ownership ticket of.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamApps.AppOwnershipTicketCallback"/>.</returns>
|
||||
@@ -4515,6 +4822,7 @@
|
||||
<summary>
|
||||
Requests app information for a single app. Use the overload for requesting information on a batch of apps.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.AppInfoCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
|
||||
Consider using <see cref="o:SteamApps.PICSGetProductInfo"/> instead.
|
||||
</summary>
|
||||
@@ -4526,6 +4834,7 @@
|
||||
<summary>
|
||||
Requests app information for a single app. Use the overload for requesting information on a batch of apps.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.AppInfoCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
|
||||
Consider using <see cref="o:SteamApps.PICSGetProductInfo"/> instead.
|
||||
</summary>
|
||||
@@ -4537,6 +4846,7 @@
|
||||
<summary>
|
||||
Requests app information for a list of apps.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.AppInfoCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
|
||||
Consider using <see cref="o:SteamApps.PICSGetProductInfo"/> instead.
|
||||
</summary>
|
||||
@@ -4548,6 +4858,7 @@
|
||||
<summary>
|
||||
Requests app information for a list of apps.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.AppInfoCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
|
||||
Consider using <see cref="o:SteamApps.PICSGetProductInfo"/> instead.
|
||||
</summary>
|
||||
@@ -4559,6 +4870,7 @@
|
||||
<summary>
|
||||
Requests package information for a single package. Use the overload for requesting information on a batch of packages.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.PackageInfoCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
|
||||
Consider using <see cref="o:SteamApps.PICSGetProductInfo"/> instead.
|
||||
</summary>
|
||||
@@ -4570,6 +4882,7 @@
|
||||
<summary>
|
||||
Requests package information for a list of packages.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.PackageInfoCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
|
||||
Consider using <see cref="o:SteamApps.PICSGetProductInfo"/> instead.
|
||||
</summary>
|
||||
@@ -4591,15 +4904,27 @@
|
||||
<summary>
|
||||
Request the depot decryption key for a specified DepotID.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.DepotKeyCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="depotid">The DepotID to request a decryption key for.</param>
|
||||
<param name="appid">The AppID to request the decryption key for.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamApps.DepotKeyCallback"/>.</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamApps.PICSGetAccessTokens(System.Nullable{System.UInt32},System.Nullable{System.UInt32})">
|
||||
<summary>
|
||||
Request PICS access tokens for an app or package.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.PICSTokensCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="app">App id to request access token for.</param>
|
||||
<param name="package">Package id to request access token for.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamApps.PICSTokensCallback"/>.</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamApps.PICSGetAccessTokens(System.Collections.Generic.IEnumerable{System.UInt32},System.Collections.Generic.IEnumerable{System.UInt32})">
|
||||
<summary>
|
||||
Request PICS access tokens for a list of app ids and package ids
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.PICSTokensCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="appIds">List of app ids to request access tokens for.</param>
|
||||
<param name="packageIds">List of package ids to request access tokens for.</param>
|
||||
@@ -4609,6 +4934,7 @@
|
||||
<summary>
|
||||
Request changes for apps and packages since a given change number
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.PICSChangesCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="lastChangeNumber">Last change number seen.</param>
|
||||
<param name="sendAppChangelist">Whether to send app changes.</param>
|
||||
@@ -4619,6 +4945,7 @@
|
||||
<summary>
|
||||
Request product information for an app or package
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.PICSProductInfoCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="app">App id requested.</param>
|
||||
<param name="package">Package id requested.</param>
|
||||
@@ -4630,6 +4957,7 @@
|
||||
<summary>
|
||||
Request product information for a list of apps or packages
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.PICSProductInfoCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="apps">List of app ids requested.</param>
|
||||
<param name="packages">List of package ids requested.</param>
|
||||
@@ -4641,6 +4969,7 @@
|
||||
<summary>
|
||||
Request product information for a list of apps or packages
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.PICSProductInfoCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="apps">List of <see cref="T:SteamKit2.SteamApps.PICSRequest"/> requests for apps.</param>
|
||||
<param name="packages">List of <see cref="T:SteamKit2.SteamApps.PICSRequest"/> requests for packages.</param>
|
||||
@@ -4651,6 +4980,7 @@
|
||||
<summary>
|
||||
Request product information for an app or package
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.CDNAuthTokenCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="app">App id requested.</param>
|
||||
<param name="host_name">CDN host name being requested.</param>
|
||||
@@ -4660,6 +4990,7 @@
|
||||
<summary>
|
||||
Request a free license for given appid, can be used for free on demand apps
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.FreeLicenseCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="app">The app to request a free license for.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamApps.FreeLicenseCallback"/>.</returns>
|
||||
@@ -4668,6 +4999,7 @@
|
||||
<summary>
|
||||
Request a free license for given appids, can be used for free on demand apps
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamApps.FreeLicenseCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="apps">The apps to request a free license for.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamApps.FreeLicenseCallback"/>.</returns>
|
||||
@@ -5027,6 +5359,54 @@
|
||||
</summary>
|
||||
<value>The message.</value>
|
||||
</member>
|
||||
<member name="T:SteamKit2.SteamFriends.FriendMsgHistoryCallback">
|
||||
<summary>
|
||||
<para>This callback is fired in response to receiving historical messages.</para>
|
||||
See also <seealso cref="M:SteamKit2.SteamFriends.RequestOfflineMessages"/> and
|
||||
<seealso cref="M:SteamKit2.SteamFriends.RequestMessageHistory(SteamKit2.SteamID)"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamFriends.FriendMsgHistoryCallback.Result">
|
||||
<summary>
|
||||
Gets the result of the request.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamFriends.FriendMsgHistoryCallback.SteamID">
|
||||
<summary>
|
||||
Gets the SteamID of the user with whom these messages were exchanged.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamFriends.FriendMsgHistoryCallback.Messages">
|
||||
<summary>
|
||||
The messages exchanged with the user.
|
||||
Offline messages are marked by having set <see cref="P:SteamKit2.SteamFriends.FriendMsgHistoryCallback.FriendMessage.Unread"/> to <c>true</c>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:SteamKit2.SteamFriends.FriendMsgHistoryCallback.FriendMessage">
|
||||
<summary>
|
||||
Represents a single Message sent to or received from a friend
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamFriends.FriendMsgHistoryCallback.FriendMessage.SteamID">
|
||||
<summary>
|
||||
The SteamID of the User that wrote the message
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamFriends.FriendMsgHistoryCallback.FriendMessage.Unread">
|
||||
<summary>
|
||||
Whether or not the message has been read, i.e., is an offline message.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamFriends.FriendMsgHistoryCallback.FriendMessage.Message">
|
||||
<summary>
|
||||
The actual message
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamFriends.FriendMsgHistoryCallback.FriendMessage.Timestamp">
|
||||
<summary>
|
||||
The time (in UTC) when the message was sent
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:SteamKit2.SteamFriends.FriendAddedCallback">
|
||||
<summary>
|
||||
This callback is fired in response to adding a user to your friends list.
|
||||
@@ -5345,6 +5725,7 @@
|
||||
<summary>
|
||||
Sets the local user's persona name and broadcasts it over the network.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamFriends.PersonaChangeCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="name">The name.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamFriends.PersonaChangeCallback"/>.</returns>
|
||||
@@ -5359,6 +5740,7 @@
|
||||
<summary>
|
||||
Sets the local user's persona state and broadcasts it over the network.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamFriends.PersonaChangeCallback"/> callback.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="state">The state.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamFriends.PersonaChangeCallback"/>.</returns>
|
||||
@@ -5547,6 +5929,7 @@
|
||||
<summary>
|
||||
Ignores or unignores a friend on Steam.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamFriends.IgnoreFriendCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="steamId">The SteamID of the friend to ignore or unignore.</param>
|
||||
<param name="setIgnore">if set to <c>true</c>, the friend will be ignored; otherwise, they will be unignored.</param>
|
||||
@@ -5556,10 +5939,25 @@
|
||||
<summary>
|
||||
Requests profile information for the given <see cref="T:SteamKit2.SteamID"/>.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamFriends.ProfileInfoCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<param name="steamId">The SteamID of the friend to request the details of.</param>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamFriends.ProfileInfoCallback"/>.</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamFriends.RequestMessageHistory(SteamKit2.SteamID)">
|
||||
<summary>
|
||||
Requests the last few chat messages with a friend.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamFriends.FriendMsgHistoryCallback"/>
|
||||
</summary>
|
||||
<param name="steamId">SteamID of the friend</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamFriends.RequestOfflineMessages">
|
||||
<summary>
|
||||
Requests all offline messages.
|
||||
This also marks them as read server side.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamFriends.FriendMsgHistoryCallback"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamFriends.HandleMsg(SteamKit2.IPacketMsg)">
|
||||
<summary>
|
||||
Handles a client message. This should not be called directly.
|
||||
@@ -5920,6 +6318,18 @@
|
||||
</summary>
|
||||
<value>The CellID.</value>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamUser.LogOnDetails.LoginID">
|
||||
<summary>
|
||||
Gets or sets the LoginID. This number is used for identifying logon session.
|
||||
The purpose of this field is to allow multiple sessions to the same steam account from the same machine.
|
||||
This is because Steam Network doesn't allow more than one session with the same LoginID to access given account at the same time.
|
||||
If you want to establish more than one active session to given account, you must make sure that every session (to that account) has unique LoginID.
|
||||
By default LoginID is automatically generated based on machine's primary bind address, which is the same for all sessions.
|
||||
Null value will cause this property to be automatically generated based on default behaviour.
|
||||
If in doubt, set this property to null.
|
||||
</summary>
|
||||
<value>The LoginID.</value>
|
||||
</member>
|
||||
<member name="P:SteamKit2.SteamUser.LogOnDetails.AuthCode">
|
||||
<summary>
|
||||
Gets or sets the Steam Guard auth code used to login. This is the code sent to the user's email.
|
||||
@@ -6139,9 +6549,8 @@
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamUser.LogOff">
|
||||
<summary>
|
||||
Logs the user off of the Steam3 network.
|
||||
This method does not disconnect the client.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamUser.LoggedOffCallback"/>.
|
||||
Informs the Steam servers that this client wishes to log off from the network.
|
||||
The Steam server will disconnect the client, and a <see cref="T:SteamKit2.SteamClient.DisconnectedCallback"/> will be posted.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.SteamUser.SendMachineAuthResponse(SteamKit2.SteamUser.MachineAuthDetails)">
|
||||
@@ -6155,6 +6564,7 @@
|
||||
<summary>
|
||||
Requests a new WebAPI authentication user nonce.
|
||||
Results are returned in a <see cref="T:SteamKit2.SteamUser.WebAPIUserNonceCallback"/>.
|
||||
The returned <see cref="T:SteamKit2.AsyncJob`1"/> can also be awaited to retrieve the callback result.
|
||||
</summary>
|
||||
<returns>The Job ID of the request. This can be used to find the appropriate <see cref="T:SteamKit2.SteamUser.WebAPIUserNonceCallback"/>.</returns>
|
||||
</member>
|
||||
@@ -6181,37 +6591,6 @@
|
||||
then this will be <see cref="P:JobID.Invalid"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:SteamKit2.CallbackMsgExtensions">
|
||||
<summary>
|
||||
Useful extensions for ICallbackMsg
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.CallbackMsgExtensions.IsType``1(SteamKit2.ICallbackMsg)">
|
||||
<summary>
|
||||
Determines whether this callback is a certain type.
|
||||
</summary>
|
||||
<typeparam name="T">The type to check against.</typeparam>
|
||||
<returns>
|
||||
<c>true</c> if this callback is the type specified; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<exception cref="T:System.ArgumentNullException">
|
||||
<c>msg</c> is null.
|
||||
</exception>
|
||||
</member>
|
||||
<member name="M:SteamKit2.CallbackMsgExtensions.Handle``1(SteamKit2.ICallbackMsg,System.Action{``0})">
|
||||
<summary>
|
||||
Invokes the specified handler delegate if the callback matches the type parameter.
|
||||
</summary>
|
||||
<typeparam name="T">The type to check against.</typeparam>
|
||||
<param name="msg">The callback in question.</param>
|
||||
<param name="handler">The handler to invoke.</param>
|
||||
<returns>
|
||||
<c>true</c> if the callback matches and the handler was called; otherwise, <c>false</c>.
|
||||
</returns>
|
||||
<exception cref="T:System.ArgumentNullException">
|
||||
<c>msg</c> is null or <c>handler</c> is null.
|
||||
</exception>
|
||||
</member>
|
||||
<member name="T:SteamKit2.CallbackMsg">
|
||||
<summary>
|
||||
Represents the base object all callbacks are based off.
|
||||
@@ -6394,6 +6773,13 @@
|
||||
Gets the underlying <see cref="T:SteamKit2.SteamClient"/> for use in sending replies.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SteamKit2.ClientMsgHandler.ExpectDisconnection">
|
||||
<summary>
|
||||
Gets or sets whether or not the related <see cref="T:SteamKit2.SteamClient" /> should imminently expect the server to close the connection.
|
||||
If this is true when the connection is closed, the <see cref="T:SteamKit2.SteamClient.DisconnectedCallback"/>'s <see cref="P:SteamKit2.SteamClient.DisconnectedCallback.UserInitiated"/> property
|
||||
will be set to <c>true</c>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.ClientMsgHandler.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:SteamKit2.ClientMsgHandler"/> class.
|
||||
@@ -7104,11 +7490,11 @@
|
||||
</summary>
|
||||
<param name="packet">The packet.</param>
|
||||
</member>
|
||||
<member name="M:SteamKit2.UdpConnection.SetNetEncryptionFilter(SteamKit2.NetFilterEncryption)">
|
||||
<member name="M:SteamKit2.UdpConnection.SetNetEncryptionFilter(SteamKit2.INetFilterEncryption)">
|
||||
<summary>
|
||||
Sets the network encryption filter for this connection
|
||||
</summary>
|
||||
<param name="filter">filter implementing <see cref="T:SteamKit2.NetFilterEncryption"/></param>
|
||||
<param name="filter">filter implementing <see cref="T:SteamKit2.INetFilterEncryption"/></param>
|
||||
</member>
|
||||
<member name="T:SteamKit2.NetMsgEventArgs">
|
||||
<summary>
|
||||
@@ -7166,11 +7552,11 @@
|
||||
</summary>
|
||||
<returns>The local IP.</returns>
|
||||
</member>
|
||||
<member name="M:SteamKit2.Connection.SetNetEncryptionFilter(SteamKit2.NetFilterEncryption)">
|
||||
<member name="M:SteamKit2.Connection.SetNetEncryptionFilter(SteamKit2.INetFilterEncryption)">
|
||||
<summary>
|
||||
Sets the network encryption filter for this connection
|
||||
</summary>
|
||||
<param name="filter">filter implementing <see cref="T:SteamKit2.NetFilterEncryption"/></param>
|
||||
<param name="filter">filter implementing <see cref="T:SteamKit2.INetFilterEncryption"/></param>
|
||||
</member>
|
||||
<member name="T:SteamKit2.KeyDictionary">
|
||||
<summary>
|
||||
@@ -7229,16 +7615,36 @@
|
||||
Decrypts an input byte array using AES/CBC/PKCS7 with a given key and IV
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.CryptoHelper.SymmetricEncryptWithIV(System.Byte[],System.Byte[],System.Byte[])">
|
||||
<summary>
|
||||
Performs an encryption using AES/CBC/PKCS7 with an input byte array and key, with a random IV prepended using AES/ECB/None
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.CryptoHelper.SymmetricEncrypt(System.Byte[],System.Byte[])">
|
||||
<summary>
|
||||
Performs an encryption using AES/CBC/PKCS7 with an input byte array and key, with a random IV prepended using AES/ECB/None
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.CryptoHelper.SymmetricEncryptWithHMACIV(System.Byte[],System.Byte[],System.Byte[])">
|
||||
<summary>
|
||||
Performs an encryption using AES/CBC/PKCS7 with an input byte array and key, with a IV (comprised of random bytes and the HMAC-SHA1 of the random bytes and plaintext) prepended using AES/ECB/None
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.CryptoHelper.SymmetricDecrypt(System.Byte[],System.Byte[])">
|
||||
<summary>
|
||||
Decrypts using AES/CBC/PKCS7 with an input byte array and key, using the random IV prepended using AES/ECB/None
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.CryptoHelper.SymmetricDecryptHMACIV(System.Byte[],System.Byte[],System.Byte[])">
|
||||
<summary>
|
||||
Decrypts using AES/CBC/PKCS7 with an input byte array and key, using the IV (comprised of random bytes and the HMAC-SHA1 of the random bytes and plaintext) prepended using AES/ECB/None
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.CryptoHelper.SymmetricDecrypt(System.Byte[],System.Byte[],System.Byte[]@)">
|
||||
<summary>
|
||||
Decrypts using AES/CBC/PKCS7 with an input byte array and key, using the random IV prepended using AES/ECB/None
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:SteamKit2.CryptoHelper.VerifyAndDecryptPassword(System.Byte[],System.String)">
|
||||
<summary>
|
||||
Verifies and performs a symmetricdecrypt on the input using the given password as a key
|
||||
@@ -1,3 +1,30 @@
|
||||
------------------------------------------------------------------------------
|
||||
v 1.7.0 Dec 21, 2015
|
||||
------------------------------------------------------------------------------
|
||||
* Added awaitable API for job-based messages. APIs which returned a `JobID` now return an `AsyncJob<>`, which can be used to asynchronously await for results. (pr #170)
|
||||
* Added `SteamApps.PICSGetAccessTokens` overload with singular parameters. (pr #190)
|
||||
* Added `SteamFriends.RequestMessageHistory` and `SteamFriends.RequestOfflineMessages` (pr #193)
|
||||
* Added the ability to connect to Developer instances of Steam (`EUniverse.Dev`). If anyone at Valve is using this internally, hi!
|
||||
* Added the ability to set a `LoginID` in `SteamUser.LogOnDetails` so that multiple instances can connect from the same host concurrenctly. (pr #217)
|
||||
* Added `SteamClient.DebugNetworkListener` API to intercept and log raw messages. (pr #204)
|
||||
* Added the ability to dump messages in NetHook2 format for debugging purposes. (pr #204)
|
||||
* Upgraded the encryption protocol used to communicate with the Steam servers.
|
||||
* Implemented protection against man-in-the-middle attacks. (pr #214)
|
||||
* Server List will now maintain ordering from Steam, increasing the chances of a successful and geographically local connection. (pr #218)
|
||||
* After calling `SteamUser.LogOff` or `SteamGameServer.LogOff`, `SteamClient.DisconnectedCallback.UserInitiated` will be `true`. (pr #205)
|
||||
* Fixed a crash when parsing a Steam ID of the format '[i:1:234]'.
|
||||
* Fixed a crash when logging on in an enviromnent where the hard disk has no serial ID, such as Hyper-V.
|
||||
* Fixed a bug when parsing a KeyValue file that contains a `/` followed by a newline. (pr #187)
|
||||
* Updated Steam enums and protobufs.
|
||||
* Updated game-related GC messages and protobufs.
|
||||
|
||||
BREAKING CHANGES
|
||||
* SteamKit2 now requires .NET 4.5 or equivalent (Mono 3.0), or higher.
|
||||
* Removed obsoleted `ICallbackMsg` extension methods `IsType<>` and `Handle<>`. (pr #221)
|
||||
* Game Coordinator base messages are now generated per-game, instead of relying on Dota 2. GC messages should use the base messages for their game, which is separated by namespace. (pr #180)
|
||||
* Cell IDs are now consistently `uint`s within `SteamDirectory`.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
v 1.6.5 Oct 17, 2015
|
||||
------------------------------------------------------------------------------
|
||||
Binary file not shown.
BIN
tools/ILRepack.exe
Normal file
BIN
tools/ILRepack.exe
Normal file
Binary file not shown.
BIN
tools/NetHook2.dll
Normal file
BIN
tools/NetHook2.dll
Normal file
Binary file not shown.
BIN
tools/NetHookAnalyzer2.exe
Normal file
BIN
tools/NetHookAnalyzer2.exe
Normal file
Binary file not shown.
1
tools/hook.bat
Normal file
1
tools/hook.bat
Normal file
@@ -0,0 +1 @@
|
||||
rundll32 NetHook2.dll,Inject
|
||||
1
tools/unhook.bat
Normal file
1
tools/unhook.bat
Normal file
@@ -0,0 +1 @@
|
||||
rundll32 NetHook2.dll,Eject
|
||||
Reference in New Issue
Block a user