Update to .NET 8
This commit is contained in:
@@ -15,15 +15,15 @@ jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '6.0.x'
|
||||
dotnet-version: '8.0.x'
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.0.3
|
||||
uses: microsoft/setup-msbuild@v2.0.0
|
||||
|
||||
- name: Restore NuGet
|
||||
run: dotnet restore ${{env.PROJ_LAUNCHER}}
|
||||
@@ -39,11 +39,8 @@ jobs:
|
||||
- name: Build Prospect.Launcher
|
||||
run: dotnet publish -o ./Prospect-Launcher -r win-x64 --no-self-contained -c Release -v minimal ${{env.PROJ_LAUNCHER}}
|
||||
|
||||
- name: Compress Prospect.Launcher
|
||||
run: 7z a launcher.zip ./Prospect-Launcher
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Prospect.Launcher
|
||||
path: ./launcher.zip
|
||||
path: ./Prospect-Launcher
|
||||
retention-days: 14
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Prospect
|
||||
|
||||
[](https://github.com/AeonLucid/Prospect/actions)
|
||||
[](https://github.com/AeonLucid/Prospect/actions)
|
||||
|
||||
Also known as "The Cycle: Frontier".
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>false</SelfContained>
|
||||
|
||||
@@ -117,7 +117,8 @@ public class ClientController : Controller
|
||||
});
|
||||
}
|
||||
|
||||
_logger.LogWarning("Invalid steam ticket specified, IsValid {IsValid}, HasValidSignature {Sig}, AppId {AppId}",
|
||||
_logger.LogWarning("Invalid steam ticket specified, IsExpired {IsExpired}, IsValid {IsValid}, HasValidSignature {Sig}, AppId {AppId}",
|
||||
ticket.IsExpired,
|
||||
ticket.IsValid,
|
||||
ticket.HasValidSignature,
|
||||
ticket.AppId);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Microsoft.AspNetCore.Http.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Prospect.Server.Api.Middleware;
|
||||
|
||||
@@ -45,7 +45,12 @@ public class RequestLoggerMiddleware
|
||||
var body = await reader.ReadToEndAsync();
|
||||
if (body.StartsWith("{"))
|
||||
{
|
||||
return JsonConvert.SerializeObject(JsonConvert.DeserializeObject(body), Formatting.Indented);
|
||||
var bodyJson = JsonSerializer.SerializeToUtf8Bytes(JsonSerializer.Deserialize<object>(body), new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true
|
||||
});
|
||||
|
||||
return Encoding.UTF8.GetString(bodyJson);
|
||||
}
|
||||
|
||||
return body;
|
||||
|
||||
@@ -32,5 +32,5 @@ public class FUpdateUserDataRequest
|
||||
/// <summary>
|
||||
/// Unique PlayFab assigned ID of the user on whom the operation will be performed.
|
||||
/// </summary>
|
||||
public string PlayFabId { get; set; }
|
||||
public string? PlayFabId { get; set; }
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>true</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MongoDB.Driver" Version="2.14.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="2.27.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
||||
<PackageReference Include="Sigil" Version="5.0.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.15.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.6.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -16,7 +16,7 @@ public class DbUserDataService : BaseDbService<PlayFabUserData>
|
||||
return await Collection.Find(data => data.PlayFabId == playFabId && data.Key == key).AnyAsync();
|
||||
}
|
||||
|
||||
public async Task<PlayFabUserData> FindAsync(string playFabId, string key)
|
||||
public async Task<PlayFabUserData?> FindAsync(string playFabId, string key)
|
||||
{
|
||||
return await Collection.Find(data => data.PlayFabId == playFabId && data.Key == key).SingleOrDefaultAsync();
|
||||
}
|
||||
|
||||
@@ -120,14 +120,14 @@ public class UserDataService
|
||||
/// <param name="currentUserId">
|
||||
/// The authenticated user id.
|
||||
/// </param>
|
||||
/// <param name="requestUserId">
|
||||
/// The requested user id.
|
||||
/// <param name="targetUserId">
|
||||
/// The target user id.
|
||||
/// </param>
|
||||
/// <param name="changes"></param>
|
||||
/// <returns></returns>
|
||||
public async Task UpdateAsync(
|
||||
string currentUserId,
|
||||
string requestUserId,
|
||||
string? targetUserId,
|
||||
Dictionary<string, string> changes)
|
||||
{
|
||||
if (changes.Count == 0)
|
||||
@@ -140,13 +140,13 @@ public class UserDataService
|
||||
throw new ArgumentNullException(nameof(currentUserId));
|
||||
}
|
||||
|
||||
if (requestUserId == null)
|
||||
if (targetUserId == null)
|
||||
{
|
||||
requestUserId = currentUserId;
|
||||
targetUserId = currentUserId;
|
||||
}
|
||||
|
||||
// Whether we are updating someone else.
|
||||
var other = currentUserId != requestUserId;
|
||||
var other = currentUserId != targetUserId;
|
||||
|
||||
foreach (var (key, value) in changes)
|
||||
{
|
||||
@@ -155,10 +155,11 @@ public class UserDataService
|
||||
{
|
||||
if (other)
|
||||
{
|
||||
_logger.LogWarning("User {PlayFabId} attempted to update non-existing key {Key} of another user {PlayFabIdOther}", currentUserId, key, requestUserId);
|
||||
_logger.LogWarning("User {PlayFabId} attempted to update non-existing key {Key} of another user {PlayFabIdOther}", currentUserId, key, targetUserId);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogDebug("User {PlayFabId} created key {Key}", currentUserId, key);
|
||||
await _dbUserDataService.InsertAsync(currentUserId, key, value, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
|
||||
<PackageReference Include="Serilog" Version="4.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>true</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -11,12 +11,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Templates\NMTMessage.sbntxt" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -22,6 +22,6 @@ public class FStringTests
|
||||
var reader = new FNetBitReader(null, writer.GetData(), (int)writer.GetNumBits());
|
||||
var read = FString.Deserialize(reader);
|
||||
|
||||
Assert.AreEqual(testValue, read);
|
||||
Assert.That(read, Is.EqualTo(testValue));
|
||||
}
|
||||
}
|
||||
@@ -11,20 +11,20 @@ public class FPackedHeaderTests
|
||||
[TestCase((uint)1221642592, (ushort)4660)]
|
||||
public void TestGetSeq(uint input, ushort output)
|
||||
{
|
||||
Assert.AreEqual(output, FPackedHeader.GetSeq(input).Value);
|
||||
Assert.That(FPackedHeader.GetSeq(input).Value, Is.EqualTo(output));
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCase((uint)1221642592, (ushort)3222)]
|
||||
public void TestGetAckedSeq(uint input, ushort output)
|
||||
{
|
||||
Assert.AreEqual(output, FPackedHeader.GetAckedSeq(input).Value);
|
||||
Assert.That(FPackedHeader.GetAckedSeq(input).Value, Is.EqualTo(output));
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCase((uint)1221642592, (uint)0)]
|
||||
public void TestGetHistoryWordCount(uint input, uint output)
|
||||
{
|
||||
Assert.AreEqual(output, FPackedHeader.GetHistoryWordCount(input));
|
||||
Assert.That(FPackedHeader.GetHistoryWordCount(input), Is.EqualTo(output));
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.2" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageReference Include="NUnit" Version="4.1.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace Prospect.Unreal.Net;
|
||||
|
||||
public ref struct FActorSpawnParameters
|
||||
{
|
||||
public FActorSpawnParameters()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A name to assign as the Name of the Actor being spawned.
|
||||
/// If no value is specified, the name of the spawned Actor will be automatically generated using the form [Class]_[Number].
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
@@ -20,7 +20,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
<PackageReference Include="Serilog" Version="4.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user