mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
Misc
This commit is contained in:
@@ -64,7 +64,7 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int index = hashName.IndexOf('-');
|
int index = hashName.IndexOf('-');
|
||||||
if (index < 1) {
|
if (index <= 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
SteamID = steamID;
|
SteamID = steamID;
|
||||||
|
|
||||||
string sessionID = Convert.ToBase64String(Encoding.UTF8.GetBytes(SteamID.ToString()));
|
string sessionID = Convert.ToBase64String(Encoding.UTF8.GetBytes(steamID.ToString()));
|
||||||
|
|
||||||
// Generate an AES session key
|
// Generate an AES session key
|
||||||
byte[] sessionKey = SteamKit2.CryptoHelper.GenerateRandomBlock(32);
|
byte[] sessionKey = SteamKit2.CryptoHelper.GenerateRandomBlock(32);
|
||||||
@@ -151,7 +151,7 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
authResult = iSteamUserAuth.AuthenticateUser(
|
authResult = iSteamUserAuth.AuthenticateUser(
|
||||||
steamid: SteamID,
|
steamid: steamID,
|
||||||
sessionkey: Encoding.ASCII.GetString(WebUtility.UrlEncodeToBytes(cryptedSessionKey, 0, cryptedSessionKey.Length)),
|
sessionkey: Encoding.ASCII.GetString(WebUtility.UrlEncodeToBytes(cryptedSessionKey, 0, cryptedSessionKey.Length)),
|
||||||
encrypted_loginkey: Encoding.ASCII.GetString(WebUtility.UrlEncodeToBytes(cryptedLoginKey, 0, cryptedLoginKey.Length)),
|
encrypted_loginkey: Encoding.ASCII.GetString(WebUtility.UrlEncodeToBytes(cryptedLoginKey, 0, cryptedLoginKey.Length)),
|
||||||
method: WebRequestMethods.Http.Post,
|
method: WebRequestMethods.Http.Post,
|
||||||
@@ -892,7 +892,6 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string request = SteamCommunityURL + "/my/badges?l=english&p=" + page;
|
string request = SteamCommunityURL + "/my/badges?l=english&p=" + page;
|
||||||
|
|
||||||
return await WebBrowser.UrlGetToHtmlDocumentRetry(request).ConfigureAwait(false);
|
return await WebBrowser.UrlGetToHtmlDocumentRetry(request).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -907,7 +906,6 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string request = SteamCommunityURL + "/my/gamecards/" + appID + "?l=english";
|
string request = SteamCommunityURL + "/my/gamecards/" + appID + "?l=english";
|
||||||
|
|
||||||
return await WebBrowser.UrlGetToHtmlDocumentRetry(request).ConfigureAwait(false);
|
return await WebBrowser.UrlGetToHtmlDocumentRetry(request).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -917,7 +915,6 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string request = SteamCommunityURL + "/my/inventory";
|
string request = SteamCommunityURL + "/my/inventory";
|
||||||
|
|
||||||
return await WebBrowser.UrlHeadRetry(request).ConfigureAwait(false);
|
return await WebBrowser.UrlHeadRetry(request).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,15 +63,17 @@ namespace ArchiSteamFarm.JSON {
|
|||||||
|
|
||||||
set {
|
set {
|
||||||
if (string.IsNullOrEmpty(value)) {
|
if (string.IsNullOrEmpty(value)) {
|
||||||
|
Logging.LogNullError(nameof(value));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint result;
|
uint appID;
|
||||||
if (!uint.TryParse(value, out result)) {
|
if (!uint.TryParse(value, out appID) || (appID == 0)) {
|
||||||
|
Logging.LogNullError(nameof(appID));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AppID = result;
|
AppID = appID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,15 +88,17 @@ namespace ArchiSteamFarm.JSON {
|
|||||||
|
|
||||||
set {
|
set {
|
||||||
if (string.IsNullOrEmpty(value)) {
|
if (string.IsNullOrEmpty(value)) {
|
||||||
|
Logging.LogNullError(nameof(value));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong result;
|
ulong contextID;
|
||||||
if (!ulong.TryParse(value, out result)) {
|
if (!ulong.TryParse(value, out contextID) || (contextID == 0)) {
|
||||||
|
Logging.LogNullError(nameof(contextID));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContextID = result;
|
ContextID = contextID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +216,6 @@ namespace ArchiSteamFarm.JSON {
|
|||||||
|
|
||||||
internal sealed class TradeOffer { // REF: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService#CEcon_TradeOffer
|
internal sealed class TradeOffer { // REF: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService#CEcon_TradeOffer
|
||||||
// Constructed from code
|
// Constructed from code
|
||||||
|
|
||||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||||
internal enum ETradeOfferState : byte {
|
internal enum ETradeOfferState : byte {
|
||||||
Unknown,
|
Unknown,
|
||||||
@@ -230,7 +233,6 @@ namespace ArchiSteamFarm.JSON {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal readonly ulong TradeOfferID;
|
internal readonly ulong TradeOfferID;
|
||||||
|
|
||||||
internal readonly ETradeOfferState State;
|
internal readonly ETradeOfferState State;
|
||||||
internal readonly HashSet<Item> ItemsToGive = new HashSet<Item>();
|
internal readonly HashSet<Item> ItemsToGive = new HashSet<Item>();
|
||||||
internal readonly HashSet<Item> ItemsToReceive = new HashSet<Item>();
|
internal readonly HashSet<Item> ItemsToReceive = new HashSet<Item>();
|
||||||
|
|||||||
Reference in New Issue
Block a user