Refactor and fix #56

This commit is contained in:
Evil Factory
2022-04-15 19:05:24 -03:00
parent 6eb575ea81
commit 42df433d3e
35 changed files with 144 additions and 97 deletions
@@ -27,7 +27,17 @@ namespace Barotrauma
string[] filesToUpdate = new string[]
{
"Barotrauma.dll", "Barotrauma.deps.json",
"0harmony.dll", "MoonSharp.Interpreter.dll",
"0harmony.dll", "Mono.Cecil.dll",
"Mono.Cecil.Mdb.dll", "Mono.Cecil.Pdb.dll",
"Mono.Cecil.Rocks.dll", "MonoMod.Common.dll",
"MoonSharp.Interpreter.dll",
"mscordaccore_amd64_amd64_4.700.22.11601.dll",
"Microsoft.CodeAnalysis.dll", "Microsoft.CodeAnalysis.CSharp.dll",
"Microsoft.CodeAnalysis.CSharp.Scripting.dll", "Microsoft.CodeAnalysis.Scripting.dll",
"System.Reflection.Metadata.dll", "System.Collections.Immutable.dll",
"System.Runtime.CompilerServices.Unsafe.dll"
};
@@ -690,7 +690,7 @@ namespace Barotrauma.Networking
{
ServerPacketHeader header = (ServerPacketHeader)inc.ReadByte();
GameMain.LuaCs.networking.NetMessageReceived(inc, header);
GameMain.LuaCs.Networking.NetMessageReceived(inc, header);
if (roundInitStatus != RoundInitStatus.Started &&
roundInitStatus != RoundInitStatus.NotStarted &&
@@ -413,17 +413,23 @@ namespace Barotrauma
{
msg.Close();
string[] filesToRemove = new string[]
{
"Barotrauma.dll", "Barotrauma.deps.json",
"System.Reflection.Metadata.dll", "System.Collections.Immutable.dll",
"System.Runtime.CompilerServices.Unsafe.dll"
};
try
{
System.IO.File.Move("Barotrauma.dll", "Barotrauma.dll.todelete", true);
System.IO.File.Move("Barotrauma.deps.json", "Barotrauma.deps.json.todelete", true);
System.IO.File.Move("Barotrauma.dll.old", "Barotrauma.dll", true);
System.IO.File.Move("Barotrauma.deps.json.old", "Barotrauma.deps.json", true);
}catch(Exception e)
foreach (string file in filesToRemove)
{
System.IO.File.Move(file, file + ".todelete", true);
System.IO.File.Move(file + ".old", file, true);
}
}
catch(Exception e)
{
new GUIMessageBox("Error", "Error: " + e.ToString());
new GUIMessageBox("Error", $"{e} {e.InnerException}");
return false;
}
@@ -13,6 +13,7 @@
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
<Configurations>Debug;Release;Unstable</Configurations>
<WarningsAsErrors>;NU1605;CS0114;CS0108CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
<!--
@@ -133,7 +134,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="MonoMod.Common" Version="22.1.20.1" />
<PackageReference Include="MonoMod.Common" Version="22.3.24.1" />
<PackageReference Include="NVorbis" Version="0.8.6" />
<PackageReference Include="RestSharp" Version="106.13.0" />
</ItemGroup>
@@ -13,6 +13,7 @@
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
<Configurations>Debug;Release;Unstable</Configurations>
<WarningsAsErrors>;NU1605;CS0114;CS0108CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -127,6 +128,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="MonoMod.Common" Version="22.1.20.1" />
<PackageReference Include="NVorbis" Version="0.8.6" />
<PackageReference Include="RestSharp" Version="106.13.0" />
@@ -14,6 +14,7 @@
<Configurations>Debug;Release;Unstable</Configurations>
<ApplicationManifest>app.manifest</ApplicationManifest>
<WarningsAsErrors>;NU1605;CS0114;CS0108CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -138,7 +139,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="MonoMod.Common" Version="22.1.20.1" />
<PackageReference Include="MonoMod.Common" Version="22.3.24.1" />
<PackageReference Include="NVorbis" Version="0.8.6" />
<PackageReference Include="RestSharp" Version="106.13.0" />
</ItemGroup>