general fixes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Michele Scandura 2021-09-24 10:21:44 +01:00
parent 3e1acd26f2
commit 85e2f699bf
6 changed files with 29 additions and 14 deletions

View file

@ -23,7 +23,7 @@ namespace Sledgemapper.Api.Handlers
{ {
try try
{ {
var user = await _dbcontext.Users.FindAsync(notification.UserId, cancellationToken); var user = await _dbcontext.Users.FindAsync(new object[] { notification.UserId }, cancellationToken);
_dbcontext.Attach(user); _dbcontext.Attach(user);
var campaign = new Core.Entities.Campaign var campaign = new Core.Entities.Campaign
{ {
@ -39,7 +39,7 @@ namespace Sledgemapper.Api.Handlers
} }
catch (Exception ex) catch (Exception ex)
{ {
} }
return false; return false;

View file

@ -9,19 +9,19 @@
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" /> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
<PackageReference Include="mediatr" Version="9.0.0" /> <PackageReference Include="mediatr" Version="9.0.0" />
<PackageReference Include="mediatr.extensions.microsoft.dependencyinjection" Version="9.0.0" /> <PackageReference Include="mediatr.extensions.microsoft.dependencyinjection" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.6" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.6" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.6" /> <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.6" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.6"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.10">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.6" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.10" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.4" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.11.1" /> <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.6" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View file

@ -301,7 +301,16 @@ namespace Sledgemapper
Program.helper.SaveUnencryptedTokenCache(JsonSerializer.SerializeToUtf8Bytes(_authenticateResponse)); Program.helper.SaveUnencryptedTokenCache(JsonSerializer.SerializeToUtf8Bytes(_authenticateResponse));
await Connection.StopAsync();
State.Instance.CampaignId=Guid.Empty;
State.Instance.CampaignName = string.Empty;
State.Instance.SessionId = Guid.Empty;
State.Instance.MapId = Guid.Empty;
State.Instance.MapName = string.Empty;
SessionData.SessionId = Guid.Empty;
SessionData.SessionName = string.Empty;
SessionData.Players.Clear();
return _authenticateResponse; return _authenticateResponse;
} }

View file

@ -57,6 +57,7 @@ namespace Sledgemapper
MyraEnvironment.Game = this; MyraEnvironment.Game = this;
_sessionData = new Session(); _sessionData = new Session();
IsFixedTimeStep = true; IsFixedTimeStep = true;
TargetElapsedTime = TimeSpan.FromSeconds(1d / 30d); TargetElapsedTime = TimeSpan.FromSeconds(1d / 30d);

View file

@ -58,7 +58,7 @@
<PackageReference Include="polly" Version="7.2.2" /> <PackageReference Include="polly" Version="7.2.2" />
<PackageReference Include="polly.extensions.http" Version="3.0.0" /> <PackageReference Include="polly.extensions.http" Version="3.0.0" />
<PackageReference Include="Refit.HttpClientFactory" Version="6.0.94" /> <PackageReference Include="Refit.HttpClientFactory" Version="6.0.94" />
<PackageReference Include="Sentry" Version="3.9.2" /> <PackageReference Include="Sentry" Version="3.9.3" />
<PackageReference Include="TinyMessenger" Version="1.4.0-alpha3"> <PackageReference Include="TinyMessenger" Version="1.4.0-alpha3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>

View file

@ -229,7 +229,12 @@ namespace Sledgemapper.UI
//MenuConnectJoin.Enabled = true; //MenuConnectJoin.Enabled = true;
MenuCampaignOpen.Enabled = true; MenuCampaignOpen.Enabled = true;
MenuCampaingNew.Enabled = true; MenuCampaingNew.Enabled = true;
MenuMapNew.Enabled = false;
MenuMapOpen.Enabled = false;
lblCampaign.Text = "n/a";
lblMap.Text = "n/a";
CommunicationManager.SessionData.MapEntityAdded -= OnMapEntityAdded;
CommunicationManager.SessionData.MapEntityDeleted -= OnMapEntityDeleted;
lblUsername.Text = $"{obj.Initials}"; lblUsername.Text = $"{obj.Initials}";
} }