tgstation-server 6.12.0
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
5using Newtonsoft.Json;
6
11
13{
17 public sealed class RuntimeInformation : ChatUpdate
18 {
22 public Version ServerVersion { get; }
23
27 public ushort ServerPort { get; }
28
32 public bool ApiValidateOnly { get; }
33
37 public string InstanceName { get; set; }
38
43
47 [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)]
49
53 [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)]
55
59 public IReadOnlyCollection<TestMergeInformation> TestMerges { get; }
60
73 IChatTrackingContext chatTrackingContext,
74 IDmbProvider dmbProvider,
75 Version serverVersion,
76 string instanceName,
77 DreamDaemonSecurity securityLevel,
78 DreamDaemonVisibility visibility,
79 ushort serverPort,
80 bool apiValidateOnly)
81 : base(chatTrackingContext?.Channels ?? throw new ArgumentNullException(nameof(chatTrackingContext)))
82 {
83 ArgumentNullException.ThrowIfNull(dmbProvider);
84
85 ServerVersion = serverVersion ?? throw new ArgumentNullException(nameof(serverVersion));
86
88 {
89 CommitSha = dmbProvider.CompileJob.RevisionInformation.CommitSha,
90 Timestamp = dmbProvider.CompileJob.RevisionInformation.Timestamp,
91 OriginCommitSha = dmbProvider.CompileJob.RevisionInformation.OriginCommitSha,
92 };
93
94 TestMerges = (IReadOnlyCollection<TestMergeInformation>?)dmbProvider
95 .CompileJob
97 .ActiveTestMerges
98 ?.Select(x => x.TestMerge)
99 .Select(x => new TestMergeInformation(x, Revision))
100 .ToList()
101 ?? Array.Empty<TestMergeInformation>();
102
103 InstanceName = instanceName ?? throw new ArgumentNullException(nameof(instanceName));
104 SecurityLevel = securityLevel;
105 Visibility = visibility;
106 ServerPort = serverPort;
107 ApiValidateOnly = apiValidateOnly;
108 }
109 }
110}
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.
Version ServerVersion
The IAssemblyInformationProvider.Version.
DreamDaemonVisibility Visibility
The DreamDaemonSecurity level of the launch.
Api.Models.Internal.RevisionInformation Revision
The Api.Models.Internal.RevisionInformation of 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.
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.
DreamDaemonSecurity SecurityLevel
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.
Models.CompileJob CompileJob
The CompileJob of the .dmb.
DreamDaemonVisibility
The visibility setting for DreamDaemon.
DreamDaemonSecurity
DreamDaemon's security level.