68 lines
1.9 KiB
C#
68 lines
1.9 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using System.Collections.ObjectModel;
|
|
using Aurora.Models;
|
|
using Aurora.Executors;
|
|
using Aurora.Services;
|
|
using Aurora.Proto;
|
|
using Aurora.RemoteImpl;
|
|
|
|
namespace Aurora.Executors
|
|
{
|
|
public class HostExecutor : BaseExecutor
|
|
{
|
|
RemotePartyServiceImpl _remotePartyServiceImpl;
|
|
RemotePlaybackServiceImpl _remotePlaybackImpl;
|
|
public HostExecutor()
|
|
{
|
|
_remotePartyServiceImpl = new RemotePartyServiceImpl();
|
|
_remotePlaybackImpl = new RemotePlaybackServiceImpl();
|
|
}
|
|
|
|
public override void Connect(string hostname)
|
|
{
|
|
//Initialize gRPC server
|
|
ServerService.Instance.Initialize(hostname);
|
|
|
|
//Register grpc RemoteService with singleton server service
|
|
ServerService.Instance.RegisterService(RemotePartyService.BindService(_remotePartyServiceImpl));
|
|
ServerService.Instance.RegisterService(RemotePlaybackService.BindService(_remotePlaybackImpl));
|
|
|
|
//start gRPC server
|
|
ServerService.Instance.Start();
|
|
}
|
|
|
|
#region Properties
|
|
public override ObservableCollection<PartyMember> PartyMembers
|
|
{
|
|
get { return _remotePartyServiceImpl.PartyMembers; }
|
|
}
|
|
|
|
#endregion Properties
|
|
|
|
public override async void Close()
|
|
{
|
|
await ServerService.Instance.Stop();
|
|
}
|
|
|
|
public override void AddToQueue()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override ObservableCollection<PartyMember> GetMembers()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void GetQueue()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void RemoveFromQueue()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
} |