Upgrade to .net 8
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
|
||||
public async Task GuestLogout()
|
||||
{
|
||||
var response = await this.guestHttpClient.PutAsync(new Uri("User/GuestLogout", UriKind.Relative), null);
|
||||
var response = await this.guestHttpClient.PutAsync(RelativeUri("User/TestGuestLogout"), null);
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
if (!string.IsNullOrEmpty(content))
|
||||
{
|
||||
return await response.Content.ReadFromJsonAsync<CreateTokenResponse>(serializerOptions);
|
||||
return JsonSerializer.Deserialize<CreateTokenResponse>(content, serializerOptions);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -7,17 +7,8 @@
|
||||
@if (guestAccountDescriptionIsVisible)
|
||||
{
|
||||
<h1>What's the difference?</h1>
|
||||
@*<div class="account-description mb-4 bg-light p-2">
|
||||
<h4>Feature</h4>
|
||||
<h4>Guest Accounts</h4>
|
||||
<h4>Email Accounts</h4>
|
||||
|
||||
<div>Resume in-progress games from any browser on any device.</div>
|
||||
<span class="oi oi-circle-x" title="circle-x" aria-hidden="true"></span>
|
||||
<span class="oi oi-circle-check" title="circle-check" aria-hidden="true"></span>
|
||||
</div>*@
|
||||
<p>
|
||||
Guest accounts are session based, meaning that the account lives exclusively within the device and browser you create the account on.
|
||||
Guest accounts are session based, meaning that the account lives exclusively within the device and browser you play on as a guest.
|
||||
This is the only difference between guest and email accounts.
|
||||
</p>
|
||||
<div class="alert alert-warning">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.AspNetCore.Http.Extensions;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
using Shogi.Contracts.Socket;
|
||||
using Shogi.Contracts.Types;
|
||||
using System.Buffers;
|
||||
@@ -16,7 +16,7 @@ public class ShogiSocket : IDisposable
|
||||
|
||||
private ClientWebSocket socket;
|
||||
private readonly JsonSerializerOptions serializerOptions;
|
||||
private readonly UriBuilder uriBuilder;
|
||||
private readonly string baseUrl;
|
||||
private readonly CancellationTokenSource cancelToken;
|
||||
private readonly IMemoryOwner<byte> memoryOwner;
|
||||
private bool disposedValue;
|
||||
@@ -25,7 +25,7 @@ public class ShogiSocket : IDisposable
|
||||
{
|
||||
this.socket = new ClientWebSocket();
|
||||
this.serializerOptions = serializerOptions;
|
||||
this.uriBuilder = new UriBuilder(configuration["SocketUrl"] ?? throw new InvalidOperationException("SocketUrl configuration is missing."));
|
||||
this.baseUrl = configuration["SocketUrl"] ?? throw new InvalidOperationException("SocketUrl configuration is missing.");
|
||||
this.cancelToken = new CancellationTokenSource();
|
||||
this.memoryOwner = MemoryPool<byte>.Shared.Rent(1024 * 2);
|
||||
}
|
||||
@@ -46,8 +46,8 @@ public class ShogiSocket : IDisposable
|
||||
Console.WriteLine("Opening socket and existing socket state is " + this.socket.State.ToString());
|
||||
}
|
||||
|
||||
uriBuilder.Query = new QueryBuilder { { "token", token } }.ToQueryString().Value;
|
||||
await socket.ConnectAsync(this.uriBuilder.Uri, cancelToken.Token);
|
||||
var uri = new Uri(QueryHelpers.AddQueryString(this.baseUrl, "token", token), UriKind.Absolute);
|
||||
await socket.ConnectAsync(uri, cancelToken.Token);
|
||||
// Fire and forget! I'm way too lazy to write my own javascript interop to a web worker. Nooo thanks.
|
||||
_ = Listen()
|
||||
.ContinueWith(async antecedent =>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
@@ -14,12 +14,12 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.2" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
"api://c1e94676-cab0-42ba-8b6c-9532b8486fff/DefaultScope"
|
||||
]
|
||||
},
|
||||
"ShogiApiUrl2": "https://localhost:5001",
|
||||
"ShogiApiUrl": "https://api.lucaserver.space/Shogi.Api/",
|
||||
"SocketUrl": "wss://api.lucaserver.space/Shogi.Api/",
|
||||
|
||||
"ShogiApiUrl2": "https://localhost:5001",
|
||||
"SocketUrl2": "wss://localhost:5001"
|
||||
}
|
||||
Reference in New Issue
Block a user