mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 07:04:57 +01:00
Rename ServerInstance to Instance
This commit is contained in:
@@ -20,7 +20,7 @@ namespace TGS.Server.ChatCommands
|
||||
/// <summary>
|
||||
/// Shorthand for accessing <see cref="CommandInfo.Server"/>
|
||||
/// </summary>
|
||||
protected ServerInstance Instance { get { return CommandInfo.Value.Server; } }
|
||||
protected Instance Instance { get { return CommandInfo.Value.Server; } }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ExitCode DoRun(IList<string> parameters)
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
/// </summary>
|
||||
public string Speaker { get; set; }
|
||||
/// <summary>
|
||||
/// A reference to the <see cref="ServerInstance"/> that runs the <see cref="ChatProviders.IChatProvider"/> that heard the <see cref="ChatCommand"/>
|
||||
/// A reference to the <see cref="Instance"/> that runs the <see cref="ChatProviders.IChatProvider"/> that heard the <see cref="ChatCommand"/>
|
||||
/// </summary>
|
||||
public ServerInstance Server { get; set; }
|
||||
public Instance Server { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TGS.Server
|
||||
class DeprecatedInstanceConfig : InstanceConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The default <see cref="ServerInstance"/> directory
|
||||
/// The default <see cref="Instance"/> directory
|
||||
/// </summary>
|
||||
const string DefaultInstallationPath = "C:\\tgstation-server-3";
|
||||
|
||||
@@ -94,9 +94,9 @@ namespace TGS.Server
|
||||
public DeprecatedInstanceConfig() : base(DefaultInstallationPath) { }
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="DeprecatedInstanceConfig"/> for a <see cref="ServerInstance"/> at <paramref name="path"/>
|
||||
/// Construct a <see cref="DeprecatedInstanceConfig"/> for a <see cref="Instance"/> at <paramref name="path"/>
|
||||
/// </summary>
|
||||
/// <param name="path">The path to the <see cref="ServerInstance"/></param>
|
||||
/// <param name="path">The path to the <see cref="Instance"/></param>
|
||||
public DeprecatedInstanceConfig(string path) : base(path) { }
|
||||
|
||||
/// <summary>
|
||||
|
||||
+14
-14
@@ -3,7 +3,7 @@
|
||||
namespace TGS.Server
|
||||
{
|
||||
/// <summary>
|
||||
/// Various events and their IDs in no particular order. Found in the Windows event log. These key incremented by 100 and are guaranteed to never be reused in the future. In the windows event viewer, these IDs will be offset by the <see cref="ServerInstance.LoggingID"/> to distinguish events between instances. Each event ID may be information, a warning, or error and will be documented accordingly. Warnings will occur due to user, data, or network errors. Errors will occur due to filesystem errors or hard faults
|
||||
/// Various events and their IDs in no particular order. Found in the Windows event log. These key incremented by 100 and are guaranteed to never be reused in the future. In the windows event viewer, these IDs will be offset by the <see cref="Instance.LoggingID"/> to distinguish events between instances. Each event ID may be information, a warning, or error and will be documented accordingly. Warnings will occur due to user, data, or network errors. Errors will occur due to filesystem errors or hard faults
|
||||
/// </summary>
|
||||
public enum EventID : int
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
BYONDUpdateFail = 600,
|
||||
/// <summary>
|
||||
/// Info: When the BYOND updater successfully staged a revision but could not apply it due to the <see cref="ServerInstance"/> being active
|
||||
/// Info: When the BYOND updater successfully staged a revision but could not apply it due to the <see cref="Instance"/> being active
|
||||
/// </summary>
|
||||
BYONDUpdateStaged = 700,
|
||||
/// <summary>
|
||||
@@ -41,7 +41,7 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
BYONDUpdateComplete = 800,
|
||||
/// <summary>
|
||||
/// Error: Failed to move the <see cref="ServerInstance"/> with TGS.Interface.Components.ITGAdministration.MoveServer(string)
|
||||
/// Error: Failed to move the <see cref="Instance"/> with TGS.Interface.Components.ITGAdministration.MoveServer(string)
|
||||
/// </summary>
|
||||
[Obsolete("Not in use anymore", true)]
|
||||
ServerMoveFailed = 900,
|
||||
@@ -143,7 +143,7 @@ namespace TGS.Server
|
||||
[Obsolete("Not in use anymore", true)]
|
||||
TopicFailed = 3100,
|
||||
/// <summary>
|
||||
/// Info: When the <see cref="ServerInstance.serviceCommsKey"/> has been generated
|
||||
/// Info: When the <see cref="Instance.serviceCommsKey"/> has been generated
|
||||
/// </summary>
|
||||
CommsKeySet = 3200,
|
||||
/// <summary>
|
||||
@@ -225,11 +225,11 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
RepoPRMergeFail = 5100,
|
||||
/// <summary>
|
||||
/// Info: Successfully committed the paths specified in the synchronize_directories field of the <see cref="ServerInstance"/>'s TGS3.json
|
||||
/// Info: Successfully committed the paths specified in the synchronize_directories field of the <see cref="Instance"/>'s TGS3.json
|
||||
/// </summary>
|
||||
RepoCommit = 5200,
|
||||
/// <summary>
|
||||
/// Warning: An error occurred while committing the paths specified in the synchronize_directories field of the <see cref="ServerInstance"/>'s TGS3.json
|
||||
/// Warning: An error occurred while committing the paths specified in the synchronize_directories field of the <see cref="Instance"/>'s TGS3.json
|
||||
/// </summary>
|
||||
RepoCommitFail = 5300,
|
||||
/// <summary>
|
||||
@@ -249,15 +249,15 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
RepoChangelogFail = 5700,
|
||||
/// <summary>
|
||||
/// Info: When the <see cref="TGS.Interface"/> dll is updated for the <see cref="ServerInstance"/>
|
||||
/// Info: When the <see cref="TGS.Interface"/> dll is updated for the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
BridgeDLLUpdated = 5800,
|
||||
/// <summary>
|
||||
/// Error: An error occurred while updating the <see cref="TGS.Interface"/> dll for the <see cref="ServerInstance"/>
|
||||
/// Error: An error occurred while updating the <see cref="TGS.Interface"/> dll for the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
BridgeDLLUpdateFail = 5900,
|
||||
/// <summary>
|
||||
/// Error: An error occurred while starting the <see cref="ServerInstance"/>
|
||||
/// Error: An error occurred while starting the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
InstanceInitializationFailure = 6000,
|
||||
/// <summary>
|
||||
@@ -265,15 +265,15 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
ServiceShutdownFail = 6100,
|
||||
/// <summary>
|
||||
/// Info: When the <see cref="ServerInstance"/> reboots in BYOND
|
||||
/// Info: When the <see cref="Instance"/> reboots in BYOND
|
||||
/// </summary>
|
||||
WorldReboot = 6200,
|
||||
/// <summary>
|
||||
/// Info: When the output of <see cref="TGS.Interface.Components.ITGCompiler.Compile(bool)"/> is applied to the live <see cref="ServerInstance"/>
|
||||
/// Info: When the output of <see cref="TGS.Interface.Components.ITGCompiler.Compile(bool)"/> is applied to the live <see cref="Instance"/>
|
||||
/// </summary>
|
||||
ServerUpdateApplied = 6300,
|
||||
/// <summary>
|
||||
/// Warning: When an exception occurs during a <see cref="ServerInstance.SendMessage(string, MessageType)"/> operation
|
||||
/// Warning: When an exception occurs during a <see cref="Instance.SendMessage(string, MessageType)"/> operation
|
||||
/// </summary>
|
||||
ChatBroadcastFail = 6400,
|
||||
/// <summary>
|
||||
@@ -287,7 +287,7 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
Submodule = 6600,
|
||||
/// <summary>
|
||||
/// This event is of type <see cref="System.Diagnostics.EventLogEntryType.SuccessAudit"/> or <see cref="System.Diagnostics.EventLogEntryType.FailureAudit"/>. It occurs when a user different from the previous one tries and either succeeds or fails to access a <see cref="ServerInstance"/>. DreamDaemon itself successfully accessing <see cref="TGS.Interface.Components.ITGInterop"/> will not trigger this
|
||||
/// This event is of type <see cref="System.Diagnostics.EventLogEntryType.SuccessAudit"/> or <see cref="System.Diagnostics.EventLogEntryType.FailureAudit"/>. It occurs when a user different from the previous one tries and either succeeds or fails to access a <see cref="Instance"/>. DreamDaemon itself successfully accessing <see cref="TGS.Interface.Components.ITGInterop"/> will not trigger this
|
||||
/// </summary>
|
||||
Authentication = 6700,
|
||||
/// <summary>
|
||||
@@ -303,7 +303,7 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
InteropCallException = 7000,
|
||||
/// <summary>
|
||||
/// Warning: When the running DreamDaemon code does not have the correct API to talk to the <see cref="ServerInstance"/>
|
||||
/// Warning: When the running DreamDaemon code does not have the correct API to talk to the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
APIVersionMismatch = 7100,
|
||||
/// <summary>
|
||||
|
||||
@@ -10,10 +10,10 @@ namespace TGS.Server
|
||||
{
|
||||
//note this only works with MACHINE LOCAL groups and admins for now
|
||||
//if someone wants AD shit, code it yourself
|
||||
sealed partial class ServerInstance : ServiceAuthorizationManager, ITGAdministration
|
||||
sealed partial class Instance : ServiceAuthorizationManager, ITGAdministration
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="SecurityIdentifier"/> of the Windows group authorized to access the <see cref="ServerInstance"/>
|
||||
/// The <see cref="SecurityIdentifier"/> of the Windows group authorized to access the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
SecurityIdentifier TheDroidsWereLookingFor;
|
||||
/// <summary>
|
||||
@@ -21,7 +21,7 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
object authLock = new object();
|
||||
/// <summary>
|
||||
/// The <see cref="WindowsIdentity.Name"/> of the last <see cref="WindowsIdentity"/> to attempt to access the <see cref="ServerInstance"/>
|
||||
/// The <see cref="WindowsIdentity.Name"/> of the last <see cref="WindowsIdentity"/> to attempt to access the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
string LastSeenUser;
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
/// <param name="search">The name of the group to search for</param>
|
||||
/// <param name="useDomain">Recursive parameter used to check for the group using <see cref="ContextType.Domain"/> instead of <see cref="ContextType.Machine"/></param>
|
||||
/// <returns>The name of the group allowed to access the <see cref="ServerInstance"/> if it could be found, <see langword="null"/> otherwise</returns>
|
||||
/// <returns>The name of the group allowed to access the <see cref="Instance"/> if it could be found, <see langword="null"/> otherwise</returns>
|
||||
string FindTheDroidsWereLookingFor(string search = null, bool useDomain = false)
|
||||
{
|
||||
RootAuthorizationManager.InstanceAuthManagers.Add(this);
|
||||
@@ -10,7 +10,7 @@ using TGS.Interface.Components;
|
||||
|
||||
namespace TGS.Server
|
||||
{
|
||||
sealed partial class ServerInstance : ITGByond
|
||||
sealed partial class Instance : ITGByond
|
||||
{
|
||||
/// <summary>
|
||||
/// The instance directory to store the BYOND installation
|
||||
@@ -72,7 +72,7 @@ namespace TGS.Server
|
||||
Thread RevisionStaging;
|
||||
|
||||
/// <summary>
|
||||
/// Called when the <see cref="ServerInstance"/> is setup. Prepares the BYOND updater
|
||||
/// Called when the <see cref="Instance"/> is setup. Prepares the BYOND updater
|
||||
/// </summary>
|
||||
void InitByond()
|
||||
{
|
||||
@@ -92,7 +92,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the <see cref="ServerInstance"/> is shutdown
|
||||
/// Called when the <see cref="Instance"/> is shutdown
|
||||
/// </summary>
|
||||
void DisposeByond()
|
||||
{
|
||||
@@ -194,7 +194,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Downloads and unzips a BYOND revision. Calls <see cref="ApplyStagedUpdate"/> afterwards if the <see cref="ServerInstance"/> isn't running, otherwise, calls <see cref="RequestRestart"/>. Sets <see cref="lastError"/> on failure
|
||||
/// Downloads and unzips a BYOND revision. Calls <see cref="ApplyStagedUpdate"/> afterwards if the <see cref="Instance"/> isn't running, otherwise, calls <see cref="RequestRestart"/>. Sets <see cref="lastError"/> on failure
|
||||
/// </summary>
|
||||
/// <param name="param">Stringified BYOND revision</param>
|
||||
public void UpdateToVersionImpl(object param)
|
||||
@@ -9,7 +9,7 @@ using TGS.Interface.Components;
|
||||
|
||||
namespace TGS.Server
|
||||
{
|
||||
sealed partial class ServerInstance : ITGChat
|
||||
sealed partial class Instance : ITGChat
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for indicating unintialized encrypted data
|
||||
@@ -17,7 +17,7 @@ namespace TGS.Server
|
||||
public const string UninitializedString = "NEEDS INITIALIZING";
|
||||
|
||||
/// <summary>
|
||||
/// List of <see cref="IChatProvider"/>s for the <see cref="ServerInstance"/>
|
||||
/// List of <see cref="IChatProvider"/>s for the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
IList<IChatProvider> ChatProviders;
|
||||
/// <summary>
|
||||
@@ -26,7 +26,7 @@ namespace TGS.Server
|
||||
object ChatLock = new object();
|
||||
|
||||
/// <summary>
|
||||
/// Set up the <see cref="ChatProviders"/> for the <see cref="ServerInstance"/>
|
||||
/// Set up the <see cref="ChatProviders"/> for the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
public void InitChat()
|
||||
{
|
||||
@@ -11,7 +11,7 @@ using TGS.Interface.Components;
|
||||
|
||||
namespace TGS.Server
|
||||
{
|
||||
sealed partial class ServerInstance : ITGCompiler
|
||||
sealed partial class Instance : ITGCompiler
|
||||
{
|
||||
#region Win32 Shit
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
@@ -7,7 +7,7 @@ using TGS.Interface.Components;
|
||||
namespace TGS.Server
|
||||
{
|
||||
//knobs and such
|
||||
sealed partial class ServerInstance : ITGConfig
|
||||
sealed partial class Instance : ITGConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for multithreading safety
|
||||
@@ -12,7 +12,7 @@ namespace TGS.Server
|
||||
{
|
||||
//manages the dd window.
|
||||
//It's not possible to actually click it while starting it in CL mode, so in order to change visibility, security, etc. It restarts the process when the world reboots
|
||||
sealed partial class ServerInstance : ITGDreamDaemon
|
||||
sealed partial class Instance : ITGDreamDaemon
|
||||
{
|
||||
enum ShutdownRequestPhase
|
||||
{
|
||||
@@ -519,9 +519,9 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies <see cref="BridgeDLLName"/> from the program directory to the the <see cref="ServerInstance"/> directory
|
||||
/// Copies <see cref="BridgeDLLName"/> from the program directory to the the <see cref="Instance"/> directory
|
||||
/// </summary>
|
||||
/// <param name="overwrite">If <see langword="true"/>, overwrites the <see cref="ServerInstance"/>'s current interface .dll if it exists</param>
|
||||
/// <param name="overwrite">If <see langword="true"/>, overwrites the <see cref="Instance"/>'s current interface .dll if it exists</param>
|
||||
void UpdateBridgeDll(bool overwrite)
|
||||
{
|
||||
var rbdlln = RelativePath(BridgeDLLName);
|
||||
@@ -15,7 +15,7 @@ namespace TGS.Server
|
||||
/// The class which holds all interface components. There are no safeguards for call race conditions so these must be guarded against internally
|
||||
/// </summary>
|
||||
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)]
|
||||
sealed partial class ServerInstance : IDisposable, ITGConnectivity, ITGInstance
|
||||
sealed partial class Instance : IDisposable, ITGConnectivity, ITGInstance
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to assign the instance to event IDs
|
||||
@@ -26,9 +26,9 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
readonly IInstanceConfig Config;
|
||||
/// <summary>
|
||||
/// Constructs and a <see cref="ServerInstance"/>
|
||||
/// Constructs and a <see cref="Instance"/>
|
||||
/// </summary>
|
||||
public ServerInstance(IInstanceConfig config, byte logID)
|
||||
public Instance(IInstanceConfig config, byte logID)
|
||||
{
|
||||
LoggingID = logID;
|
||||
Config = config;
|
||||
@@ -42,7 +42,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleans up the <see cref="ServerInstance"/>
|
||||
/// Cleans up the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
void RunDisposals()
|
||||
{
|
||||
@@ -96,7 +96,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts relative paths to full <see cref="ServerInstance"/> directory paths
|
||||
/// Converts relative paths to full <see cref="Instance"/> directory paths
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string RelativePath(string path)
|
||||
@@ -13,7 +13,7 @@ using TGS.Interface.Components;
|
||||
namespace TGS.Server
|
||||
{
|
||||
//handles talking between the world and us
|
||||
sealed partial class ServerInstance : ITGInterop
|
||||
sealed partial class Instance : ITGInterop
|
||||
{
|
||||
|
||||
object topicLock = new object();
|
||||
+1
-1
@@ -5,7 +5,7 @@ using System.IO;
|
||||
namespace TGS.Server
|
||||
{
|
||||
// Some useful functions for triggering pre action events
|
||||
sealed partial class ServerInstance
|
||||
sealed partial class Instance
|
||||
{
|
||||
/// <summary>
|
||||
/// The instance directory for Preaction handlers
|
||||
@@ -12,10 +12,10 @@ using TGS.Interface.Components;
|
||||
|
||||
namespace TGS.Server
|
||||
{
|
||||
sealed partial class ServerInstance : ITGRepository, IDisposable
|
||||
sealed partial class Instance : ITGRepository, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="ServerInstance"/> directory for the repository
|
||||
/// The <see cref="Instance"/> directory for the repository
|
||||
/// </summary>
|
||||
const string RepoPath = "Repository";
|
||||
/// <summary>
|
||||
@@ -27,7 +27,7 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
const string RepoTGS3SettingsPath = RepoPath + "/TGS3.json";
|
||||
/// <summary>
|
||||
/// Path to the <see cref="ServerInstance"/>'s <see cref="RepoConfig"/> json
|
||||
/// Path to the <see cref="Instance"/>'s <see cref="RepoConfig"/> json
|
||||
/// </summary>
|
||||
const string CachedTGS3SettingsPath = "TGS3.json";
|
||||
/// <summary>
|
||||
@@ -39,7 +39,7 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
const string SSHPushRemote = "ssh_push_target";
|
||||
/// <summary>
|
||||
/// The <see cref="ServerInstance"/> directory for the repository SSH keys
|
||||
/// The <see cref="Instance"/> directory for the repository SSH keys
|
||||
/// </summary>
|
||||
const string RepoKeyDir = "RepoKey/";
|
||||
/// <summary>
|
||||
@@ -86,7 +86,7 @@ namespace TGS.Server
|
||||
int currentProgress = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Used for automatically updating the <see cref="ServerInstance"/>
|
||||
/// Used for automatically updating the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
System.Timers.Timer autoUpdateTimer = new System.Timers.Timer()
|
||||
{
|
||||
@@ -292,7 +292,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies the Static directory to the first available Static_BACKUP path in the <see cref="ServerInstance"/> then deleted the old directory
|
||||
/// Copies the Static directory to the first available Static_BACKUP path in the <see cref="Instance"/> then deleted the old directory
|
||||
/// </summary>
|
||||
void BackupAndDeleteStaticDirectory()
|
||||
{
|
||||
@@ -769,7 +769,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lists tags in the repository created by the <see cref="ServerInstance"/>
|
||||
/// Lists tags in the repository created by the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
/// <param name="error"><see langword="null"/> on success, error message on failure</param>
|
||||
/// <returns>A dictionary of tag title -> commit SHA on success, <see langword="null"/> on failure</returns>
|
||||
@@ -826,7 +826,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the <see cref="ServerInstance"/>'s <see cref="PRJobFile"/>
|
||||
/// Deletes the <see cref="Instance"/>'s <see cref="PRJobFile"/>
|
||||
/// </summary>
|
||||
void DeletePRList()
|
||||
{
|
||||
@@ -1193,9 +1193,9 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the <see cref="ServerInstance"/> is configured for SSH pushing
|
||||
/// Check if the <see cref="Instance"/> is configured for SSH pushing
|
||||
/// </summary>
|
||||
/// <returns><see langword="true"/> if the see cref="ServerInstance"/> is configured for SSH pushing, <see langword="false"/> otherwise</returns>
|
||||
/// <returns><see langword="true"/> if the see cref="Instance"/> is configured for SSH pushing, <see langword="false"/> otherwise</returns>
|
||||
bool SSHAuth()
|
||||
{
|
||||
return File.Exists(RelativePath(PrivateKeyPath)) && File.Exists(RelativePath(PublicKeyPath));
|
||||
@@ -1365,7 +1365,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs on the configured <see cref="InstanceConfig.AutoUpdateInterval"/> of <see cref="Config"/> and tries to <see cref="Update(bool)"/> and <see cref="Compile(bool)"/> the <see cref="ServerInstance"/>
|
||||
/// Runs on the configured <see cref="InstanceConfig.AutoUpdateInterval"/> of <see cref="Config"/> and tries to <see cref="Update(bool)"/> and <see cref="Compile(bool)"/> the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
/// <param name="sender">A <see cref="System.Timers.Timer"/></param>
|
||||
/// <param name="e">The event arguments</param>
|
||||
@@ -5,12 +5,12 @@ using TGS.Interface;
|
||||
namespace TGS.Server
|
||||
{
|
||||
/// <summary>
|
||||
/// Configuration settings for a <see cref="ServerInstance"/>
|
||||
/// Configuration settings for a <see cref="Instance"/>
|
||||
/// </summary>
|
||||
public interface IInstanceConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="ServerInstance"/> directory this <see cref="IInstanceConfig"/> is for
|
||||
/// The <see cref="Instance"/> directory this <see cref="IInstanceConfig"/> is for
|
||||
/// </summary>
|
||||
string Directory { get; }
|
||||
|
||||
@@ -20,32 +20,32 @@ namespace TGS.Server
|
||||
ulong Version { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the <see cref="ServerInstance"/>
|
||||
/// The name of the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the <see cref="ServerInstance"/> is active
|
||||
/// If the <see cref="Instance"/> is active
|
||||
/// </summary>
|
||||
bool Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the .dme/.dmb the <see cref="ServerInstance"/> uses
|
||||
/// The name of the .dme/.dmb the <see cref="Instance"/> uses
|
||||
/// </summary>
|
||||
string ProjectName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The port the <see cref="ServerInstance"/> runs on
|
||||
/// The port the <see cref="Instance"/> runs on
|
||||
/// </summary>
|
||||
ushort Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="DreamDaemonSecurity"/> level for the <see cref="ServerInstance"/>
|
||||
/// The <see cref="DreamDaemonSecurity"/> level for the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
DreamDaemonSecurity Security { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not the <see cref="ServerInstance"/> should immediately start DreamDaemon when activated
|
||||
/// Whether or not the <see cref="Instance"/> should immediately start DreamDaemon when activated
|
||||
/// </summary>
|
||||
bool Autostart { get; set; }
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace TGS.Server
|
||||
string ChatProviderEntropy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the <see cref="ServerInstance"/> should reattach to a running DreamDaemon <see cref="System.Diagnostics.Process"/>
|
||||
/// If the <see cref="Instance"/> should reattach to a running DreamDaemon <see cref="System.Diagnostics.Process"/>
|
||||
/// </summary>
|
||||
bool ReattachRequired { get; set; }
|
||||
|
||||
@@ -99,12 +99,12 @@ namespace TGS.Server
|
||||
string ReattachAPIVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The user group allowed to use the <see cref="ServerInstance"/>
|
||||
/// The user group allowed to use the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
string AuthorizedUserGroupSID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The auto update interval for the <see cref="ServerInstance"/>
|
||||
/// The auto update interval for the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
ulong AutoUpdateInterval { get; set; }
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace TGS.Server
|
||||
bool PushTestmergeCommits { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Saves the <see cref="IInstanceConfig"/> to it's <see cref="ServerInstance"/> <see cref="Directory"/>
|
||||
/// Saves the <see cref="IInstanceConfig"/> to it's <see cref="Instance"/> <see cref="Directory"/>
|
||||
/// </summary>
|
||||
void Save();
|
||||
}
|
||||
@@ -169,7 +169,7 @@ namespace TGS.Server
|
||||
public string CommitterEmail { get; set; } = "tgstation-server@tgstation13.org";
|
||||
|
||||
/// <inheritdoc />
|
||||
public string ChatProviderData { get; set; } = ServerInstance.UninitializedString;
|
||||
public string ChatProviderData { get; set; } = Instance.UninitializedString;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string ChatProviderEntropy { get; set; }
|
||||
@@ -199,9 +199,9 @@ namespace TGS.Server
|
||||
public bool PushTestmergeCommits { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a <see cref="InstanceConfig"/> for a <see cref="ServerInstance"/> at <paramref name="path"/>
|
||||
/// Construct a <see cref="InstanceConfig"/> for a <see cref="Instance"/> at <paramref name="path"/>
|
||||
/// </summary>
|
||||
/// <param name="path">The path to the <see cref="ServerInstance"/></param>
|
||||
/// <param name="path">The path to the <see cref="Instance"/></param>
|
||||
public InstanceConfig(string path)
|
||||
{
|
||||
Directory = path;
|
||||
@@ -216,9 +216,9 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads and migrates an <see cref="IInstanceConfig"/> from a <see cref="ServerInstance"/> at <paramref name="path"/>
|
||||
/// Loads and migrates an <see cref="IInstanceConfig"/> from a <see cref="Instance"/> at <paramref name="path"/>
|
||||
/// </summary>
|
||||
/// <param name="path">The path to the <see cref="ServerInstance"/> directory</param>
|
||||
/// <param name="path">The path to the <see cref="Instance"/> directory</param>
|
||||
/// <returns>The migrated <see cref="IInstanceConfig"/></returns>
|
||||
public static IInstanceConfig Load(string path)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Web.Script.Serialization;
|
||||
namespace TGS.Server
|
||||
{
|
||||
/// <summary>
|
||||
/// Repository specific information for a <see cref="ServerInstance"/>
|
||||
/// Repository specific information for a <see cref="Instance"/>
|
||||
/// </summary>
|
||||
sealed class RepoConfig : IEquatable<RepoConfig>
|
||||
{
|
||||
@@ -32,7 +32,7 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
public readonly IList<string> PathsToStage = new List<string>();
|
||||
/// <summary>
|
||||
/// Directory's whose contents should not be touched when the <see cref="ServerInstance"/> updates
|
||||
/// Directory's whose contents should not be touched when the <see cref="Instance"/> updates
|
||||
/// </summary>
|
||||
public readonly IList<string> StaticDirectoryPaths = new List<string>();
|
||||
/// <summary>
|
||||
|
||||
+23
-23
@@ -43,7 +43,7 @@ namespace TGS.Server
|
||||
/// <summary>
|
||||
/// Checks an <paramref name="instanceName"/> for illegal characters
|
||||
/// </summary>
|
||||
/// <param name="instanceName">The <see cref="ServerInstance"/> name to check</param>
|
||||
/// <param name="instanceName">The <see cref="Instance"/> name to check</param>
|
||||
/// <returns><see langword="null"/> if <paramref name="instanceName"/> contains no illegal characters, error message otherwise</returns>
|
||||
static string CheckInstanceName(string instanceName)
|
||||
{
|
||||
@@ -59,11 +59,11 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
ServiceHost serviceHost;
|
||||
/// <summary>
|
||||
/// Map of <see cref="InstanceConfig.Name"/> to the respective <see cref="ServiceHost"/> hosting the <see cref="ServerInstance"/>
|
||||
/// Map of <see cref="InstanceConfig.Name"/> to the respective <see cref="ServiceHost"/> hosting the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
IDictionary<string, ServiceHost> hosts;
|
||||
/// <summary>
|
||||
/// List of <see cref="ServerInstance.LoggingID"/>s in use
|
||||
/// List of <see cref="Instance.LoggingID"/>s in use
|
||||
/// </summary>
|
||||
IList<int> UsedLoggingIDs = new List<int>();
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates <see cref="ServiceHost"/>s for all <see cref="ServerInstance"/>s as listed in <see cref="Properties.Settings.InstancePaths"/>, detaches bad ones
|
||||
/// Creates <see cref="ServiceHost"/>s for all <see cref="Instance"/>s as listed in <see cref="Properties.Settings.InstancePaths"/>, detaches bad ones
|
||||
/// </summary>
|
||||
void SetupInstances()
|
||||
{
|
||||
@@ -257,9 +257,9 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unlocks a <see cref="ServerInstance.LoggingID"/> acquired with <see cref="LockLoggingID"/>
|
||||
/// Unlocks a <see cref="Instance.LoggingID"/> acquired with <see cref="LockLoggingID"/>
|
||||
/// </summary>
|
||||
/// <param name="ID">The <see cref="ServerInstance.LoggingID"/> to unlock</param>
|
||||
/// <param name="ID">The <see cref="Instance.LoggingID"/> to unlock</param>
|
||||
void UnlockLoggingID(byte ID)
|
||||
{
|
||||
lock (UsedLoggingIDs)
|
||||
@@ -269,9 +269,9 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and locks a <see cref="ServerInstance.LoggingID"/>
|
||||
/// Gets and locks a <see cref="Instance.LoggingID"/>
|
||||
/// </summary>
|
||||
/// <returns>A logging ID for the <see cref="ServerInstance"/> must be released using <see cref="UnlockLoggingID(byte)"/></returns>
|
||||
/// <returns>A logging ID for the <see cref="Instance"/> must be released using <see cref="UnlockLoggingID(byte)"/></returns>
|
||||
byte LockLoggingID()
|
||||
{
|
||||
lock (UsedLoggingIDs)
|
||||
@@ -287,19 +287,19 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates and starts a <see cref="ServiceHost"/> for a <see cref="ServerInstance"/> at <paramref name="config"/>
|
||||
/// Creates and starts a <see cref="ServiceHost"/> for a <see cref="Instance"/> at <paramref name="config"/>
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="IInstanceConfig"/> for the <see cref="ServerInstance"/></param>
|
||||
/// <param name="config">The <see cref="IInstanceConfig"/> for the <see cref="Instance"/></param>
|
||||
/// <returns>The inactive <see cref="ServiceHost"/> on success, <see langword="null"/> on failure</returns>
|
||||
ServiceHost SetupInstance(IInstanceConfig config)
|
||||
{
|
||||
ServerInstance instance;
|
||||
Instance instance;
|
||||
string instanceName;
|
||||
try
|
||||
{
|
||||
if (hosts.ContainsKey(config.Directory))
|
||||
{
|
||||
var datInstance = ((ServerInstance)hosts[config.Directory].SingletonInstance);
|
||||
var datInstance = ((Instance)hosts[config.Directory].SingletonInstance);
|
||||
Logger.WriteError(String.Format("Unable to start instance at path {0}. Has the same name as instance at path {1}. Detaching...", config.Directory, datInstance.ServerDirectory()), EventID.InstanceInitializationFailure, LoggingID);
|
||||
return null;
|
||||
}
|
||||
@@ -308,7 +308,7 @@ namespace TGS.Server
|
||||
var ID = LockLoggingID();
|
||||
Logger.WriteInfo(String.Format("Instance {0} ({1}) assigned logging ID {2}", config.Name, config.Directory, ID), EventID.InstanceIDAssigned, ID);
|
||||
instanceName = config.Name;
|
||||
instance = new ServerInstance(config, ID);
|
||||
instance = new Instance(config, ID);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -348,7 +348,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down all active <see cref="ServiceHost"/>s and calls <see cref="IDisposable.Dispose"/> on it's <see cref="ServerInstance"/>
|
||||
/// Shuts down all active <see cref="ServiceHost"/>s and calls <see cref="IDisposable.Dispose"/> on it's <see cref="Instance"/>
|
||||
/// </summary>
|
||||
void OnStop()
|
||||
{
|
||||
@@ -359,7 +359,7 @@ namespace TGS.Server
|
||||
foreach (var I in hosts)
|
||||
{
|
||||
var host = I.Value;
|
||||
var instance = (ServerInstance)host.SingletonInstance;
|
||||
var instance = (Instance)host.SingletonInstance;
|
||||
host.Close();
|
||||
instance.Dispose();
|
||||
UnlockLoggingID(instance.LoggingID);
|
||||
@@ -381,7 +381,7 @@ namespace TGS.Server
|
||||
public void PrepareForUpdate()
|
||||
{
|
||||
foreach (var I in hosts)
|
||||
((ServerInstance)I.Value.SingletonInstance).Reattach(false);
|
||||
((Instance)I.Value.SingletonInstance).Reattach(false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -431,7 +431,7 @@ namespace TGS.Server
|
||||
Name = ic.Name,
|
||||
Path = ic.Directory,
|
||||
Enabled = ic.Enabled,
|
||||
LoggingID = (byte)(ic.Enabled ? ((ServerInstance)hosts[ic.Name].SingletonInstance).LoggingID : 0)
|
||||
LoggingID = (byte)(ic.Enabled ? ((Instance)hosts[ic.Name].SingletonInstance).LoggingID : 0)
|
||||
});
|
||||
return result;
|
||||
}
|
||||
@@ -475,7 +475,7 @@ namespace TGS.Server
|
||||
/// <summary>
|
||||
/// Starts and onlines an instance located at <paramref name="config"/>
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="IInstanceConfig"/> for the <see cref="ServerInstance"/></param>
|
||||
/// <param name="config">The <see cref="IInstanceConfig"/> for the <see cref="Instance"/></param>
|
||||
/// <returns><see langword="null"/> on success, error message on failure</returns>
|
||||
string SetupOneInstance(IInstanceConfig config)
|
||||
{
|
||||
@@ -543,11 +543,11 @@ namespace TGS.Server
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets a <see cref="ServerInstance"/>'s enabled status
|
||||
/// Sets a <see cref="Instance"/>'s enabled status
|
||||
/// </summary>
|
||||
/// <param name="Name">The <see cref="ServerInstance"/> whom's status should be changed</param>
|
||||
/// <param name="enabled"><see langword="true"/> to enable the <see cref="ServerInstance"/>, <see langword="false"/> to disable it</param>
|
||||
/// <param name="path">The path to the modified <see cref="ServerInstance"/></param>
|
||||
/// <param name="Name">The <see cref="Instance"/> whom's status should be changed</param>
|
||||
/// <param name="enabled"><see langword="true"/> to enable the <see cref="Instance"/>, <see langword="false"/> to disable it</param>
|
||||
/// <param name="path">The path to the modified <see cref="Instance"/></param>
|
||||
/// <returns><see langword="null"/> on success, error message on failure</returns>
|
||||
string SetInstanceEnabledImpl(string Name, bool enabled, out string path)
|
||||
{
|
||||
@@ -575,7 +575,7 @@ namespace TGS.Server
|
||||
return null;
|
||||
var host = hosts[Name];
|
||||
hosts.Remove(Name);
|
||||
var inst = (ServerInstance)host.SingletonInstance;
|
||||
var inst = (Instance)host.SingletonInstance;
|
||||
host.Close();
|
||||
path = inst.ServerDirectory();
|
||||
inst.Offline();
|
||||
|
||||
@@ -97,26 +97,26 @@
|
||||
<Compile Include="InstanceConfig.cs" />
|
||||
<Compile Include="MessageType.cs" />
|
||||
<Compile Include="RepoConfig.cs" />
|
||||
<Compile Include="ServerInstance\Administration.cs" />
|
||||
<Compile Include="ServerInstance\Byond.cs" />
|
||||
<Compile Include="ServerInstance\Chat.cs" />
|
||||
<Compile Include="Instance\Administration.cs" />
|
||||
<Compile Include="Instance\Byond.cs" />
|
||||
<Compile Include="Instance\Chat.cs" />
|
||||
<Compile Include="ChatProviders\ChatProvider.cs" />
|
||||
<Compile Include="ServerInstance\Compiler.cs" />
|
||||
<Compile Include="ServerInstance\Config.cs" />
|
||||
<Compile Include="Instance\Compiler.cs" />
|
||||
<Compile Include="Instance\Config.cs" />
|
||||
<Compile Include="ChatProviders\DiscordChatProvider.cs" />
|
||||
<Compile Include="ServerInstance\DreamDaemon.cs" />
|
||||
<Compile Include="Instance\DreamDaemon.cs" />
|
||||
<Compile Include="EventID.cs" />
|
||||
<Compile Include="ServerInstance\ServerInstance.cs" />
|
||||
<Compile Include="Instance\Instance.cs" />
|
||||
<Compile Include="ChatProviders\IRCChatProvider.cs" />
|
||||
<Compile Include="ServerInstance\Interop.cs" />
|
||||
<Compile Include="ServerInstance\PreactionHandler.cs" />
|
||||
<Compile Include="Instance\Interop.cs" />
|
||||
<Compile Include="Instance\PreactionHandler.cs" />
|
||||
<Compile Include="ProcessExtension.cs" />
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ServerInstance\Repository.cs" />
|
||||
<Compile Include="Instance\Repository.cs" />
|
||||
<Compile Include="Server.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="..\AssemblyInfo.global.cs" />
|
||||
|
||||
Reference in New Issue
Block a user