mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 21:46:52 +01:00
Fix tabbing
This commit is contained in:
+31
-31
@@ -23,26 +23,26 @@ namespace TGCommandLine
|
||||
{
|
||||
badConnectionString = true;
|
||||
break;
|
||||
}
|
||||
var addrport = splits[1].Split(':');
|
||||
if (addrport.Length != 2)
|
||||
{
|
||||
badConnectionString = true;
|
||||
break;
|
||||
}
|
||||
var username = userpass[0];
|
||||
}
|
||||
var addrport = splits[1].Split(':');
|
||||
if (addrport.Length != 2)
|
||||
{
|
||||
badConnectionString = true;
|
||||
break;
|
||||
}
|
||||
var username = userpass[0];
|
||||
var password = userpass[1];
|
||||
var address = addrport[0];
|
||||
ushort port;
|
||||
try
|
||||
{
|
||||
port = Convert.ToUInt16(addrport[1]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
badConnectionString = true;
|
||||
break;
|
||||
}
|
||||
ushort port;
|
||||
try
|
||||
{
|
||||
port = Convert.ToUInt16(addrport[1]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
badConnectionString = true;
|
||||
break;
|
||||
}
|
||||
if(String.IsNullOrWhiteSpace(username) || String.IsNullOrWhiteSpace(password) || String.IsNullOrWhiteSpace(address))
|
||||
{
|
||||
badConnectionString = true;
|
||||
@@ -128,19 +128,19 @@ namespace TGCommandLine
|
||||
switch (NextCommand.ToLower())
|
||||
{
|
||||
case "remote":
|
||||
Console.Write("Enter server address: ");
|
||||
var address = Console.ReadLine();
|
||||
Console.Write("Enter server port: ");
|
||||
ushort port;
|
||||
try{
|
||||
port = Convert.ToUInt16(Console.ReadLine());
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Error: Bad port!");
|
||||
break;
|
||||
}
|
||||
Console.Write("Enter username: ");
|
||||
Console.Write("Enter server address: ");
|
||||
var address = Console.ReadLine();
|
||||
Console.Write("Enter server port: ");
|
||||
ushort port;
|
||||
try{
|
||||
port = Convert.ToUInt16(Console.ReadLine());
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Error: Bad port!");
|
||||
break;
|
||||
}
|
||||
Console.Write("Enter username: ");
|
||||
var username = Console.ReadLine();
|
||||
Console.Write("Enter password: ");
|
||||
var password = ReadLineSecure();
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace TGControlPanel
|
||||
{
|
||||
InitializeComponent();
|
||||
IPTextBox.Text = Properties.Settings.Default.RemoteIP;
|
||||
var Config = Properties.Settings.Default;
|
||||
UsernameTextBox.Text = Config.RemoteUsername;
|
||||
PortSelector.Value = Config.RemotePort;
|
||||
var Config = Properties.Settings.Default;
|
||||
UsernameTextBox.Text = Config.RemoteUsername;
|
||||
PortSelector.Value = Config.RemotePort;
|
||||
AcceptButton = RemoteLoginButton;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,15 +115,15 @@ namespace TGServerService
|
||||
return Properties.Settings.Default.RemoteAccessPort;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public string SetRemoteAccessPort(ushort port)
|
||||
{
|
||||
if (port == 0)
|
||||
return "Cannot bind to port 0";
|
||||
var Config = Properties.Settings.Default;
|
||||
Config.RemoteAccessPort = port;
|
||||
Config.Save();
|
||||
return null;
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public string SetRemoteAccessPort(ushort port)
|
||||
{
|
||||
if (port == 0)
|
||||
return "Cannot bind to port 0";
|
||||
var Config = Properties.Settings.Default;
|
||||
Config.RemoteAccessPort = port;
|
||||
Config.Save();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace TGServerService
|
||||
if (oldVersion == newVersion && newVersion == 0) //chat refactor
|
||||
Properties.Settings.Default.ChatProviderData = "NEEDS INITIALIZING"; //reset chat settings to be safe
|
||||
}
|
||||
|
||||
|
||||
//you should seriously not add anything here
|
||||
//Use OnStart instead
|
||||
public TGServerService()
|
||||
|
||||
@@ -8,21 +8,21 @@ namespace TGServiceInterface
|
||||
[ServiceContract]
|
||||
public interface ITGAdministration
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the port used for remote operation
|
||||
/// </summary>
|
||||
/// <returns>The port used for remote operation</returns>
|
||||
/// <summary>
|
||||
/// Get the port used for remote operation
|
||||
/// </summary>
|
||||
/// <returns>The port used for remote operation</returns>
|
||||
[OperationContract]
|
||||
ushort RemoteAccessPort();
|
||||
ushort RemoteAccessPort();
|
||||
|
||||
/// <summary>
|
||||
/// Set the port used for remote operation
|
||||
/// Requires a service restart to take effect
|
||||
/// </summary>
|
||||
/// <param name="port">The new port to use for remote operation</param>
|
||||
/// <returns>null on success, error message on failure</returns>
|
||||
/// <summary>
|
||||
/// Set the port used for remote operation
|
||||
/// Requires a service restart to take effect
|
||||
/// </summary>
|
||||
/// <param name="port">The new port to use for remote operation</param>
|
||||
/// <returns>null on success, error message on failure</returns>
|
||||
[OperationContract]
|
||||
string SetRemoteAccessPort(ushort port);
|
||||
string SetRemoteAccessPort(ushort port);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of the windows group allowed to use the service other than administrator
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace TGServiceInterface
|
||||
public static void SetRemoteLoginInformation(string address, ushort port, string username, string password)
|
||||
{
|
||||
HTTPSURL = address;
|
||||
HTTPSPort = port;
|
||||
HTTPSPort = port;
|
||||
HTTPSUsername = username;
|
||||
HTTPSPassword = password;
|
||||
}
|
||||
@@ -63,14 +63,14 @@ namespace TGServiceInterface
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the component to retrieve</typeparam>
|
||||
/// <returns></returns>
|
||||
public static T GetComponent<T>()
|
||||
{
|
||||
public static T GetComponent<T>()
|
||||
{
|
||||
var ToT = typeof(T);
|
||||
if (!ValidInterfaces.Contains(ToT))
|
||||
throw new Exception("Invalid type!");
|
||||
var InterfaceName = typeof(T).Name;
|
||||
if (HTTPSURL == null)
|
||||
return new ChannelFactory<T>(new NetNamedPipeBinding { SendTimeout = new TimeSpan(0, 10, 0) }, new EndpointAddress(String.Format("net.pipe://localhost/{0}/{1}", MasterInterfaceName, InterfaceName))).CreateChannel();
|
||||
if (HTTPSURL == null)
|
||||
return new ChannelFactory<T>(new NetNamedPipeBinding { SendTimeout = new TimeSpan(0, 10, 0) }, new EndpointAddress(String.Format("net.pipe://localhost/{0}/{1}", MasterInterfaceName, InterfaceName))).CreateChannel();
|
||||
|
||||
//okay we're going over
|
||||
var binding = new WSHttpBinding();
|
||||
|
||||
Reference in New Issue
Block a user