Launching server.

This commit is contained in:
Burak Kaan Köse
2024-07-22 11:05:04 +02:00
parent 495885e006
commit 2fbcf8e104
6 changed files with 86 additions and 10 deletions

View 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();
//}
}
}