Launching server.
This commit is contained in:
41
Wino.Shared.WinRT/Services/WinoIPCServerConnectionManager.cs
Normal file
41
Wino.Shared.WinRT/Services/WinoIPCServerConnectionManager.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.ApplicationModel;
|
||||
using Wino.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Shared.WinRT.Services
|
||||
{
|
||||
public class WinoIPCServerConnectionManager : ServerConnectionManagerBase, IWinoServerConnectionManager
|
||||
{
|
||||
public override Task<bool> ConnectAsync()
|
||||
{
|
||||
string directory = Path.Combine(Package.Current.InstalledLocation.Path, "Wino.Server", "Wino.Server.exe");
|
||||
|
||||
Process P = new();
|
||||
P.StartInfo.UseShellExecute = true;
|
||||
P.StartInfo.Verb = "runas";
|
||||
P.StartInfo.FileName = directory;
|
||||
|
||||
// TODO: Pass server start arguments with additional options.
|
||||
P.StartInfo.Arguments = "";
|
||||
|
||||
return Task.FromResult(P.Start());
|
||||
}
|
||||
|
||||
//public Task<bool> DisconnectAsync()
|
||||
//{
|
||||
// throw new NotImplementedException();
|
||||
//}
|
||||
|
||||
//public void DisposeConnection()
|
||||
//{
|
||||
// throw new NotImplementedException();
|
||||
//}
|
||||
|
||||
//public void QueueRequest(IRequestBase request, Guid accountId)
|
||||
//{
|
||||
// throw new NotImplementedException();
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user