Skip to content

Commit 3b1d4f2

Browse files
authored
Merge pull request #70 from NosCoreIO/FixBuild
Fix build
2 parents 1c75770 + 04e4014 commit 3b1d4f2

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

src/NosCore.PathFinder.Gui/Database/DataAccessHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace NosCore.PathFinder.Gui.Database
1414
{
15-
public class DataAccessHelper : IDbContextBuilder
15+
public class DataAccessHelper
1616
{
1717
private static readonly ILogger Logger = Shared.I18N.Logger.GetLoggerConfiguration().CreateLogger();
1818

src/NosCore.PathFinder.Gui/GuiWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public GuiWindow(MapDto map, int width, int height, string title, DataAccessHelp
5050
GraphicsMode.Default, title)
5151
{
5252
var dbContextBuilder1 = dbContextBuilder;
53-
var mapMonsterDao = new Dao<MapMonster, MapMonsterDto, int>(Logger, dbContextBuilder1);
54-
var mapNpcDao = new Dao<MapNpc, MapNpcDto, int>(Logger, dbContextBuilder1);
53+
var mapMonsterDao = new Dao<MapMonster, MapMonsterDto, int>(Logger, dbContextBuilder1.CreateContext);
54+
var mapNpcDao = new Dao<MapNpc, MapNpcDto, int>(Logger, dbContextBuilder1.CreateContext);
5555
_originalWidth = Width;
5656
_originalCellSize = Width / map.Width;
5757
_cellSize = Width / map.Width;
@@ -82,8 +82,8 @@ public GuiWindow(MapDto map, int width, int height, string title, DataAccessHelp
8282
mapNpc.Map = _map;
8383
}
8484

85-
Parallel.ForEach(_monsters, monster => monster.StartLife(CancellationToken.None));
86-
Parallel.ForEach(_npcs, npc => npc.StartLife(CancellationToken.None));
85+
Parallel.ForEach(_monsters, monster => _ = monster.StartLife(CancellationToken.None));
86+
Parallel.ForEach(_npcs, npc => _ = npc.StartLife(CancellationToken.None));
8787

8888
var wallpixels = new List<Vector2[]>();
8989
for (short y = 0; y < _map.Length; y++)

src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414

1515
<ItemGroup>
1616
<FrameworkReference Include="Microsoft.AspNetCore.App" />
17+
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
1718
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="5.0.0" />
1819
<PackageReference Include="NetEscapades.Configuration.Yaml" Version="2.0.1" />
1920
<PackageReference Include="NosCore.Dao" Version="1.5.0" />
2021
<PackageReference Include="NosCore.Shared" Version="1.10.0" />
21-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
22+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.0-rc2" />
2223
<PackageReference Include="OpenTK.NetStandard" Version="1.0.5.32" />
2324
</ItemGroup>
2425

src/NosCore.PathFinder.Gui/PathfinderGui.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Collections.Generic;
99
using System.Threading.Tasks;
1010
using Microsoft.EntityFrameworkCore;
11+
using Microsoft.Extensions.Configuration;
1112
using NosCore.PathFinder.Gui.Configuration;
1213
using NosCore.PathFinder.Gui.Database;
1314
using NosCore.PathFinder.Gui.I18N;
@@ -28,14 +29,14 @@ public static class PathFinderGui
2829
public static async Task Main(string[] args)
2930
{
3031
try { Console.Title = Title; } catch (PlatformNotSupportedException) { }
31-
ConfiguratorBuilder.InitializeConfiguration(args, new[] { "pathfinder.yml", "logger.yml" }, PathfinderGuiConfiguration);
32+
ConfiguratorBuilder.InitializeConfiguration(args, new[] { "pathfinder.yml", "logger.yml" }).Bind(PathfinderGuiConfiguration);
3233
Shared.I18N.Logger.PrintHeader(ConsoleText);
3334
var logger = Shared.I18N.Logger.GetLoggerConfiguration().CreateLogger();
3435
LogLanguage.Language = PathfinderGuiConfiguration.Language;
3536
var optionsBuilder = new DbContextOptionsBuilder<NosCoreContext>();
3637
optionsBuilder.UseNpgsql(PathfinderGuiConfiguration.Database!.ConnectionString);
3738
DbContextBuilder.Initialize(optionsBuilder.Options);
38-
var mapDao = new Dao<Map, MapDto, short>(logger, DbContextBuilder);
39+
var mapDao = new Dao<Map, MapDto, short>(logger, DbContextBuilder.CreateContext);
3940

4041
while (true)
4142
{

src/NosCore.PathFinder/Brushfire/JumpNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public JumpNode((short X, short Y) position, double? value)
2222

2323
public bool Opened { get; set; }
2424

25-
public int CompareTo(JumpNode other)
25+
public int CompareTo(JumpNode? other)
2626
{
27-
return F > other.F ? 1 : F < other.F ? -1 : 0;
27+
return F > other?.F ? 1 : F < other?.F ? -1 : 0;
2828
}
2929
}
3030
}

src/NosCore.PathFinder/Brushfire/Node.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public Node()
2020
{
2121
}
2222

23-
public int CompareTo(Node other)
23+
public int CompareTo(Node? other)
2424
{
25-
return F > other.F ? 1 : F < other.F ? -1 : 0;
25+
return F > other?.F ? 1 : F < other?.F ? -1 : 0;
2626
}
2727
public bool Closed { get; set; }
2828

src/NosCore.PathFinder/NosCore.PathFinder.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<RepositoryUrl>https://github.com/NosCoreIO/NosCore.PathFinder.git</RepositoryUrl>
1313
<PackageIconUrl></PackageIconUrl>
1414
<PackageTags>nostale, noscore, nostale private server source, nostale emulator</PackageTags>
15-
<Version>0.0.8</Version>
15+
<Version>0.0.9</Version>
1616
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
1717
<Description>NosCore's PathFinder</Description>
1818
<PackageLicenseExpression></PackageLicenseExpression>

0 commit comments

Comments
 (0)