mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 22:40:30 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3aa881f55 | ||
|
|
33a1fdf556 | ||
|
|
0c848ec366 | ||
|
|
21d4e46b81 |
@@ -30,17 +30,23 @@ using SteamKit2;
|
|||||||
namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper.Data;
|
namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper.Data;
|
||||||
|
|
||||||
internal sealed class SubmitRequest {
|
internal sealed class SubmitRequest {
|
||||||
|
private readonly ulong SteamID;
|
||||||
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("guid")]
|
[JsonPropertyName("guid")]
|
||||||
private static string Guid => ASF.GlobalDatabase?.Identifier.ToString("N") ?? throw new InvalidOperationException(nameof(ASF.GlobalDatabase.Identifier));
|
private string Guid => ASF.GlobalDatabase?.Identifier.ToString("N") ?? throw new InvalidOperationException(nameof(ASF.GlobalDatabase.Identifier));
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("steamid")]
|
||||||
|
private string SteamIDText => new SteamID(SteamID).Render();
|
||||||
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("token")]
|
[JsonPropertyName("token")]
|
||||||
private static string Token => SharedInfo.Token;
|
private string Token => SharedInfo.Token;
|
||||||
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("v")]
|
[JsonPropertyName("v")]
|
||||||
private static byte Version => SharedInfo.ApiVersion;
|
private byte Version => SharedInfo.ApiVersion;
|
||||||
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("apps")]
|
[JsonPropertyName("apps")]
|
||||||
@@ -52,17 +58,11 @@ internal sealed class SubmitRequest {
|
|||||||
[JsonRequired]
|
[JsonRequired]
|
||||||
private ImmutableDictionary<string, string> Depots { get; init; }
|
private ImmutableDictionary<string, string> Depots { get; init; }
|
||||||
|
|
||||||
private readonly ulong SteamID;
|
|
||||||
|
|
||||||
[JsonInclude]
|
[JsonInclude]
|
||||||
[JsonPropertyName("subs")]
|
[JsonPropertyName("subs")]
|
||||||
[JsonRequired]
|
[JsonRequired]
|
||||||
private ImmutableDictionary<string, string> Subs { get; init; }
|
private ImmutableDictionary<string, string> Subs { get; init; }
|
||||||
|
|
||||||
[JsonInclude]
|
|
||||||
[JsonPropertyName("steamid")]
|
|
||||||
private string SteamIDText => new SteamID(SteamID).Render();
|
|
||||||
|
|
||||||
internal SubmitRequest(ulong steamID, IReadOnlyCollection<KeyValuePair<uint, ulong>> apps, IReadOnlyCollection<KeyValuePair<uint, ulong>> accessTokens, IReadOnlyCollection<KeyValuePair<uint, string>> depots) {
|
internal SubmitRequest(ulong steamID, IReadOnlyCollection<KeyValuePair<uint, ulong>> apps, IReadOnlyCollection<KeyValuePair<uint, ulong>> accessTokens, IReadOnlyCollection<KeyValuePair<uint, string>> depots) {
|
||||||
if ((steamID == 0) || !new SteamID(steamID).IsIndividualAccount) {
|
if ((steamID == 0) || !new SteamID(steamID).IsIndividualAccount) {
|
||||||
throw new ArgumentOutOfRangeException(nameof(steamID));
|
throw new ArgumentOutOfRangeException(nameof(steamID));
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper;
|
|||||||
internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotCommand2, IBotSteamClient, ISteamPICSChanges {
|
internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotCommand2, IBotSteamClient, ISteamPICSChanges {
|
||||||
private const ushort DepotsRateLimitingDelay = 500;
|
private const ushort DepotsRateLimitingDelay = 500;
|
||||||
|
|
||||||
[JsonInclude]
|
|
||||||
internal static SteamTokenDumperConfig? Config { get; private set; }
|
internal static SteamTokenDumperConfig? Config { get; private set; }
|
||||||
|
|
||||||
private static readonly ConcurrentDictionary<Bot, IDisposable> BotSubscriptions = new();
|
private static readonly ConcurrentDictionary<Bot, IDisposable> BotSubscriptions = new();
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ public static class JsonUtilities {
|
|||||||
public static readonly JsonSerializerOptions IndentedJsonSerialierOptions = CreateDefaultJsonSerializerOptions(true);
|
public static readonly JsonSerializerOptions IndentedJsonSerialierOptions = CreateDefaultJsonSerializerOptions(true);
|
||||||
|
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public static JsonElement ToJsonElement<T>(this T obj, bool writeIndented = false) where T : notnull {
|
public static JsonElement ToJsonElement<T>(this T obj) where T : notnull {
|
||||||
ArgumentNullException.ThrowIfNull(obj);
|
ArgumentNullException.ThrowIfNull(obj);
|
||||||
|
|
||||||
return JsonSerializer.SerializeToElement(obj, writeIndented ? IndentedJsonSerialierOptions : DefaultJsonSerialierOptions);
|
return JsonSerializer.SerializeToElement(obj, DefaultJsonSerialierOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Text.Json;
|
||||||
using ArchiSteamFarm.Core;
|
using ArchiSteamFarm.Core;
|
||||||
using ArchiSteamFarm.Helpers.Json;
|
using ArchiSteamFarm.Helpers.Json;
|
||||||
using ArchiSteamFarm.IPC.Integration;
|
using ArchiSteamFarm.IPC.Integration;
|
||||||
@@ -328,8 +329,11 @@ internal sealed class Startup {
|
|||||||
|
|
||||||
mvc.AddJsonOptions(
|
mvc.AddJsonOptions(
|
||||||
static options => {
|
static options => {
|
||||||
options.JsonSerializerOptions.PropertyNamingPolicy = JsonUtilities.DefaultJsonSerialierOptions.PropertyNamingPolicy;
|
JsonSerializerOptions jsonSerializerOptions = Debugging.IsUserDebugging ? JsonUtilities.IndentedJsonSerialierOptions : JsonUtilities.DefaultJsonSerialierOptions;
|
||||||
options.JsonSerializerOptions.TypeInfoResolver = JsonUtilities.DefaultJsonSerialierOptions.TypeInfoResolver;
|
|
||||||
|
options.JsonSerializerOptions.PropertyNamingPolicy = jsonSerializerOptions.PropertyNamingPolicy;
|
||||||
|
options.JsonSerializerOptions.TypeInfoResolver = jsonSerializerOptions.TypeInfoResolver;
|
||||||
|
options.JsonSerializerOptions.WriteIndented = jsonSerializerOptions.WriteIndented;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>6.0.0.0</Version>
|
<Version>6.0.0.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user