fix publish for release
fix bug with localization issue crashing app if config is wrong
This commit is contained in:
parent
e91d076b41
commit
65cf3566db
@ -6,7 +6,7 @@
|
|||||||
<RuntimeFrameworkVersion>2.1.5</RuntimeFrameworkVersion>
|
<RuntimeFrameworkVersion>2.1.5</RuntimeFrameworkVersion>
|
||||||
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
|
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
|
||||||
<PackageId>RaidMax.IW4MAdmin.Application</PackageId>
|
<PackageId>RaidMax.IW4MAdmin.Application</PackageId>
|
||||||
<Version>2.1.9.6</Version>
|
<Version>2.2</Version>
|
||||||
<Authors>RaidMax</Authors>
|
<Authors>RaidMax</Authors>
|
||||||
<Company>Forever None</Company>
|
<Company>Forever None</Company>
|
||||||
<Product>IW4MAdmin</Product>
|
<Product>IW4MAdmin</Product>
|
||||||
@ -31,8 +31,8 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
<TieredCompilation>true</TieredCompilation>
|
<TieredCompilation>true</TieredCompilation>
|
||||||
<AssemblyVersion>2.1.9.6</AssemblyVersion>
|
<AssemblyVersion>2.2.0.0</AssemblyVersion>
|
||||||
<FileVersion>2.1.9.6</FileVersion>
|
<FileVersion>2.2.0.0</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -94,6 +94,6 @@
|
|||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PostPublish" AfterTargets="Publish">
|
<Target Name="PostPublish" AfterTargets="Publish">
|
||||||
<Exec Command="call $(ProjectDir)BuildScripts\PostPublish.bat $(ProjectDir)..\ $(ProjectDir) $(TargetDir) $(OutDir) $(CurrentConfiguration)" />
|
<Exec Command="call $(ProjectDir)BuildScripts\PostPublish.bat $(ProjectDir)..\ $(ProjectDir) $(TargetDir) $(ConfigurationName)" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -58,42 +58,50 @@ del "%SolutionDir%Publish\WindowsPrerelease\*pdb"
|
|||||||
|
|
||||||
echo setting up library folders
|
echo setting up library folders
|
||||||
|
|
||||||
echo PR-Config
|
if "%CurrentConfiguration%" == "Prerelease" (
|
||||||
if not exist "%SolutionDir%Publish\WindowsPrerelease\Configuration" md "%SolutionDir%Publish\WindowsPrerelease\Configuration"
|
echo PR-Config
|
||||||
move "%SolutionDir%Publish\WindowsPrerelease\DefaultSettings.json" "%SolutionDir%Publish\WindowsPrerelease\Configuration\"
|
if not exist "%SolutionDir%Publish\WindowsPrerelease\Configuration" md "%SolutionDir%Publish\WindowsPrerelease\Configuration"
|
||||||
|
move "%SolutionDir%Publish\WindowsPrerelease\DefaultSettings.json" "%SolutionDir%Publish\WindowsPrerelease\Configuration\"
|
||||||
|
)
|
||||||
|
|
||||||
if "%CurrentConfiguration" == "Release" (
|
if "%CurrentConfiguration%" == "Release" (
|
||||||
echo R-Config
|
echo R-Config
|
||||||
if not exist "%SolutionDir%Publish\Windows\Configuration" md "%SolutionDir%Publish\Windows\Configuration"
|
if not exist "%SolutionDir%Publish\Windows\Configuration" md "%SolutionDir%Publish\Windows\Configuration"
|
||||||
if exist "%SolutionDir%Publish\Windows\DefaultSettings.json" move "%SolutionDir%Publish\Windows\DefaultSettings.json" "%SolutionDir%Publish\Windows\Configuration\DefaultSettings.json"
|
if exist "%SolutionDir%Publish\Windows\DefaultSettings.json" move "%SolutionDir%Publish\Windows\DefaultSettings.json" "%SolutionDir%Publish\Windows\Configuration\DefaultSettings.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
echo PR-LIB
|
if "%CurrentConfiguration%" == "Prerelease" (
|
||||||
if not exist "%SolutionDir%Publish\WindowsPrerelease\Lib\" md "%SolutionDir%Publish\WindowsPrerelease\Lib\"
|
echo PR-LIB
|
||||||
move "%SolutionDir%Publish\WindowsPrerelease\*.dll" "%SolutionDir%Publish\WindowsPrerelease\Lib\"
|
if not exist "%SolutionDir%Publish\WindowsPrerelease\Lib\" md "%SolutionDir%Publish\WindowsPrerelease\Lib\"
|
||||||
move "%SolutionDir%Publish\WindowsPrerelease\*.json" "%SolutionDir%Publish\WindowsPrerelease\Lib\"
|
move "%SolutionDir%Publish\WindowsPrerelease\*.dll" "%SolutionDir%Publish\WindowsPrerelease\Lib\"
|
||||||
|
move "%SolutionDir%Publish\WindowsPrerelease\*.json" "%SolutionDir%Publish\WindowsPrerelease\Lib\"
|
||||||
|
)
|
||||||
|
|
||||||
if "%CurrentConfiguration" == "Release" (
|
if "%CurrentConfiguration%" == "Release" (
|
||||||
echo R-LIB
|
echo R-LIB
|
||||||
if not exist "%SolutionDir%Publish\Windows\Lib\" md "%SolutionDir%Publish\Windows\Lib\"
|
if not exist "%SolutionDir%Publish\Windows\Lib\" md "%SolutionDir%Publish\Windows\Lib\"
|
||||||
move "%SolutionDir%Publish\Windows\*.dll" "%SolutionDir%Publish\Windows\Lib\"
|
move "%SolutionDir%Publish\Windows\*.dll" "%SolutionDir%Publish\Windows\Lib\"
|
||||||
move "%SolutionDir%Publish\Windows\*.json" "%SolutionDir%Publish\Windows\Lib\"
|
move "%SolutionDir%Publish\Windows\*.json" "%SolutionDir%Publish\Windows\Lib\"
|
||||||
)
|
)
|
||||||
|
|
||||||
echo PR-RT
|
if "%CurrentConfiguration%" == "Prerelease" (
|
||||||
move "%SolutionDir%Publish\WindowsPrerelease\runtimes" "%SolutionDir%Publish\WindowsPrerelease\Lib\runtimes"
|
echo PR-RT
|
||||||
if exist "%SolutionDir%Publish\WindowsPrerelease\refs" move "%SolutionDir%Publish\WindowsPrerelease\refs" "%SolutionDir%Publish\WindowsPrerelease\Lib\refs"
|
move "%SolutionDir%Publish\WindowsPrerelease\runtimes" "%SolutionDir%Publish\WindowsPrerelease\Lib\runtimes"
|
||||||
|
if exist "%SolutionDir%Publish\WindowsPrerelease\refs" move "%SolutionDir%Publish\WindowsPrerelease\refs" "%SolutionDir%Publish\WindowsPrerelease\Lib\refs"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if "%CurrentConfiguration" == "Release" (
|
if "%CurrentConfiguration%" == "Release" (
|
||||||
echo R-RT
|
echo R-RT
|
||||||
move "%SolutionDir%Publish\Windows\runtimes" "%SolutionDir%Publish\Windows\Lib\runtimes"
|
move "%SolutionDir%Publish\Windows\runtimes" "%SolutionDir%Publish\Windows\Lib\runtimes"
|
||||||
if exist "%SolutionDir%Publish\Windows\refs" move "%SolutionDir%Publish\Windows\refs" "%SolutionDir%Publish\Windows\Lib\refs"
|
if exist "%SolutionDir%Publish\Windows\refs" move "%SolutionDir%Publish\Windows\refs" "%SolutionDir%Publish\Windows\Lib\refs"
|
||||||
)
|
)
|
||||||
|
|
||||||
echo making start scripts
|
echo making start scripts
|
||||||
@echo dotnet Lib/IW4MAdmin.dll > "%SolutionDir%Publish\WindowsPrerelease\StartIW4MAdmin.cmd"
|
@(echo dotnet Lib/IW4MAdmin.dll && echo pause) > "%SolutionDir%Publish\WindowsPrerelease\StartIW4MAdmin.cmd"
|
||||||
@echo dotnet Lib/IW4MAdmin.dll > "%SolutionDir%Publish\Windows\StartIW4MAdmin.cmd"
|
@(echo dotnet Lib/IW4MAdmin.dll && echo pause) > "%SolutionDir%Publish\Windows\StartIW4MAdmin.cmd"
|
||||||
|
|
||||||
@(echo #!/bin/bash && echo dotnet Lib\IW4MAdmin.dll) > "%SolutionDir%Publish\WindowsPrerelease\StartIW4MAdmin.sh"
|
@(echo #!/bin/bash && echo dotnet Lib\IW4MAdmin.dll) > "%SolutionDir%Publish\WindowsPrerelease\StartIW4MAdmin.sh"
|
||||||
@(echo #!/bin/bash && echo dotnet Lib\IW4MAdmin.dll) > "%SolutionDir%Publish\Windows\StartIW4MAdmin.sh"
|
@(echo #!/bin/bash && echo dotnet Lib\IW4MAdmin.dll) > "%SolutionDir%Publish\Windows\StartIW4MAdmin.sh"
|
||||||
|
|
||||||
|
eCHO "%CurrentConfiguration%"
|
||||||
|
@ -25,11 +25,6 @@
|
|||||||
"Name": "mp_rust"
|
"Name": "mp_rust"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
"Alias": "Highrise",
|
|
||||||
"Name": "mp_highrise"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"Alias": "Terminal",
|
"Alias": "Terminal",
|
||||||
"Name": "mp_terminal"
|
"Name": "mp_terminal"
|
||||||
|
@ -38,13 +38,14 @@ namespace IW4MAdmin.Application
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
loc = Utilities.CurrentLocalization.LocalizationIndex;
|
||||||
Console.CancelKeyPress += new ConsoleCancelEventHandler(OnCancelKey);
|
Console.CancelKeyPress += new ConsoleCancelEventHandler(OnCancelKey);
|
||||||
|
|
||||||
CheckDirectories();
|
CheckDirectories();
|
||||||
|
|
||||||
ServerManager = ApplicationManager.GetInstance();
|
ServerManager = ApplicationManager.GetInstance();
|
||||||
Localization.Configure.Initialize(ServerManager.GetApplicationSettings().Configuration()?.CustomLocale);
|
Localization.Configure.Initialize(ServerManager.GetApplicationSettings().Configuration()?.CustomLocale);
|
||||||
loc = Utilities.CurrentLocalization.LocalizationIndex;
|
|
||||||
|
|
||||||
ServerManager.Logger.WriteInfo($"Version is {Version}");
|
ServerManager.Logger.WriteInfo($"Version is {Version}");
|
||||||
|
|
||||||
@ -148,7 +149,7 @@ namespace IW4MAdmin.Application
|
|||||||
{
|
{
|
||||||
e = e.InnerException;
|
e = e.InnerException;
|
||||||
}
|
}
|
||||||
Console.WriteLine($"Exception: {e.Message}");
|
Console.WriteLine(e.Message);
|
||||||
Console.WriteLine(loc["MANAGER_EXIT"]);
|
Console.WriteLine(loc["MANAGER_EXIT"]);
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
return;
|
return;
|
||||||
|
@ -33,21 +33,30 @@ namespace IW4MAdmin
|
|||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
// todo: make this better with collisions
|
if (GameName == Game.IW4)
|
||||||
int id = Math.Abs($"{IP}:{Port.ToString()}".Select(a => (int)a).Sum());
|
|
||||||
|
|
||||||
// hack: this is a nasty fix for get hashcode being changed
|
|
||||||
switch (id)
|
|
||||||
{
|
{
|
||||||
case 765:
|
// todo: make this better with collisions
|
||||||
return 886229536;
|
int id = Math.Abs($"{IP}:{Port.ToString()}".Select(a => (int)a).Sum());
|
||||||
case 760:
|
|
||||||
return 1645744423;
|
// hack: this is a nasty fix for get hashcode being changed
|
||||||
case 761:
|
switch (id)
|
||||||
return 1645809959;
|
{
|
||||||
|
case 765:
|
||||||
|
return 886229536;
|
||||||
|
case 760:
|
||||||
|
return 1645744423;
|
||||||
|
case 761:
|
||||||
|
return 1645809959;
|
||||||
|
}
|
||||||
|
|
||||||
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return id;
|
else
|
||||||
|
{
|
||||||
|
int id = HashCode.Combine(IP, Port);
|
||||||
|
return id < 0 ? Math.Abs(id) : id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task OnPlayerJoined(Player logClient)
|
public async Task OnPlayerJoined(Player logClient)
|
||||||
|
8
RunPublishRelease.cmd
Normal file
8
RunPublishRelease.cmd
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
dotnet publish WebfrontCore/WebfrontCore.csproj -c Release -o C:\Projects\IW4M-Admin\Publish\Windows
|
||||||
|
dotnet publish Application/Application.csproj -c Release -o C:\Projects\IW4M-Admin\Publish\Windows
|
||||||
|
dotnet publish GameLogServer/GameLogServer.pyproj -c Release -o C:\Projects\IW4M-Admin\Publish\Windows\GameLogServer
|
||||||
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
|
||||||
|
msbuild GameLogServer/GameLogServer.pyproj /p:PublishProfile=Stable /p:DeployOnBuild=true /p:PublishProfileRootFolder=C:\Projects\IW4M-Admin\GameLogServer\
|
||||||
|
msbuild DiscordWebhook/DiscordWebhook.pyproj /p:PublishProfile=Stable /p:DeployOnBuild=true /p:PublishProfileRootFolder=C:\Projects\IW4M-Admin\DiscordWebhook\
|
||||||
|
cd "C:\Projects\IW4M-Admin\DEPLOY\"
|
||||||
|
PowerShell ".\upload_release.ps1"
|
Loading…
Reference in New Issue
Block a user