From 506c98c59200a48a16862a1e7338e8b026d67254 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 7 Nov 2017 16:59:56 -0500 Subject: [PATCH] Breaks up ITGSService into itself, ITGLanding, and ITGInstanceManager --- TGCommandLine/Program.cs | 2 +- TGCommandLine/ServiceCommands.cs | 43 +++++++------ TGControlPanel/InstanceSelector.cs | 23 +++---- ...Manager.cs => RootAuthorizationManager.cs} | 10 ++- .../ServerInstance/Administration.cs | 9 +++ .../ServerInstance/ServerInstance.cs | 1 + TGServerService/Service.cs | 10 +-- TGServerService/TGServerService.csproj | 2 +- TGServiceInterface/Components/Connectivity.cs | 7 -- TGServiceInterface/Components/Instance.cs | 7 ++ .../Components/InstanceManager.cs | 62 ++++++++++++++++++ TGServiceInterface/Components/Landing.cs | 25 ++++++++ TGServiceInterface/Components/Service.cs | 64 +------------------ TGServiceInterface/Interface.cs | 40 +++++++----- TGServiceInterface/TGServiceInterface.csproj | 2 + 15 files changed, 180 insertions(+), 127 deletions(-) rename TGServerService/{AdministrativeAuthorizationManager.cs => RootAuthorizationManager.cs} (73%) create mode 100644 TGServiceInterface/Components/InstanceManager.cs create mode 100644 TGServiceInterface/Components/Landing.cs diff --git a/TGCommandLine/Program.cs b/TGCommandLine/Program.cs index 738434571d..fb0e245d09 100644 --- a/TGCommandLine/Program.cs +++ b/TGCommandLine/Program.cs @@ -85,7 +85,7 @@ namespace TGCommandLine } else if (interactive && !saidSrvVersion) { - Console.WriteLine("Connectd to service version: " + currentInterface.GetService().Version()); + Console.WriteLine("Connectd to service version: " + currentInterface.GetServiceComponent().Version()); saidSrvVersion = true; } diff --git a/TGCommandLine/ServiceCommands.cs b/TGCommandLine/ServiceCommands.cs index efbc628e7d..a52cd40dec 100644 --- a/TGCommandLine/ServiceCommands.cs +++ b/TGCommandLine/ServiceCommands.cs @@ -1,11 +1,12 @@ using System; using System.Collections.Generic; using TGServiceInterface; +using TGServiceInterface.Components; namespace TGCommandLine { /// - /// Used for managing the + /// Used for managing the components /// class ServiceCommand : RootCommand { @@ -26,7 +27,7 @@ namespace TGCommandLine } /// - /// Command for calling + /// Command for calling /// class ServiceCreateInstanceCommand : ConsoleCommand { @@ -54,7 +55,7 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - var res = Interface.GetService().CreateInstance(parameters[0], parameters[1]); + var res = Interface.GetServiceComponent().CreateInstance(parameters[0], parameters[1]); if (res != null) { OutputProc(res); @@ -65,7 +66,7 @@ namespace TGCommandLine } /// - /// Command for calling + /// Command for calling /// class ServiceListInstancesCommand : ConsoleCommand { @@ -86,14 +87,14 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - foreach (var I in Interface.GetService().ListInstances()) + foreach (var I in Interface.GetServiceComponent().ListInstances()) OutputProc(String.Format("{0} ({1}):\t{2}{3}", I.Name, I.Path, I.Enabled ? "Online" : "Offline", I.Enabled ? String.Format(" ({0})", I.LoggingID) : "")); return ExitCode.Normal; } } /// - /// Command for calling + /// Command for calling /// class ServiceDetachInstanceCommand : ConsoleCommand { @@ -121,7 +122,7 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - var res = Interface.GetService().DetachInstance(parameters[0]); + var res = Interface.GetServiceComponent().DetachInstance(parameters[0]); if (res != null) { OutputProc(res); @@ -132,7 +133,7 @@ namespace TGCommandLine } /// - /// Command for calling + /// Command for calling /// class ServiceImportInstanceCommand : ConsoleCommand { @@ -160,7 +161,7 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - var res = Interface.GetService().ImportInstance(parameters[0]); + var res = Interface.GetServiceComponent().ImportInstance(parameters[0]); if (res != null) { OutputProc(res); @@ -171,7 +172,7 @@ namespace TGCommandLine } /// - /// Command for calling + /// Command for calling /// class ServicePythonPathCommand : ConsoleCommand { @@ -192,7 +193,7 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - var res = Interface.GetService().PythonPath(); + var res = Interface.GetServiceComponent().PythonPath(); if (res != null) { OutputProc(res); @@ -203,7 +204,7 @@ namespace TGCommandLine } /// - /// Command for calling + /// Command for calling /// class ServiceSetPythonPathCommand : ConsoleCommand { @@ -231,13 +232,13 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - Interface.GetService().SetPythonPath(parameters[0]); + Interface.GetServiceComponent().SetPythonPath(parameters[0]); return ExitCode.Normal; } } /// - /// Command for calling with a parameter + /// Command for calling with a parameter /// class ServiceEnableInstanceCommand : ConsoleCommand { @@ -265,7 +266,7 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - var res = Interface.GetService().SetInstanceEnabled(parameters[0], true); + var res = Interface.GetServiceComponent().SetInstanceEnabled(parameters[0], true); if (res != null) { OutputProc(res); @@ -276,7 +277,7 @@ namespace TGCommandLine } /// - /// Command for calling with a parameter + /// Command for calling with a parameter /// class ServiceDisableInstanceCommand : ConsoleCommand { @@ -304,7 +305,7 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - var res = Interface.GetService().SetInstanceEnabled(parameters[0], false); + var res = Interface.GetServiceComponent().SetInstanceEnabled(parameters[0], false); if (res != null) { OutputProc(res); @@ -336,7 +337,7 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - OutputProc(Interface.GetService().RemoteAccessPort().ToString()); + OutputProc(Interface.GetServiceComponent().RemoteAccessPort().ToString()); return ExitCode.Normal; } } @@ -381,7 +382,7 @@ namespace TGCommandLine return ExitCode.BadCommand; } - var res = Interface.GetService().SetRemoteAccessPort(port); + var res = Interface.GetServiceComponent().SetRemoteAccessPort(port); if (res != null) { OutputProc(res); @@ -393,7 +394,7 @@ namespace TGCommandLine } /// - /// Command for calling + /// Command for calling /// class ServiceRenameInstanceCommand : ConsoleCommand { @@ -421,7 +422,7 @@ namespace TGCommandLine /// protected override ExitCode Run(IList parameters) { - var res = Interface.GetService().RenameInstance(parameters[0], parameters[1]); + var res = Interface.GetServiceComponent().RenameInstance(parameters[0], parameters[1]); if (res != null) { OutputProc(res); diff --git a/TGControlPanel/InstanceSelector.cs b/TGControlPanel/InstanceSelector.cs index 607227b771..15f3f9e360 100644 --- a/TGControlPanel/InstanceSelector.cs +++ b/TGControlPanel/InstanceSelector.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using System.Windows.Forms; using TGServiceInterface; +using TGServiceInterface.Components; namespace TGControlPanel { @@ -77,13 +78,13 @@ namespace TGControlPanel } /// - /// Loads the using + /// Loads the using /// async void RefreshInstances() { InstanceListBox.Items.Clear(); await WrapServerOp(() => { - InstanceData = masterInterface.GetService().ListInstances(); + InstanceData = masterInterface.GetServiceComponent().ListInstances(); }); foreach(var I in InstanceData) InstanceListBox.Items.Add(String.Format("{0}: {1} - {2} - {3}", I.LoggingID, I.Name, I.Path, I.Enabled ? "ONLINE" : "OFFLINE")); @@ -92,7 +93,7 @@ namespace TGControlPanel /// /// Tries to start a for a given /// - /// The name of the to connect to + /// The name of the to connect to async void TryConnectToInstance(string instanceName) { if(ControlPanel.InstancesInUse.TryGetValue(instanceName, out ControlPanel activeCP)) @@ -123,7 +124,7 @@ namespace TGControlPanel } /// - /// Prompts the user for parameters to + /// Prompts the user for parameters to /// /// The sender of the event /// The @@ -135,7 +136,7 @@ namespace TGControlPanel if (MessageBox.Show(String.Format("This will dissociate the server instance at \"{0}\"! Are you sure?", imd.Path), "Instance Detach", MessageBoxButtons.YesNo) != DialogResult.Yes) return; string res = null; - await WrapServerOp(() => { res = masterInterface.GetService().DetachInstance(imd.Name); }); + await WrapServerOp(() => { res = masterInterface.GetServiceComponent().DetachInstance(imd.Name); }); if (res != null) MessageBox.Show(res); RefreshInstances(); @@ -152,7 +153,7 @@ namespace TGControlPanel } /// - /// Prompts the user for parameters to + /// Prompts the user for parameters to /// /// The sender of the event /// The @@ -167,14 +168,14 @@ namespace TGControlPanel if (imd.Enabled && MessageBox.Show(String.Format("This will temporarily offline the server instance! Are you sure?", imd.Path), "Instance Restart", MessageBoxButtons.YesNo) != DialogResult.Yes) return; string res = null; - await WrapServerOp(() => { res = masterInterface.GetService().RenameInstance(imd.Name, new_name); }); + await WrapServerOp(() => { res = masterInterface.GetServiceComponent().RenameInstance(imd.Name, new_name); }); if (res != null) MessageBox.Show(res); RefreshInstances(); } /// - /// Prompts the user for parameters to + /// Prompts the user for parameters to /// /// The sender of the event /// The @@ -184,14 +185,14 @@ namespace TGControlPanel if (instance_path == null) return; string res = null; - await WrapServerOp(() => { res = masterInterface.GetService().ImportInstance(instance_path); }); + await WrapServerOp(() => { res = masterInterface.GetServiceComponent().ImportInstance(instance_path); }); if (res != null) MessageBox.Show(res); RefreshInstances(); } /// - /// Prompts the user for parameters to + /// Prompts the user for parameters to /// /// The sender of the event /// The @@ -204,7 +205,7 @@ namespace TGControlPanel if (instance_path == null) return; string res = null; - await WrapServerOp(() => { res = masterInterface.GetService().CreateInstance(instance_name, instance_path); }); + await WrapServerOp(() => { res = masterInterface.GetServiceComponent().CreateInstance(instance_name, instance_path); }); if (res != null) MessageBox.Show(res); RefreshInstances(); diff --git a/TGServerService/AdministrativeAuthorizationManager.cs b/TGServerService/RootAuthorizationManager.cs similarity index 73% rename from TGServerService/AdministrativeAuthorizationManager.cs rename to TGServerService/RootAuthorizationManager.cs index e5aaf062d5..f3f45d0983 100644 --- a/TGServerService/AdministrativeAuthorizationManager.cs +++ b/TGServerService/RootAuthorizationManager.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Security.Principal; using System.ServiceModel; using TGServiceInterface.Components; @@ -9,21 +11,23 @@ namespace TGServerService /// /// A used to determine only if the caller is an admin /// - sealed class AdministrativeAuthorizationManager : ServiceAuthorizationManager + sealed class RootAuthorizationManager : ServiceAuthorizationManager { string LastSeenUser; + public static readonly IList InstanceAuthManagers = new List(); protected override bool CheckAccessCore(OperationContext operationContext) { var contract = operationContext.EndpointDispatcher.ContractName; - if (contract == typeof(ITGConnectivity).Name) //always allow connectivity checks return true; - + var windowsIdent = operationContext.ServiceSecurityContext.WindowsIdentity; var wp = new WindowsPrincipal(windowsIdent); //first allow admins var authSuccess = wp.IsInRole(WindowsBuiltInRole.Administrator); + if(!authSuccess && contract == typeof(ITGLanding).Name) + return InstanceAuthManagers.FirstOrDefault(x => x.CheckAccess(operationContext)) != null; var user = windowsIdent.Name; if (LastSeenUser != user) diff --git a/TGServerService/ServerInstance/Administration.cs b/TGServerService/ServerInstance/Administration.cs index 87891795af..affe43a2b7 100644 --- a/TGServerService/ServerInstance/Administration.cs +++ b/TGServerService/ServerInstance/Administration.cs @@ -73,6 +73,7 @@ namespace TGServerService /// The name of the group allowed to access the if it could be found, otherwise string FindTheDroidsWereLookingFor(string search = null, bool useDomain = false) { + RootAuthorizationManager.InstanceAuthManagers.Add(this); //find the group that is authorized to use the tools var pc = new PrincipalContext(useDomain ? ContextType.Domain : ContextType.Machine); var groupName = search ?? Config.AuthorizedUserGroupSID; @@ -95,6 +96,14 @@ namespace TGServerService } return gp.Name; } + + /// + /// Cleans up the component + /// + void DisposeAdministration() + { + RootAuthorizationManager.InstanceAuthManagers.Remove(this); + } /// /// Called by WCF whenever a component call is made. Checks to see that the supplied user account has access to the requested component diff --git a/TGServerService/ServerInstance/ServerInstance.cs b/TGServerService/ServerInstance/ServerInstance.cs index ec239dcb80..a92406939d 100644 --- a/TGServerService/ServerInstance/ServerInstance.cs +++ b/TGServerService/ServerInstance/ServerInstance.cs @@ -51,6 +51,7 @@ namespace TGServerService DisposeByond(); DisposeRepo(); DisposeChat(); + DisposeAdministration(); Config.Save(); } diff --git a/TGServerService/Service.cs b/TGServerService/Service.cs index a47c89511b..5634597406 100644 --- a/TGServerService/Service.cs +++ b/TGServerService/Service.cs @@ -15,7 +15,7 @@ namespace TGServerService /// The windows service the application runs as /// [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)] - class Service : ServiceBase, ITGSService, ITGConnectivity + class Service : ServiceBase, ITGSService, ITGConnectivity, ITGLanding, ITGInstanceManager { /// /// The logging ID used for events @@ -233,9 +233,9 @@ namespace TGServerService void SetupService() { serviceHost = CreateHost(this, Interface.MasterInterfaceName); - AddEndpoint(serviceHost, typeof(ITGSService)); - AddEndpoint(serviceHost, typeof(ITGConnectivity)); - serviceHost.Authorization.ServiceAuthorizationManager = new AdministrativeAuthorizationManager(); //only admins can diddle us + foreach (var I in Interface.ValidServiceInterfaces) + AddEndpoint(serviceHost, I); + serviceHost.Authorization.ServiceAuthorizationManager = new RootAuthorizationManager(); //only admins can diddle us } /// @@ -350,7 +350,7 @@ namespace TGServerService var host = CreateHost(instance, String.Format("{0}/{1}", Interface.InstanceInterfaceName, instanceName)); hosts.Add(instanceName, host); - foreach (var J in Interface.ValidInterfaces) + foreach (var J in Interface.ValidInstanceInterfaces) AddEndpoint(host, J); host.Authorization.ServiceAuthorizationManager = instance; diff --git a/TGServerService/TGServerService.csproj b/TGServerService/TGServerService.csproj index 375c542010..97aa35035d 100644 --- a/TGServerService/TGServerService.csproj +++ b/TGServerService/TGServerService.csproj @@ -92,7 +92,7 @@ - + diff --git a/TGServiceInterface/Components/Connectivity.cs b/TGServiceInterface/Components/Connectivity.cs index 81975e6f84..d3077d3dd9 100644 --- a/TGServiceInterface/Components/Connectivity.cs +++ b/TGServiceInterface/Components/Connectivity.cs @@ -13,12 +13,5 @@ namespace TGServiceInterface.Components /// [OperationContract] void VerifyConnection(); - - /// - /// Retrieve's the service's version - /// - /// The service's version - [OperationContract] - string Version(); } } diff --git a/TGServiceInterface/Components/Instance.cs b/TGServiceInterface/Components/Instance.cs index 9172aee46b..c4c771d4ef 100644 --- a/TGServiceInterface/Components/Instance.cs +++ b/TGServiceInterface/Components/Instance.cs @@ -14,5 +14,12 @@ namespace TGServiceInterface.Components /// The path to the directory on success, null on failure [OperationContract] string ServerDirectory(); + + /// + /// Retrieve's the service's version + /// + /// The service's version + [OperationContract] + string Version(); } } diff --git a/TGServiceInterface/Components/InstanceManager.cs b/TGServiceInterface/Components/InstanceManager.cs new file mode 100644 index 0000000000..3467c009c1 --- /dev/null +++ b/TGServiceInterface/Components/InstanceManager.cs @@ -0,0 +1,62 @@ +using System.ServiceModel; + +namespace TGServiceInterface.Components +{ + /// + /// Used for managing s + /// + [ServiceContract] + public interface ITGInstanceManager + { + /// + /// Creates a new + /// + /// The name of the instance + /// The path to the instance + /// on success, error message on failure + [OperationContract] + string CreateInstance(string Name, string path); + + /// + /// Registers an existing server instance + /// + /// The path to the instance + /// on success, error message on failure + [OperationContract] + string ImportInstance(string path); + + /// + /// Checks if an instance is online + /// + /// The name of the instance + /// if the Instance exists and is online, otherwise + [OperationContract] + bool InstanceEnabled(string Name); + + /// + /// Sets an instance's enabled status + /// + /// The instance whom's status should be changed + /// to enable the instance, to disable it + /// on success, error message on failure + [OperationContract] + string SetInstanceEnabled(string Name, bool enabled); + + /// + /// Renames an instance, this will restart the instance if it is enabled + /// + /// The current name of the instance + /// The new name of the instance + /// on success, error message on failure + [OperationContract] + string RenameInstance(string name, string new_name); + + /// + /// Disables and unregisters an instance, allowing the folder and data to be manipulated manually + /// + /// The instance to detach + /// on success, error message on failure + [OperationContract] + string DetachInstance(string name); + } +} diff --git a/TGServiceInterface/Components/Landing.cs b/TGServiceInterface/Components/Landing.cs new file mode 100644 index 0000000000..42bbf2706c --- /dev/null +++ b/TGServiceInterface/Components/Landing.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.ServiceModel; + +namespace TGServiceInterface.Components +{ + /// + /// Used for general authentication and listing s + /// + public interface ITGLanding + { + /// + /// Retrieve's the service's version + /// + /// The service's version + [OperationContract] + string Version(); + + /// + /// List instances that the caller can access + /// + /// A of instance names relating to their paths + [OperationContract] + IList ListInstances(); + } +} diff --git a/TGServiceInterface/Components/Service.cs b/TGServiceInterface/Components/Service.cs index e9057d957c..d9fecd397f 100644 --- a/TGServiceInterface/Components/Service.cs +++ b/TGServiceInterface/Components/Service.cs @@ -16,13 +16,6 @@ namespace TGServiceInterface.Components [OperationContract] void PrepareForUpdate(); - /// - /// Retrieve's the service's version - /// - /// The service's version - [OperationContract] - string Version(); - /// /// Get the port used for remote operation /// @@ -40,62 +33,11 @@ namespace TGServiceInterface.Components string SetRemoteAccessPort(ushort port); /// - /// List instances + /// Retrieve's the service's version /// - /// A of instance names relating to their paths + /// The service's version [OperationContract] - IList ListInstances(); - - /// - /// Creates a new server instance - /// - /// The name of the instance - /// The path to the instance - /// on success, error message on failure - [OperationContract] - string CreateInstance(string Name, string path); - - /// - /// Registers an existing server instance - /// - /// The path to the instance - /// on success, error message on failure - [OperationContract] - string ImportInstance(string path); - - /// - /// Checks if an instance is online - /// - /// The name of the instance - /// if the Instance exists and is online, otherwise - [OperationContract] - bool InstanceEnabled(string Name); - - /// - /// Sets an instance's enabled status - /// - /// The instance whom's status should be changed - /// to enable the instance, to disable it - /// on success, error message on failure - [OperationContract] - string SetInstanceEnabled(string Name, bool enabled); - - /// - /// Renames an instance, this will restart the instance if it is enabled - /// - /// The current name of the instance - /// The new name of the instance - /// on success, error message on failure - [OperationContract] - string RenameInstance(string name, string new_name); - - /// - /// Disables and unregisters an instance, allowing the folder and data to be manipulated manually - /// - /// The instance to detach - /// on success, error message on failure - [OperationContract] - string DetachInstance(string name); + string Version(); /// /// Sets the path to the python 2.7 installation diff --git a/TGServiceInterface/Interface.cs b/TGServiceInterface/Interface.cs index 34b9003911..4a3bd34b5b 100644 --- a/TGServiceInterface/Interface.cs +++ b/TGServiceInterface/Interface.cs @@ -52,17 +52,17 @@ namespace TGServiceInterface bool VersionMismatch(out string errorMessage); /// - /// Returns the requested component for the instance . This does not guarantee a successful connection. s created this way are recycled for minimum latency and bandwidth usage + /// Returns the requested component for the instance . This does not guarantee a successful connection. /// /// The component to retrieve /// The correct component T GetComponent(); /// - /// Returns the component for the service + /// Returns a root service component /// /// The component for the service - ITGSService GetService(); + T GetServiceComponent(); /// /// Used to test if the is avaiable on the target machine. Note that state can change at any time and any call into the may throw an exception because of communcation errors @@ -82,9 +82,14 @@ namespace TGServiceInterface sealed public class Interface : IInterface { /// - /// List of s that can be used with and + /// List of s that can be used with /// - public static readonly IList ValidInterfaces = CollectComponents(); + public static readonly IList ValidServiceInterfaces = new List { typeof(ITGSService), typeof(ITGInstanceManager), typeof(ITGConnectivity), typeof(ITGLanding) }; + + /// + /// List of s that can be used with + /// + public static readonly IList ValidInstanceInterfaces = CollectComponents(); /// /// The maximum message size to and from a local server @@ -145,13 +150,13 @@ namespace TGServiceInterface /// A of s that can be used with the service static IList CollectComponents() { - var ServiceComponent = typeof(ITGSService); //this is special - //find all interfaces in this assembly in this namespace that have the service contract attribute + var ConnectivityComponent = typeof(ITGConnectivity); + //find all interfaces in this assembly in this namespace that have the service contract attribute var query = from t in Assembly.GetExecutingAssembly().GetTypes() where t.IsInterface - && t.Namespace == ServiceComponent.Namespace + && t.Namespace == ConnectivityComponent.Namespace && t.GetCustomAttribute(typeof(ServiceContractAttribute)) != null - && t != ServiceComponent + && (t == ConnectivityComponent || !ValidServiceInterfaces.Contains(t)) select t; return query.ToList(); } @@ -288,7 +293,7 @@ namespace TGServiceInterface /// public bool VersionMismatch(out string errorMessage) { - var splits = GetService().Version().Split(' '); + var splits = GetServiceComponent().Version().Split(' '); var theirs = new Version(splits[splits.Length - 1].Substring(1)); var ours = new Version(FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion); if(theirs.Major != ours.Major || theirs.Minor != ours.Minor || theirs.Revision != ours.Revision) //don't care about the patch level @@ -314,7 +319,7 @@ namespace TGServiceInterface public T GetComponent() { var ToT = typeof(T); - if (!ValidInterfaces.Contains(ToT) && ToT != typeof(ITGSService)) + if (!ValidInstanceInterfaces.Contains(ToT)) throw new Exception("Invalid type!"); return GetComponentImpl(true); } @@ -357,9 +362,12 @@ namespace TGServiceInterface } /// - public ITGSService GetService() + public T GetServiceComponent() { - return GetComponentImpl(false); + var ToT = typeof(T); + if (!ValidServiceInterfaces.Contains(ToT)) + throw new Exception("Invalid type!"); + return GetComponentImpl(false); } /// @@ -420,10 +428,9 @@ namespace TGServiceInterface error = e.ToString(); return ConnectivityLevel.None; } - var service = GetService(); try { - service.Version(); + GetServiceComponent().Version(); } catch(Exception e) { @@ -432,8 +439,7 @@ namespace TGServiceInterface } try { - // TODO - + GetServiceComponent().Version(); error = null; return ConnectivityLevel.Administrator; } diff --git a/TGServiceInterface/TGServiceInterface.csproj b/TGServiceInterface/TGServiceInterface.csproj index 5e9befc3be..cabc4e5c69 100644 --- a/TGServiceInterface/TGServiceInterface.csproj +++ b/TGServiceInterface/TGServiceInterface.csproj @@ -54,6 +54,8 @@ + +