tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
DmbProvider.cs
Go to the documentation of this file.
1using System;
2using System.Threading.Tasks;
3
8
10{
13 {
15 public override string Directory => ioManager.ResolvePath(CompileJob.DirectoryName!.Value.ToString() + directoryAppend);
16
18 public override Models.CompileJob CompileJob { get; }
19
21 public override EngineVersion EngineVersion { get; }
22
27
31 readonly string directoryAppend;
32
37
46 public DmbProvider(Models.CompileJob compileJob, EngineVersion engineVersion, IIOManager ioManager, DisposeInvoker onDispose, string? directoryAppend = null)
47 {
48 CompileJob = compileJob ?? throw new ArgumentNullException(nameof(compileJob));
49 EngineVersion = engineVersion ?? throw new ArgumentNullException(nameof(engineVersion));
50 this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
51 this.onDispose = onDispose ?? throw new ArgumentNullException(nameof(onDispose));
52 this.directoryAppend = directoryAppend ?? String.Empty;
53 }
54
56 public override ValueTask DisposeAsync()
57 {
59 return ValueTask.CompletedTask;
60 }
61
63 public override void KeepAlive() => onDispose = null;
64 }
65}
Information about an engine installation.
Guid? DirectoryName
The Game folder the results were compiled into.
Definition CompileJob.cs:28
readonly IIOManager ioManager
The IIOManager for the DmbProvider.
override void KeepAlive()
Disposing the IDmbProvider won't cause a cleanup of the working directory.
readonly string directoryAppend
Extra path to add to the end of CompileJob.DirectoryName.
DisposeInvoker? onDispose
The Action to run when DisposeAsync is called.
override string Directory
The primary game directory.
DmbProvider(Models.CompileJob compileJob, EngineVersion engineVersion, IIOManager ioManager, DisposeInvoker onDispose, string? directoryAppend=null)
Initializes a new instance of the DmbProvider class.
Runs a given disposeAction on Dispose.
Provides absolute paths to the latest compiled .dmbs.
Interface for using filesystems.
Definition IIOManager.cs:13
string ResolvePath()
Retrieve the full path of the current working directory.