Massive sanity reorganization of project structure

Overall:
- Removed all 'TG' prefixes on classes and enums
Service:
- TGStationServer => ServerInstance
- TGServerService => Service
- Moved all ServerInstance partial classes to a subfolder
- Moved ChatProvider classes, delegate, and interface to a namespace
- Moved EventID and ChatMessageType to their own .cs files
- Moved SanitizeTopicString to Program
- ServerService.cs => Service.cs
- Fixed ProjectInstaller being in it's own namespace instead of
TGServerService
Interface:
- Moved ExitCode enum to Command class
- Moved all components to a namespace
- Moved all component enums to Enumerations.cs
- DDInteropCallHolder => DreamDaemonBridge
- Move PullRequestInfo and DreamDaemonBridge to their own .cs files
- Changes the type of ChannelFactory cache from Dictionary<Type,
ChannelFactory> to IDictionary<Type, ChannelFactory>
This commit is contained in:
Cyberboss
2017-10-20 14:00:09 -04:00
parent 7b8fa03f5d
commit 3137be7abb
58 changed files with 3274 additions and 3212 deletions
+63
View File
@@ -0,0 +1,63 @@
using System.Collections.Generic;
using System.ServiceModel;
namespace TGServiceInterface.Components
{
/// <summary>
/// For modifying the in game config
/// Most if not all of these will not apply until the next server reboot
/// </summary>
[ServiceContract]
public interface ITGConfig
{
/// <summary>
/// Return the directory of the server on the host machine
/// </summary>
/// <returns>The path to the directory on success, null on failure</returns>
[OperationContract]
string ServerDirectory();
/// <summary>
/// Returns the file contents of the specified server directory
/// Subdirectories will be prefixed with '/'
/// </summary>
/// <param name="subpath">Subdirectory to enumerate, enumerates the root directory if null</param>
/// <param name="error">null on success, error message on failure</param>
/// <param name="unauthorized">This will be true if error is set to a message that indicates the current user does not have access to the specified file</param>
/// <returns>A list of files in the enumerated static directory on success, null on failure</returns>
[OperationContract]
IList<string> ListStaticDirectory(string subpath, out string error, out bool unauthorized);
/// <summary>
/// Read from a static file
/// </summary>
/// <param name="staticRelativePath">The path from the Static dir. E.g. config/config.txt</param>
/// <param name="repo">if true, the file will be read from the repository instead of the static dir</param>
/// <param name="error">null on success, error message on failure</param>
/// <param name="unauthorized">This will be true if error is set to a message that indicates the current user does not have access to the specified file</param>
/// <returns>The full text of the file on success, null on failure</returns>
/// <exception cref="CommunicationException">Along with implied disconnect exceptions, if the file exceeds transfer limits</exception>
[OperationContract]
string ReadText(string staticRelativePath, bool repo, out string error, out bool unauthorized);
/// <summary>
/// Write to a static file
/// </summary>
/// <param name="staticRelativePath">The path from the Static dir. E.g. config/config.txt</param>
/// <param name="data">The full text of the config file</param>
/// <param name="unauthorized">This will be true if error is set to a message that indicates the current user does not have access to the specified file</param>
/// <returns>null on success, error message on failure</returns>
/// <exception cref="CommunicationException">Along with implied disconnect exceptions, if the file exceeds transfer limits</exception>
[OperationContract]
string WriteText(string staticRelativePath, string data, out bool unauthorized);
/// <summary>
/// Deletes the target static file
/// </summary>
/// <param name="staticRelativePath">The path from the Static dir. E.g. config/config.txt</param>
/// <param name="unauthorized">This will be true if error is set to a message that indicates the current user does not have access to the specified file</param>
/// <returns>null on success, error message on failure</returns>
[OperationContract]
string DeleteFile(string staticRelativePath, out bool unauthorized);
}
}