Sanely namespaces the project

This commit is contained in:
Cyberboss
2017-11-12 23:48:49 -05:00
parent cc364a75d6
commit 6e54f622de
154 changed files with 2434 additions and 2434 deletions
+33
View File
@@ -0,0 +1,33 @@
using System.Collections.Generic;
using TGS.Interface;
namespace TGS.CommandLine
{
abstract class InstanceRootCommand : RootCommand
{
public static IServerInterface currentInterface;
public override ExitCode DoRun(IList<string> parameters)
{
if (currentInterface.InstanceName == null)
{
OutputProc("Missing instance!");
return ExitCode.BadCommand;
}
else
{
var res = currentInterface.ConnectToInstance();
if (!res.HasFlag(ConnectivityLevel.Connected))
{
OutputProc("Unable to connect to instance!");
return ExitCode.ConnectionError;
}
else if (!res.HasFlag(ConnectivityLevel.Authenticated))
{
OutputProc("The current user is not authorized to use this instance!");
return ExitCode.ConnectionError;
}
}
return base.DoRun(parameters);
}
}
}