tgstation-server 5.12.7
The /tg/station 13 server suite
Loading...
Searching...
No Matches
RuntimeInformation.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4
9
11{
15 public sealed class RuntimeInformation : ChatUpdate
16 {
20 public Version ServerVersion { get; }
21
25 public ushort ServerPort { get; }
26
30 public bool ApiValidateOnly { get; }
31
35 public string InstanceName { get; set; }
36
41
46
51
55 public IReadOnlyCollection<TestMergeInformation> TestMerges { get; }
56
69 IChatTrackingContext chatTrackingContext,
70 IDmbProvider dmbProvider,
71 Version serverVersion,
72 string instanceName,
73 DreamDaemonSecurity? securityLevel,
74 DreamDaemonVisibility? visibility,
75 ushort serverPort,
76 bool apiValidateOnly)
77 : base(chatTrackingContext?.Channels ?? throw new ArgumentNullException(nameof(chatTrackingContext)))
78 {
79 ArgumentNullException.ThrowIfNull(dmbProvider);
80
81 ServerVersion = serverVersion ?? throw new ArgumentNullException(nameof(serverVersion));
82
84 {
85 CommitSha = dmbProvider.CompileJob.RevisionInformation.CommitSha,
86 Timestamp = dmbProvider.CompileJob.RevisionInformation.Timestamp,
87 OriginCommitSha = dmbProvider.CompileJob.RevisionInformation.OriginCommitSha,
88 };
89
90 TestMerges = (IReadOnlyCollection<TestMergeInformation>)dmbProvider
91 .CompileJob
93 .ActiveTestMerges?
94 .Select(x => x.TestMerge)
95 .Select(x => new TestMergeInformation(x, Revision))
96 .ToList()
97 ?? Array.Empty<TestMergeInformation>();
98
99 InstanceName = instanceName ?? throw new ArgumentNullException(nameof(instanceName));
100 SecurityLevel = securityLevel;
101 Visibility = visibility;
102 ServerPort = serverPort;
103 ApiValidateOnly = apiValidateOnly;
104 }
105 }
106}
Represents information about a current git revison.
Representation of the initial data passed as part of a BridgeCommandType.Startup request.
IReadOnlyCollection< TestMergeInformation > TestMerges
The TestMergeInformations in the launch.
RuntimeInformation(IChatTrackingContext chatTrackingContext, IDmbProvider dmbProvider, Version serverVersion, string instanceName, DreamDaemonSecurity? securityLevel, DreamDaemonVisibility? visibility, ushort serverPort, bool apiValidateOnly)
Initializes a new instance of the RuntimeInformation class.
ushort ServerPort
The port the HTTP server is running on.
Version ServerVersion
The IAssemblyInformationProvider.Version.
Api.Models.Internal.RevisionInformation Revision
The Api.Models.Internal.RevisionInformation of the launch.
DreamDaemonSecurity? SecurityLevel
The DreamDaemonSecurity level of the launch.
string InstanceName
The NamedEntity.Name of the owner at the time of launch.
bool ApiValidateOnly
If DD should just respond if it's API is working and then exit.
DreamDaemonVisibility? Visibility
The DreamDaemonSecurity level of the launch.
This model mirrors /datum/tgs_revision_information/test_merge.
Represents an update of ChannelRepresentations.
Definition: ChatUpdate.cs:13
IEnumerable< ChannelRepresentation > Channels
The IEnumerable<T> of ChannelRepresentations.
Definition: ChatUpdate.cs:17
Represents a tracking of dynamic chat json files.
Provides absolute paths to the latest compiled .dmbs.
Definition: IDmbProvider.cs:11
CompileJob CompileJob
The CompileJob of the .dmb.
Definition: IDmbProvider.cs:25
DreamDaemonVisibility
The visibility setting for DreamDaemon.
DreamDaemonSecurity
DreamDaemon's security level.