Skip to content

Commit

Permalink
Add try catch in runAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Killers0992 committed Aug 18, 2024
1 parent 0e47164 commit 3cac5fc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
11 changes: 9 additions & 2 deletions XProxy.Core/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using XProxy.Services;
using XProxy.Shared.Models;

[assembly: AssemblyVersion("1.3.8")]
[assembly: AssemblyVersion("1.3.9")]

namespace XProxy
{
Expand Down Expand Up @@ -88,7 +88,14 @@ static async Task RunApplication(HostApplicationBuilder app)

IHost host = app.Build();

await host.RunAsync();
try
{
await host.RunAsync();
}
catch (Exception ex)
{
Logger.Error(ex, "XProxy");
}
}
}
}
16 changes: 8 additions & 8 deletions XProxy.Core/Services/ListService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ async Task DoCycle()
{ "privateBeta", "false" },
{ "staffRA", "false" },
{ "friendlyFire", "false" },
{ "geoblocking", $"{(byte)0}" },
{ "geoblocking", "0" },
{ "modded", "true" },
{ "cgs", "true" },
{ "whitelist", "false" },
Expand All @@ -395,13 +395,13 @@ async Task DoCycle()
} :
new Dictionary<string, string>()
{
{ "ip", PublicIp },
{ "players", playersStr },
{ "newPlayers", str },
{ "port", $"{_config.Value.Port}" },
{ "version", "2" },
{ "enforceSameIp", "true" },
{ "enforceSameAsn", "true" }
{ "ip", PublicIp },
{ "players", playersStr },
{ "newPlayers", str },
{ "port", $"{_config.Value.Port}" },
{ "version", "2" },
{ "enforceSameIp", "true" },
{ "enforceSameAsn", "true" }
};

if (!string.IsNullOrEmpty(Password))
Expand Down
2 changes: 1 addition & 1 deletion XProxy.Shared/releaseInfo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.killers0992.xproxy",
"displayName": "XProxy",
"version": "1.3.8",
"version": "1.3.9",
"buildType": "release",
"gameVersion": "13.5.1"
}

0 comments on commit 3cac5fc

Please sign in to comment.