Convert to new namespace stuff and implicit usings
This commit is contained in:
@@ -3,10 +3,10 @@ using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Prospect.Launcher.Invoke;
|
||||
|
||||
namespace Prospect.Launcher
|
||||
namespace Prospect.Launcher;
|
||||
|
||||
public static class Inject
|
||||
{
|
||||
public static class Inject
|
||||
{
|
||||
const int PROCESS_CREATE_THREAD = 0x0002;
|
||||
const int PROCESS_QUERY_INFORMATION = 0x0400;
|
||||
const int PROCESS_VM_OPERATION = 0x0008;
|
||||
@@ -52,5 +52,4 @@ namespace Prospect.Launcher
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using Prospect.Launcher.Invoke.Structs;
|
||||
|
||||
namespace Prospect.Launcher.Invoke
|
||||
namespace Prospect.Launcher.Invoke;
|
||||
|
||||
internal static class Kernel32
|
||||
{
|
||||
internal static class Kernel32
|
||||
{
|
||||
[DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Auto)]
|
||||
public static extern bool CreateProcess(string lpApplicationName,
|
||||
string lpCommandLine, IntPtr lpProcessAttributes,
|
||||
@@ -49,5 +49,4 @@ namespace Prospect.Launcher.Invoke
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
public static extern uint ResumeThread(IntPtr hThread);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Prospect.Launcher.Invoke.Structs
|
||||
namespace Prospect.Launcher.Invoke.Structs;
|
||||
|
||||
[Flags]
|
||||
internal enum ProcessCreationFlags : uint
|
||||
{
|
||||
[Flags]
|
||||
internal enum ProcessCreationFlags : uint
|
||||
{
|
||||
ZERO_FLAG = 0x00000000,
|
||||
CREATE_BREAKAWAY_FROM_JOB = 0x01000000,
|
||||
CREATE_DEFAULT_ERROR_MODE = 0x04000000,
|
||||
@@ -22,5 +22,4 @@ namespace Prospect.Launcher.Invoke.Structs
|
||||
DETACHED_PROCESS = 0x00000008,
|
||||
EXTENDED_STARTUPINFO_PRESENT = 0x00080000,
|
||||
INHERIT_PARENT_AFFINITY = 0x00010000
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Prospect.Launcher.Invoke.Structs
|
||||
namespace Prospect.Launcher.Invoke.Structs;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct ProcessInformation
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct ProcessInformation
|
||||
{
|
||||
public IntPtr hProcess;
|
||||
public IntPtr hThread;
|
||||
public uint dwProcessId;
|
||||
public uint dwThreadId;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Prospect.Launcher.Invoke.Structs
|
||||
namespace Prospect.Launcher.Invoke.Structs;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct StartupInfo
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct StartupInfo
|
||||
{
|
||||
public uint cb;
|
||||
public string lpReserved;
|
||||
public string lpDesktop;
|
||||
@@ -24,5 +24,4 @@ namespace Prospect.Launcher.Invoke.Structs
|
||||
public IntPtr hStdInput;
|
||||
public IntPtr hStdOutput;
|
||||
public IntPtr hStdError;
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,10 @@ using System.IO;
|
||||
using Prospect.Launcher.Invoke;
|
||||
using Prospect.Launcher.Invoke.Structs;
|
||||
|
||||
namespace Prospect.Launcher
|
||||
namespace Prospect.Launcher;
|
||||
|
||||
internal static class Program
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Steam AppId.
|
||||
/// - https://steamdb.info/app/480/
|
||||
@@ -74,5 +74,4 @@ namespace Prospect.Launcher
|
||||
|
||||
Console.WriteLine("Resumed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
namespace Prospect.Server.Api.Config
|
||||
namespace Prospect.Server.Api.Config;
|
||||
|
||||
public class DatabaseSettings
|
||||
{
|
||||
public class DatabaseSettings
|
||||
{
|
||||
public string ConnectionString { get; set; }
|
||||
public string DatabaseName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
namespace Prospect.Server.Api.Config
|
||||
namespace Prospect.Server.Api.Config;
|
||||
|
||||
public class PlayFabSettings
|
||||
{
|
||||
public class PlayFabSettings
|
||||
{
|
||||
public string PublisherId { get; set; }
|
||||
public string TitleId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Prospect.Server.Api.Config;
|
||||
@@ -15,12 +12,15 @@ using Prospect.Server.Api.Services.Database.Models;
|
||||
using Prospect.Server.Api.Services.UserData;
|
||||
using Prospect.Server.Steam;
|
||||
|
||||
namespace Prospect.Server.Api.Controllers
|
||||
namespace Prospect.Server.Api.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("Client")]
|
||||
public class ClientController : Controller
|
||||
{
|
||||
[ApiController]
|
||||
[Route("Client")]
|
||||
public class ClientController : Controller
|
||||
{
|
||||
private const int AppIdDefault = 480;
|
||||
private const int AppIdCycleBeta = 1600361;
|
||||
|
||||
private readonly PlayFabSettings _settings;
|
||||
private readonly AuthTokenService _authTokenService;
|
||||
private readonly DbUserService _userService;
|
||||
@@ -51,7 +51,7 @@ namespace Prospect.Server.Api.Controllers
|
||||
if (!string.IsNullOrEmpty(request.SteamTicket))
|
||||
{
|
||||
var ticket = AppTicket.Parse(request.SteamTicket);
|
||||
if (ticket.IsValid && ticket.HasValidSignature)
|
||||
if (ticket.IsValid && ticket.HasValidSignature && (ticket.AppId == AppIdDefault || ticket.AppId == AppIdCycleBeta))
|
||||
{
|
||||
var userSteamId = ticket.SteamId.ToString();
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Prospect.Server.Api.Controllers
|
||||
{
|
||||
Code = 200,
|
||||
Status = "OK",
|
||||
Data = new object()
|
||||
Data = new {}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -266,5 +266,4 @@ namespace Prospect.Server.Api.Controllers
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Prospect.Server.Api.Models.Client;
|
||||
using Prospect.Server.Api.Models.CloudScript;
|
||||
using Prospect.Server.Api.Models.CloudScript.Data;
|
||||
using Prospect.Server.Api.Services.Auth.Entity;
|
||||
using Prospect.Server.Api.Services.Auth.Extensions;
|
||||
|
||||
namespace Prospect.Server.Api.Controllers
|
||||
namespace Prospect.Server.Api.Controllers;
|
||||
|
||||
[Route("CloudScript")]
|
||||
[ApiController]
|
||||
[Authorize(AuthenticationSchemes = EntityAuthenticationOptions.DefaultScheme)]
|
||||
public class CloudScriptController : Controller
|
||||
{
|
||||
[Route("CloudScript")]
|
||||
[ApiController]
|
||||
[Authorize(AuthenticationSchemes = EntityAuthenticationOptions.DefaultScheme)]
|
||||
public class CloudScriptController : Controller
|
||||
{
|
||||
private readonly ILogger<CloudScriptController> _logger;
|
||||
|
||||
public CloudScriptController(ILogger<CloudScriptController> logger)
|
||||
@@ -302,5 +299,4 @@ namespace Prospect.Server.Api.Controllers
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,14 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Converters
|
||||
namespace Prospect.Server.Api.Converters;
|
||||
|
||||
// By default System.Text.Json outputs and we want:
|
||||
// Output: 2021-11-04T04:58:20.4232184Z
|
||||
// Want : 2021-10-24T02:54:56.652Z
|
||||
public class DateTimeConverter : JsonConverter<DateTime>
|
||||
{
|
||||
// By default System.Text.Json outputs and we want:
|
||||
// Output: 2021-11-04T04:58:20.4232184Z
|
||||
// Want : 2021-10-24T02:54:56.652Z
|
||||
public class DateTimeConverter : JsonConverter<DateTime>
|
||||
{
|
||||
public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
Debug.Assert(typeToConvert == typeof(DateTime));
|
||||
@@ -20,5 +19,4 @@ namespace Prospect.Server.Api.Converters
|
||||
{
|
||||
writer.WriteStringValue(value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Exceptions
|
||||
namespace Prospect.Server.Api.Exceptions;
|
||||
|
||||
public class ProspectException : Exception
|
||||
{
|
||||
public class ProspectException : Exception
|
||||
{
|
||||
public ProspectException()
|
||||
{
|
||||
}
|
||||
@@ -20,5 +19,4 @@ namespace Prospect.Server.Api.Exceptions
|
||||
public ProspectException(string message, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,11 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Http.Extensions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Prospect.Server.Api.Middleware
|
||||
namespace Prospect.Server.Api.Middleware;
|
||||
|
||||
public class RequestLoggerMiddleware
|
||||
{
|
||||
public class RequestLoggerMiddleware
|
||||
{
|
||||
private readonly ILogger<RequestLoggerMiddleware> _logger;
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
@@ -60,5 +56,4 @@ namespace Prospect.Server.Api.Middleware
|
||||
request.Body.Position = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class ClientLoginWithSteamRequest
|
||||
{
|
||||
public class ClientLoginWithSteamRequest
|
||||
{
|
||||
[JsonPropertyName("CreateAccount")]
|
||||
public bool CreateAccount { get; set; }
|
||||
|
||||
@@ -22,10 +22,10 @@ namespace Prospect.Server.Api.Models.Client
|
||||
|
||||
[JsonPropertyName("SteamTicket")]
|
||||
public string SteamTicket { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class InfoParameters
|
||||
{
|
||||
public class InfoParameters
|
||||
{
|
||||
[JsonPropertyName("GetCharacterInventories")]
|
||||
public bool GetCharacterInventories { get; set; }
|
||||
|
||||
@@ -55,5 +55,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
|
||||
[JsonPropertyName("GetUserVirtualCurrency")]
|
||||
public bool GetUserVirtualCurrency { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class ClientResponse
|
||||
{
|
||||
public class ClientResponse
|
||||
{
|
||||
[JsonPropertyName("code")]
|
||||
public int Code { get; set; }
|
||||
|
||||
@@ -21,12 +21,11 @@ namespace Prospect.Server.Api.Models.Client
|
||||
[JsonPropertyName("errorMessage")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public string ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class ClientResponse<T> : ClientResponse
|
||||
{
|
||||
public class ClientResponse<T> : ClientResponse
|
||||
{
|
||||
[JsonPropertyName("data")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public enum CloudScriptRevisionOption
|
||||
{
|
||||
public enum CloudScriptRevisionOption
|
||||
{
|
||||
Live,
|
||||
Latest,
|
||||
Specific
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FEntityKey
|
||||
{
|
||||
public class FEntityKey
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique ID of the entity.
|
||||
/// </summary>
|
||||
@@ -19,5 +19,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
// Not in PlayFab SDK
|
||||
[JsonPropertyName("TypeString")]
|
||||
public string TypeString { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FEntityTokenResponse
|
||||
{
|
||||
public class FEntityTokenResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] The entity id and type.
|
||||
/// </summary>
|
||||
@@ -25,5 +24,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
[JsonPropertyName("TokenExpiration")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public DateTime? TokenExpiration { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FFunctionExecutionError
|
||||
{
|
||||
public class FFunctionExecutionError
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] Error code, such as CloudScriptAzureFunctionsExecutionTimeLimitExceeded, CloudScriptAzureFunctionsArgumentSizeExceeded,
|
||||
/// CloudScriptAzureFunctionsReturnSizeExceeded or CloudScriptAzureFunctionsHTTPRequestError
|
||||
@@ -25,5 +25,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
[JsonPropertyName("StackTrace")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public string StackTrace { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FGenericServiceId
|
||||
{
|
||||
public class FGenericServiceId
|
||||
{
|
||||
/// <summary>
|
||||
/// Name of the service for which the player has a unique identifier.
|
||||
/// </summary>
|
||||
@@ -15,5 +15,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
/// </summary>
|
||||
[JsonPropertyName("UserId")]
|
||||
public string UserId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FGetPlayerCombinedInfoResultPayload
|
||||
{
|
||||
public class FGetPlayerCombinedInfoResultPayload
|
||||
{
|
||||
// TSharedPtr<FUserAccountInfo> AccountInfo;
|
||||
|
||||
/// <summary>
|
||||
@@ -56,5 +55,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
// TMap<FString, int32> UserVirtualCurrency;
|
||||
|
||||
// TMap<FString, FVirtualCurrencyRechargeTime> UserVirtualCurrencyRechargeTimes;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FItemInstance
|
||||
{
|
||||
public class FItemInstance
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] Game specific comment associated with this instance when it was added to the user inventory.
|
||||
/// </summary>
|
||||
@@ -112,5 +110,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
[JsonPropertyName("UsesIncrementedBy")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public int? UsesIncrementedBy { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FLogStatement
|
||||
{
|
||||
public class FLogStatement
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] Optional object accompanying the message as contextual information
|
||||
/// </summary>
|
||||
@@ -24,5 +24,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
[JsonPropertyName("Message")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FPlayerProfileModel
|
||||
{
|
||||
public class FPlayerProfileModel
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] Player display name
|
||||
/// </summary>
|
||||
@@ -31,5 +31,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
[JsonPropertyName("TitleId")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public string TitleId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FScriptExecutionError
|
||||
{
|
||||
public class FScriptExecutionError
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded,
|
||||
/// CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError
|
||||
@@ -25,5 +25,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
[JsonPropertyName("StackTrace")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public string StackTrace { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FTreatmentAssignment
|
||||
{
|
||||
public class FTreatmentAssignment
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] List of the experiment variables.
|
||||
/// </summary>
|
||||
@@ -18,5 +17,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
[JsonPropertyName("Variants")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public List<string> Variants { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FUserDataRecord
|
||||
{
|
||||
public class FUserDataRecord
|
||||
{
|
||||
/// <summary>
|
||||
/// Timestamp for when this data was last updated.
|
||||
/// </summary>
|
||||
@@ -25,5 +24,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
[JsonPropertyName("Value")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FUserSettings
|
||||
{
|
||||
public class FUserSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Boolean for whether this player is eligible for gathering device info.
|
||||
/// </summary>
|
||||
@@ -21,5 +21,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
/// </summary>
|
||||
[JsonPropertyName("NeedsAttribution")]
|
||||
public bool NeedsAttribution { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FVariable
|
||||
{
|
||||
public class FVariable
|
||||
{
|
||||
/// <summary>
|
||||
/// Name of the variable.
|
||||
/// </summary>
|
||||
@@ -16,5 +16,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
[JsonPropertyName("Value")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public class FVirtualCurrencyRechargeTime
|
||||
{
|
||||
public class FVirtualCurrencyRechargeTime
|
||||
{
|
||||
/// <summary>
|
||||
/// Maximum value to which the regenerating currency will automatically increment. Note that it can exceed this value
|
||||
/// through use of the AddUserVirtualCurrency API call. However, it will not regenerate automatically until it has fallen
|
||||
@@ -24,5 +23,4 @@ namespace Prospect.Server.Api.Models.Client.Data
|
||||
/// </summary>
|
||||
[JsonPropertyName("SecondsToRecharge")]
|
||||
public int SecondsToRecharge { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
namespace Prospect.Server.Api.Models.Client.Data
|
||||
namespace Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
public enum UserDataPermission
|
||||
{
|
||||
public enum UserDataPermission
|
||||
{
|
||||
Public,
|
||||
Private
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FAddGenericIDRequest
|
||||
{
|
||||
public class FAddGenericIDRequest
|
||||
{
|
||||
[JsonPropertyName("GenericId")]
|
||||
public FGenericServiceId GenericId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FExecuteCloudScriptResult
|
||||
{
|
||||
public class FExecuteCloudScriptResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of PlayFab API requests issued by the CloudScript function
|
||||
/// </summary>
|
||||
@@ -81,5 +80,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
/// </summary>
|
||||
[JsonPropertyName("Revision")]
|
||||
public int Revision { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FExecuteCloudScriptServerRequest
|
||||
{
|
||||
public class FExecuteCloudScriptServerRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
|
||||
/// </summary>
|
||||
@@ -56,5 +55,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
[JsonPropertyName("SpecificRevision")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public int? SpecificRevision { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FExecuteFunctionRequest
|
||||
{
|
||||
public class FExecuteFunctionRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
|
||||
/// </summary>
|
||||
@@ -40,5 +39,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
[JsonPropertyName("GeneratePlayStreamEvent")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public bool? GeneratePlayStreamEvent { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FExecuteFunctionResult
|
||||
{
|
||||
public class FExecuteFunctionResult
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] Error from the CloudScript Azure Function.
|
||||
/// </summary>
|
||||
@@ -37,5 +37,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
[JsonPropertyName("FunctionResultTooLarge")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public bool? FunctionResultTooLarge { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FGetTitleDataRequest
|
||||
{
|
||||
public class FGetTitleDataRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] Specific keys to search for in the title data (leave null to get all keys)
|
||||
/// </summary>
|
||||
@@ -17,5 +16,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
/// </summary>
|
||||
[JsonPropertyName("OverrideLabel")]
|
||||
public string OverrideLabel { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FGetTitleDataResult
|
||||
{
|
||||
public class FGetTitleDataResult
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] a dictionary object of key / value pairs
|
||||
/// </summary>
|
||||
[JsonPropertyName("Data")]
|
||||
public Dictionary<string, string> Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FGetUserDataRequest
|
||||
{
|
||||
public class FGetUserDataRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] The version that currently exists according to the caller. The call will return the data for all of the keys if the
|
||||
/// version in the system is greater than this.
|
||||
@@ -24,5 +23,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
/// </summary>
|
||||
[JsonPropertyName("PlayFabId")]
|
||||
public string PlayFabId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FGetUserDataResult
|
||||
{
|
||||
public class FGetUserDataResult
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] User specific data for this title.
|
||||
/// </summary>
|
||||
@@ -18,5 +17,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
/// </summary>
|
||||
[JsonPropertyName("DataVersion")]
|
||||
public uint DataVersion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FGetUserInventoryRequest
|
||||
{
|
||||
public class FGetUserInventoryRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
|
||||
/// </summary>
|
||||
[JsonPropertyName("CustomTags")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Dictionary<string, string> CustomTags { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FGetUserInventoryResult
|
||||
{
|
||||
public class FGetUserInventoryResult
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] Array of inventory items belonging to the user.
|
||||
/// </summary>
|
||||
@@ -26,5 +25,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
[JsonPropertyName("VirtualCurrencyRechargeTimes")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Dictionary<string, FVirtualCurrencyRechargeTime> VirtualCurrencyRechargeTimes { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FServerLoginResult
|
||||
{
|
||||
public class FServerLoginResult
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and
|
||||
/// returned.
|
||||
@@ -60,5 +59,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
[JsonPropertyName("TreatmentAssignment")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public FTreatmentAssignment TreatmentAssignment { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FUpdateUserDataRequest
|
||||
{
|
||||
public class FUpdateUserDataRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
|
||||
/// </summary>
|
||||
@@ -34,5 +33,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
/// Unique PlayFab assigned ID of the user on whom the operation will be performed.
|
||||
/// </summary>
|
||||
public string PlayFabId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FUpdateUserDataResult
|
||||
{
|
||||
public class FUpdateUserDataResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates the current version of the data that has been set. This is incremented with every set call for that type of
|
||||
/// data (read-only, internal, etc). This version can be provided in Get calls to find updated data.
|
||||
/// </summary>
|
||||
public uint DataVersion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FUpdateUserTitleDisplayNameRequest
|
||||
{
|
||||
public class FUpdateUserTitleDisplayNameRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
|
||||
/// </summary>
|
||||
@@ -17,5 +16,4 @@ namespace Prospect.Server.Api.Models.Client
|
||||
/// </summary>
|
||||
[JsonPropertyName("DisplayName")]
|
||||
public string DisplayName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace Prospect.Server.Api.Models.Client
|
||||
namespace Prospect.Server.Api.Models.Client;
|
||||
|
||||
public class FUpdateUserTitleDisplayNameResult
|
||||
{
|
||||
public class FUpdateUserTitleDisplayNameResult
|
||||
{
|
||||
/// <summary>
|
||||
/// [optional] Current title display name for the user (this will be the original display name if the rename attempt failed).
|
||||
/// </summary>
|
||||
public string DisplayName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data;
|
||||
|
||||
public class FYActiveContractPlayerData
|
||||
{
|
||||
public class FYActiveContractPlayerData
|
||||
{
|
||||
[JsonPropertyName("contractId")]
|
||||
public string ContractId { get; set; }
|
||||
|
||||
[JsonPropertyName("progress")]
|
||||
public List<int> Progress { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data;
|
||||
|
||||
public class FYFactionContractData
|
||||
{
|
||||
public class FYFactionContractData
|
||||
{
|
||||
[JsonPropertyName("contractId")]
|
||||
public string ContractId { get; set; }
|
||||
|
||||
[JsonPropertyName("contractIsLockedDueToLowFactionReputation")]
|
||||
public bool ContractIsLockedDueToLowFactionReputation { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data;
|
||||
|
||||
public class FYFactionContractsData
|
||||
{
|
||||
public class FYFactionContractsData
|
||||
{
|
||||
[JsonPropertyName("factionId")]
|
||||
public string FactionId { get; set; }
|
||||
|
||||
[JsonPropertyName("contracts")]
|
||||
public List<FYFactionContractData> Contracts { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data;
|
||||
|
||||
public class FYFactionsContractsData
|
||||
{
|
||||
public class FYFactionsContractsData
|
||||
{
|
||||
[JsonPropertyName("boards")]
|
||||
public List<FYFactionContractsData> Boards { get; set; }
|
||||
|
||||
[JsonPropertyName("lastBoardRefreshTimeUtc")]
|
||||
public FYTimestamp LastBoardRefreshTimeUtc { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data;
|
||||
|
||||
public class FYItemCurrentlyBeingCrafted
|
||||
{
|
||||
public class FYItemCurrentlyBeingCrafted
|
||||
{
|
||||
[JsonPropertyName("itemId")]
|
||||
public string ItemId { get; set; }
|
||||
|
||||
@@ -15,5 +15,4 @@ namespace Prospect.Server.Api.Models.CloudScript.Data
|
||||
|
||||
[JsonPropertyName("utcTimestampWhenCraftingStarted")]
|
||||
public FYTimestamp UtcTimestampWhenCraftingStarted { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data
|
||||
namespace Prospect.Server.Api.Models.CloudScript.Data;
|
||||
|
||||
public class FYTimestamp
|
||||
{
|
||||
public class FYTimestamp
|
||||
{
|
||||
[JsonPropertyName("seconds")]
|
||||
public int Seconds { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.CloudScript.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.CloudScript
|
||||
namespace Prospect.Server.Api.Models.CloudScript;
|
||||
|
||||
public class FYGetCraftingInProgressDataResult
|
||||
{
|
||||
public class FYGetCraftingInProgressDataResult
|
||||
{
|
||||
[JsonPropertyName("userId")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
@@ -13,5 +13,4 @@ namespace Prospect.Server.Api.Models.CloudScript
|
||||
|
||||
[JsonPropertyName("itemCurrentlyBeingCrafted")]
|
||||
public FYItemCurrentlyBeingCrafted ItemCurrentlyBeingCrafted { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Prospect.Server.Api.Models.CloudScript.Data;
|
||||
|
||||
namespace Prospect.Server.Api.Models.CloudScript
|
||||
namespace Prospect.Server.Api.Models.CloudScript;
|
||||
|
||||
public class FYGetPlayerContractsResult
|
||||
{
|
||||
public class FYGetPlayerContractsResult
|
||||
{
|
||||
[JsonPropertyName("userId")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
@@ -20,5 +19,4 @@ namespace Prospect.Server.Api.Models.CloudScript
|
||||
|
||||
[JsonPropertyName("refreshHours24UtcFromBackend")]
|
||||
public int RefreshHours24UtcFromBackend { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace Prospect.Server.Api
|
||||
namespace Prospect.Server.Api;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
@@ -42,5 +39,4 @@ namespace Prospect.Server.Api
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>true</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
namespace Prospect.Server.Api.Services.Auth
|
||||
namespace Prospect.Server.Api.Services.Auth;
|
||||
|
||||
public static class AuthClaimTypes
|
||||
{
|
||||
public static class AuthClaimTypes
|
||||
{
|
||||
public const string UserId = "user_id";
|
||||
public const string EntityId = "entity_id";
|
||||
public const string Type = "type";
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Prospect.Server.Api.Services.Database.Models;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Auth
|
||||
namespace Prospect.Server.Api.Services.Auth;
|
||||
|
||||
public class AuthTokenService
|
||||
{
|
||||
public class AuthTokenService
|
||||
{
|
||||
private const string DefaultIssuer = "ProspectApi";
|
||||
private const string DefaultAudience = "Prospect";
|
||||
|
||||
@@ -79,5 +77,4 @@ namespace Prospect.Server.Api.Services.Auth
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
namespace Prospect.Server.Api.Services.Auth
|
||||
namespace Prospect.Server.Api.Services.Auth;
|
||||
|
||||
public class AuthTokenSettings
|
||||
{
|
||||
public class AuthTokenSettings
|
||||
{
|
||||
public string Secret { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
namespace Prospect.Server.Api.Services.Auth
|
||||
namespace Prospect.Server.Api.Services.Auth;
|
||||
|
||||
public static class AuthType
|
||||
{
|
||||
public static class AuthType
|
||||
{
|
||||
public const string User = "User";
|
||||
public const string Entity = "Entity";
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Prospect.Server.Api.Services.Auth.Entity;
|
||||
using Prospect.Server.Api.Services.Auth.User;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Auth
|
||||
namespace Prospect.Server.Api.Services.Auth;
|
||||
|
||||
public static class AuthenticationBuilderExtensions
|
||||
{
|
||||
public static class AuthenticationBuilderExtensions
|
||||
{
|
||||
public static AuthenticationBuilder AddUserAuthentication(this AuthenticationBuilder authenticationBuilder, Action<UserAuthenticationOptions> options)
|
||||
{
|
||||
return authenticationBuilder.AddScheme<UserAuthenticationOptions, UserAuthenticationHandler>(UserAuthenticationOptions.DefaultScheme, options);
|
||||
@@ -16,5 +15,4 @@ namespace Prospect.Server.Api.Services.Auth
|
||||
{
|
||||
return authenticationBuilder.AddScheme<EntityAuthenticationOptions, EntityAuthenticationHandler>(EntityAuthenticationOptions.DefaultScheme, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Prospect.Server.Api.Models.Client;
|
||||
using Prospect.Server.Api.Services.Auth.Extensions;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Auth.Entity
|
||||
namespace Prospect.Server.Api.Services.Auth.Entity;
|
||||
|
||||
public class EntityAuthenticationHandler : AuthenticationHandler<EntityAuthenticationOptions>
|
||||
{
|
||||
public class EntityAuthenticationHandler : AuthenticationHandler<EntityAuthenticationOptions>
|
||||
{
|
||||
private const string Header = "X-EntityToken";
|
||||
private const string Type = AuthType.Entity;
|
||||
|
||||
@@ -83,5 +78,4 @@ namespace Prospect.Server.Api.Services.Auth.Entity
|
||||
|
||||
await Response.WriteAsync(JsonSerializer.Serialize(Res));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Auth.Entity
|
||||
namespace Prospect.Server.Api.Services.Auth.Entity;
|
||||
|
||||
public class EntityAuthenticationOptions : AuthenticationSchemeOptions
|
||||
{
|
||||
public class EntityAuthenticationOptions : AuthenticationSchemeOptions
|
||||
{
|
||||
public const string DefaultScheme = "EntityAuth";
|
||||
public string Scheme => DefaultScheme;
|
||||
public string AuthenticationType = DefaultScheme;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Security.Claims;
|
||||
using Prospect.Server.Api.Exceptions;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Auth.Extensions
|
||||
namespace Prospect.Server.Api.Services.Auth.Extensions;
|
||||
|
||||
public static class ClaimsPrincipalExtensions
|
||||
{
|
||||
public static class ClaimsPrincipalExtensions
|
||||
{
|
||||
public static string FindAuthUserId(this ClaimsPrincipal principal)
|
||||
{
|
||||
return Find(principal, AuthClaimTypes.UserId);
|
||||
@@ -30,5 +30,4 @@ namespace Prospect.Server.Api.Services.Auth.Extensions
|
||||
|
||||
return claim.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Prospect.Server.Api.Models.Client;
|
||||
using Prospect.Server.Api.Services.Auth.Extensions;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Auth.User
|
||||
namespace Prospect.Server.Api.Services.Auth.User;
|
||||
|
||||
public class UserAuthenticationHandler : AuthenticationHandler<UserAuthenticationOptions>
|
||||
{
|
||||
public class UserAuthenticationHandler : AuthenticationHandler<UserAuthenticationOptions>
|
||||
{
|
||||
private const string Header = "X-Authorization";
|
||||
private const string Type = AuthType.User;
|
||||
|
||||
@@ -81,5 +76,4 @@ namespace Prospect.Server.Api.Services.Auth.User
|
||||
ErrorMessage = Failure
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Auth.User
|
||||
namespace Prospect.Server.Api.Services.Auth.User;
|
||||
|
||||
public class UserAuthenticationOptions : AuthenticationSchemeOptions
|
||||
{
|
||||
public class UserAuthenticationOptions : AuthenticationSchemeOptions
|
||||
{
|
||||
public const string DefaultScheme = "UserAuth";
|
||||
public string Scheme => DefaultScheme;
|
||||
public string AuthenticationType = DefaultScheme;
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
using MongoDB.Driver;
|
||||
using Prospect.Server.Api.Config;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database
|
||||
namespace Prospect.Server.Api.Services.Database;
|
||||
|
||||
public abstract class BaseDbService<T>
|
||||
{
|
||||
public abstract class BaseDbService<T>
|
||||
{
|
||||
protected BaseDbService(IOptions<DatabaseSettings> options, string collection)
|
||||
{
|
||||
var settings = options.Value;
|
||||
@@ -16,5 +16,4 @@ namespace Prospect.Server.Api.Services.Database
|
||||
}
|
||||
|
||||
protected IMongoCollection<T> Collection { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MongoDB.Driver;
|
||||
using Prospect.Server.Api.Config;
|
||||
using Prospect.Server.Api.Services.Database.Models;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database
|
||||
namespace Prospect.Server.Api.Services.Database;
|
||||
|
||||
public class DbEntityService : BaseDbService<PlayFabEntity>
|
||||
{
|
||||
public class DbEntityService : BaseDbService<PlayFabEntity>
|
||||
{
|
||||
public DbEntityService(IOptions<DatabaseSettings> settings) : base(settings, nameof(PlayFabEntity))
|
||||
{
|
||||
}
|
||||
@@ -34,5 +33,4 @@ namespace Prospect.Server.Api.Services.Database
|
||||
return await FindAsync(userId) ??
|
||||
await CreateAsync(userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MongoDB.Driver;
|
||||
using Prospect.Server.Api.Config;
|
||||
using Prospect.Server.Api.Services.Database.Models;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database
|
||||
namespace Prospect.Server.Api.Services.Database;
|
||||
|
||||
public class DbUserDataService : BaseDbService<PlayFabUserData>
|
||||
{
|
||||
public class DbUserDataService : BaseDbService<PlayFabUserData>
|
||||
{
|
||||
public DbUserDataService(IOptions<DatabaseSettings> options) : base(options, nameof(PlayFabUserData))
|
||||
{
|
||||
}
|
||||
@@ -56,5 +54,4 @@ namespace Prospect.Server.Api.Services.Database
|
||||
|
||||
await Collection.UpdateOneAsync(data => data.Id == dataId, update);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MongoDB.Driver;
|
||||
using Prospect.Server.Api.Config;
|
||||
using Prospect.Server.Api.Services.Database.Models;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database
|
||||
namespace Prospect.Server.Api.Services.Database;
|
||||
|
||||
public class DbUserService : BaseDbService<PlayFabUser>
|
||||
{
|
||||
public class DbUserService : BaseDbService<PlayFabUser>
|
||||
{
|
||||
public DbUserService(IOptions<DatabaseSettings> settings) : base(settings, nameof(PlayFabUser))
|
||||
{
|
||||
}
|
||||
@@ -46,5 +43,4 @@ namespace Prospect.Server.Api.Services.Database
|
||||
return await FindAsync(type, key) ??
|
||||
await CreateAsync(type, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography;
|
||||
using MongoDB.Bson.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database.Generator
|
||||
namespace Prospect.Server.Api.Services.Database.Generator;
|
||||
|
||||
public class PlayFabIdGenerator : IIdGenerator
|
||||
{
|
||||
public class PlayFabIdGenerator : IIdGenerator
|
||||
{
|
||||
private static readonly RNGCryptoServiceProvider Random = new RNGCryptoServiceProvider();
|
||||
|
||||
public object GenerateId(object container, object document)
|
||||
@@ -19,5 +18,4 @@ namespace Prospect.Server.Api.Services.Database.Generator
|
||||
{
|
||||
return id is not string idStr || string.IsNullOrEmpty(idStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,17 @@
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using Prospect.Server.Api.Services.Database.Generator;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database.Models
|
||||
namespace Prospect.Server.Api.Services.Database.Models;
|
||||
|
||||
/// <summary>
|
||||
/// title_player_account
|
||||
/// </summary>
|
||||
public class PlayFabEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// title_player_account
|
||||
/// </summary>
|
||||
public class PlayFabEntity
|
||||
{
|
||||
[BsonId(IdGenerator = typeof(PlayFabIdGenerator))]
|
||||
public string Id { get; set; }
|
||||
|
||||
[BsonRequired]
|
||||
[BsonElement("UserId")]
|
||||
public string UserId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using Prospect.Server.Api.Services.Database.Generator;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database.Models
|
||||
namespace Prospect.Server.Api.Services.Database.Models;
|
||||
|
||||
/// <summary>
|
||||
/// master_player_account
|
||||
/// </summary>
|
||||
public class PlayFabUser
|
||||
{
|
||||
/// <summary>
|
||||
/// master_player_account
|
||||
/// </summary>
|
||||
public class PlayFabUser
|
||||
{
|
||||
[BsonId(IdGenerator = typeof(PlayFabIdGenerator))]
|
||||
public string Id { get; set; }
|
||||
|
||||
@@ -19,5 +18,4 @@ namespace Prospect.Server.Api.Services.Database.Models
|
||||
[BsonRequired]
|
||||
[BsonElement("Auth")]
|
||||
public List<PlayFabUserAuth> Auth { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database.Models
|
||||
namespace Prospect.Server.Api.Services.Database.Models;
|
||||
|
||||
public class PlayFabUserAuth
|
||||
{
|
||||
public class PlayFabUserAuth
|
||||
{
|
||||
[BsonElement("Type")]
|
||||
public PlayFabUserAuthType Type { get; set; }
|
||||
|
||||
[BsonElement("Key")]
|
||||
public string Key { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
namespace Prospect.Server.Api.Services.Database.Models
|
||||
namespace Prospect.Server.Api.Services.Database.Models;
|
||||
|
||||
public enum PlayFabUserAuthType
|
||||
{
|
||||
public enum PlayFabUserAuthType
|
||||
{
|
||||
Epic,
|
||||
Steam
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database.Models
|
||||
namespace Prospect.Server.Api.Services.Database.Models;
|
||||
|
||||
public class PlayFabUserData
|
||||
{
|
||||
public class PlayFabUserData
|
||||
{
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; }
|
||||
@@ -32,5 +31,4 @@ namespace Prospect.Server.Api.Services.Database.Models
|
||||
[BsonRequired]
|
||||
[BsonElement("LastUpdated")]
|
||||
public DateTime LastUpdated { get; set; }
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,10 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Extensions.Logging;
|
||||
namespace Prospect.Server.Api.Services.UserData;
|
||||
|
||||
namespace Prospect.Server.Api.Services.UserData
|
||||
public class TitleDataService
|
||||
{
|
||||
public class TitleDataService
|
||||
{
|
||||
public TitleDataService(ILogger<TitleDataService> logger)
|
||||
{
|
||||
|
||||
@@ -29,5 +26,4 @@ namespace Prospect.Server.Api.Services.UserData
|
||||
|
||||
return TitleDataDefault.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
using Prospect.Server.Api.Models.Client.Data;
|
||||
using Prospect.Server.Api.Services.Database;
|
||||
|
||||
namespace Prospect.Server.Api.Services.UserData
|
||||
namespace Prospect.Server.Api.Services.UserData;
|
||||
|
||||
public class UserDataService
|
||||
{
|
||||
public class UserDataService
|
||||
{
|
||||
private readonly ILogger<UserDataService> _logger;
|
||||
private readonly DbUserDataService _dbUserDataService;
|
||||
|
||||
@@ -178,5 +174,4 @@ namespace Prospect.Server.Api.Services.UserData
|
||||
await _dbUserDataService.UpdateValueAsync(data.Id, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,15 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Prospect.Server.Api.Config;
|
||||
using Prospect.Server.Api.Converters;
|
||||
using Prospect.Server.Api.Middleware;
|
||||
using Prospect.Server.Api.Services.Auth;
|
||||
using Prospect.Server.Api.Services.Auth.User;
|
||||
using Prospect.Server.Api.Services.Database;
|
||||
using Prospect.Server.Api.Services.UserData;
|
||||
using Serilog;
|
||||
|
||||
namespace Prospect.Server.Api
|
||||
namespace Prospect.Server.Api;
|
||||
|
||||
public class Startup
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
@@ -68,5 +62,4 @@ namespace Prospect.Server.Api
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
namespace Prospect.Server.Steam;
|
||||
|
||||
namespace Prospect.Server.Steam
|
||||
public class AppDlc
|
||||
{
|
||||
public class AppDlc
|
||||
{
|
||||
public uint AppId { get; set; }
|
||||
|
||||
public List<uint> Licenses { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net;
|
||||
|
||||
namespace Prospect.Server.Steam
|
||||
namespace Prospect.Server.Steam;
|
||||
|
||||
public class AppTicket
|
||||
{
|
||||
public class AppTicket
|
||||
{
|
||||
private AppTicket()
|
||||
{
|
||||
|
||||
@@ -163,5 +160,4 @@ namespace Prospect.Server.Steam
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>true</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Prospect.Server.Steam
|
||||
namespace Prospect.Server.Steam;
|
||||
|
||||
internal static class SteamCrypto
|
||||
{
|
||||
internal static class SteamCrypto
|
||||
{
|
||||
private const string SystemCertificate = "-----BEGIN PUBLIC KEY-----\n" +
|
||||
"MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDf7BrWLBBmLBc1OhSwfFkRf53T\n" +
|
||||
"2Ct64+AVzRkeRuh7h3SiGEYxqQMUeYKO6UWiSRKpI2hzic9pobFhRr3Bvr/WARvY\n" +
|
||||
@@ -28,5 +28,4 @@ namespace Prospect.Server.Steam
|
||||
|
||||
return dataVerified;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user