-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't blow up on CooldownGroup null/DbGuidId missing (#1965)
* feat: automatic database migration via command line flag missed migration string * fix game database migration for sqlite * fixed player db migration - added more logging - made it easier to debug
- Loading branch information
Showing
7 changed files
with
197 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,58 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
using CommandLine; | ||
|
||
using CommandLine; | ||
using Intersect.Core; | ||
using Intersect.Network; | ||
|
||
namespace Intersect.Server.Core | ||
{ | ||
namespace Intersect.Server.Core; | ||
|
||
internal partial struct ServerCommandLineOptions : ICommandLineOptions | ||
internal struct ServerCommandLineOptions : ICommandLineOptions | ||
{ | ||
public ServerCommandLineOptions( | ||
bool doNotShowConsole, | ||
bool doNotHaltOnError, | ||
bool migrateAutomatically, | ||
bool noNatPunchthrough, | ||
bool noNetworkCheck, | ||
ushort port, | ||
string workingDirectory, | ||
IEnumerable<string> pluginDirectories | ||
) | ||
{ | ||
DoNotShowConsole = doNotShowConsole; | ||
DoNotHaltOnError = doNotHaltOnError; | ||
MigrateAutomatically = migrateAutomatically; | ||
NoNatPunchthrough = noNatPunchthrough; | ||
NoNetworkCheck = noNetworkCheck; | ||
Port = port; | ||
WorkingDirectory = workingDirectory; | ||
PluginDirectories = pluginDirectories?.Select(Path.GetFullPath).ToArray(); | ||
} | ||
|
||
public ServerCommandLineOptions( | ||
bool doNotShowConsole, | ||
bool doNotHaltOnError, | ||
bool noNatPunchthrough, | ||
bool noNetworkCheck, | ||
ushort port, | ||
ushort apiport, | ||
string workingDirectory, | ||
IEnumerable<string> pluginDirectories | ||
) | ||
{ | ||
DoNotShowConsole = doNotShowConsole; | ||
DoNotHaltOnError = doNotHaltOnError; | ||
NoNatPunchthrough = noNatPunchthrough; | ||
NoNetworkCheck = noNetworkCheck; | ||
Port = port; | ||
ApiPort = apiport; | ||
WorkingDirectory = workingDirectory; | ||
PluginDirectories = pluginDirectories?.Select(Path.GetFullPath).ToArray(); | ||
} | ||
|
||
[Option('C', "no-console", Default = false, Required = false)] | ||
public bool DoNotShowConsole { get; } | ||
|
||
[Option('H', "no-halt", Default = false, Required = false)] | ||
public bool DoNotHaltOnError { get; } | ||
|
||
[Option('U', "no-upnp", Default = false, Required = false)] | ||
public bool NoNatPunchthrough { get; } | ||
[Option('C', "no-console", Default = false, Required = false)] | ||
public bool DoNotShowConsole { get; } | ||
|
||
[Option('P', "no-port-check", Default = false, Required = false)] | ||
public bool NoNetworkCheck { get; } | ||
[Option('H', "no-halt", Default = false, Required = false)] | ||
public bool DoNotHaltOnError { get; } | ||
|
||
[Option('p', "port", Default = (ushort) 0, Required = false)] | ||
public ushort Port { get; } | ||
[Option('m', "migrate-automatically", Default = false, Required = false)] | ||
public bool MigrateAutomatically { get; } | ||
|
||
[Option('a', "apiport", Default = (ushort) 0, Required = false)] | ||
public ushort ApiPort { get; } | ||
[Option('U', "no-upnp", Default = false, Required = false)] | ||
public bool NoNatPunchthrough { get; } | ||
|
||
[Option("working-directory", Default = null, Required = false)] | ||
public string WorkingDirectory { get; } | ||
[Option('P', "no-port-check", Default = false, Required = false)] | ||
public bool NoNetworkCheck { get; } | ||
|
||
[Option('p', "plugin-directory", Default = null, Required = false)] | ||
public IEnumerable<string> PluginDirectories { get; } | ||
[Option('p', "port", Default = (ushort)0, Required = false)] | ||
public ushort Port { get; } | ||
|
||
public ushort ValidPort(ushort defaultPort) | ||
{ | ||
return PortHelper.IsValidPort(Port) ? Port : defaultPort; | ||
} | ||
[Option("working-directory", Default = null, Required = false)] | ||
public string WorkingDirectory { get; } | ||
|
||
public ushort ValidApiPort(ushort defaultApiPort) | ||
{ | ||
return PortHelper.IsValidPort(defaultApiPort) ? ApiPort : defaultApiPort; | ||
} | ||
[Option('p', "plugin-directory", Default = null, Required = false)] | ||
public IEnumerable<string> PluginDirectories { get; } | ||
|
||
public ushort ValidPort(ushort defaultPort) | ||
{ | ||
return PortHelper.IsValidPort(Port) ? Port : defaultPort; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.