2using System.Collections.Generic;
3using System.Globalization;
4using System.Threading.Tasks;
54 return securityLevel
switch
56 DreamDaemonSecurity.Safe =>
"safe",
57 DreamDaemonSecurity.Trusted =>
"trusted",
58 DreamDaemonSecurity.Ultrasafe =>
"ultrasafe",
59 _ =>
throw new ArgumentOutOfRangeException(nameof(securityLevel), securityLevel, String.Format(CultureInfo.InvariantCulture,
"Bad DreamDaemon security level: {0}", securityLevel)),
70 return visibility
switch
72 DreamDaemonVisibility.Public =>
"public",
73 DreamDaemonVisibility.Private =>
"private",
74 DreamDaemonVisibility.Invisible =>
"invisible",
75 _ =>
throw new ArgumentOutOfRangeException(nameof(visibility), visibility, String.Format(CultureInfo.InvariantCulture,
"Bad DreamDaemon visibility level: {0}", visibility)),
91 Task installationTask,
93 string dreamDaemonPath,
94 string dreamMakerPath,
97 : base(installationIOManager)
99 InstallationTask = installationTask ??
throw new ArgumentNullException(nameof(installationTask));
100 ArgumentNullException.ThrowIfNull(version);
103 throw new ArgumentException($
"Invalid EngineType: {version.Engine}", nameof(version));
105 Version = version ??
throw new ArgumentNullException(nameof(version));
106 ServerExePath = dreamDaemonPath ??
throw new ArgumentNullException(nameof(dreamDaemonPath));
107 CompilerExePath = dreamMakerPath ??
throw new ArgumentNullException(nameof(dreamMakerPath));
116 IReadOnlyDictionary<string, string> parameters,
120 ArgumentNullException.ThrowIfNull(dmbProvider);
121 ArgumentNullException.ThrowIfNull(parameters);
122 ArgumentNullException.ThrowIfNull(launchParameters);
126 var arguments = String.Format(
127 CultureInfo.InvariantCulture,
128 "\"{0}\" -port {1} -ports 1-65535 {2}-close -verbose -{3} -{4}{5}{6}{7} -params \"{8}\"",
130 launchParameters.
Port!.Value,
137 ? $
" -logself -log {logFilePath}"
143 ? $
" -map-threads {launchParameters.MapThreads.Value}"
152 if (String.IsNullOrWhiteSpace(additionalArguments))
153 additionalArguments = String.Empty;
155 additionalArguments = $
"{additionalArguments.Trim()} ";
157 return $
"-clean {additionalArguments}\"{dmePath ?? throw new ArgumentNullException(nameof(dmePath))}\"";
Information about an engine installation.
EngineType? Engine
The EngineType.
Launch settings for DreamDaemon.
ushort? Port
The port DreamDaemon uses. This should be publically accessible.
DreamDaemonVisibility? Visibility
The DreamDaemonVisibility level of DreamDaemon. No-op for EngineType.OpenDream.
bool? AllowWebClient
If the BYOND web client can be used to connect to the game server. No-op for EngineType....
bool? StartProfiler
If -profile is passed in on the DreamDaemon command line. No-op for EngineType.OpenDream.
DreamDaemonSecurity? SecurityLevel
The DreamDaemonSecurity level of DreamDaemon. No-op for EngineType.OpenDream.
uint? MapThreads
If DreamDaemon supports it, the value added as the -map-threads parameter. 0 uses the default BYOND v...
Implementation of IEngineInstallation for EngineType.Byond.
readonly bool supportsMapThreads
If map threads are supported by the Version.
override bool PromptsForNetworkAccess
If ServerExePath may create network prompts.
static string VisibilityWord(DreamDaemonVisibility visibility)
Change a given visibility into the appropriate DreamDaemon command line word.
static string SecurityWord(DreamDaemonSecurity securityLevel)
Change a given securityLevel into the appropriate DreamDaemon command line word.
override string ServerExePath
The full path to the game server executable.
override string FormatCompilerArguments(string dmePath, string? additionalArguments)
Return the command line arguments for compiling a given dmePath if compilation is necessary....
override Task InstallationTask
The Task that completes when the BYOND version finished installing.
override bool UseDotnetDump
If dotnet-dump should be used to create process dumps for this installation.
ByondInstallation(IIOManager installationIOManager, Task installationTask, EngineVersion version, string dreamDaemonPath, string dreamMakerPath, bool supportsCli, bool supportsMapThreads)
Initializes a new instance of the ByondInstallation class.
override string FormatServerArguments(IDmbProvider dmbProvider, IReadOnlyDictionary< string, string > parameters, DreamDaemonLaunchParameters launchParameters, string? logFilePath)
Return the command line arguments for launching with given launchParameters .The formatted arguments ...
override bool HasStandardOutput
If ServerExePath supports being run as a command-line application and outputs log information to be c...
override EngineVersion Version
The EngineVersion of the IEngineInstallation.
override bool PreferFileLogging
If HasStandardOutput is set, this indicates that the engine server has good file logging that should ...
override string CompilerExePath
The full path to the dm/DreamMaker executable.
static string EncodeParameters(IReadOnlyDictionary< string, string > parameters, DreamDaemonLaunchParameters launchParameters)
Encode given parameters for passing as world.params on the command line.
Provides absolute paths to the latest compiled .dmbs.
string DmbName
The file name of the .dmb.
Interface for using filesystems.
DreamDaemonVisibility
The visibility setting for DreamDaemon.
DreamDaemonSecurity
DreamDaemon's security level.
EngineType
The type of engine the codebase is using.