Beginning stages for party executors
This commit is contained in:
77
Aurora/Backend/Server/Party/HostPartyExecutor.cs
Normal file
77
Aurora/Backend/Server/Party/HostPartyExecutor.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Aurora.Backend.Executors;
|
||||
using Aurora.Backend.Services;
|
||||
using Aurora.Backend.Proto;
|
||||
|
||||
namespace Aurora.Backend.Server.Party
|
||||
{
|
||||
public class HostPartyExecutor : BasePartyExecutor
|
||||
{
|
||||
PartyServiceImpl _partyServiceImpl;
|
||||
public HostPartyExecutor()
|
||||
{
|
||||
_partyServiceImpl = new PartyServiceImpl();
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
ServerService.Instance.RegisterService(PartyService.BindService(_partyServiceImpl));
|
||||
}
|
||||
|
||||
public override async void Close()
|
||||
{
|
||||
await ServerService.Instance.Stop();
|
||||
}
|
||||
|
||||
public override void AddToQueue()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void GetMembers()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void GetQueue()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Next()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Pause()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Play()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Previous()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void RemoveFromQueue()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Stop()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
50
Aurora/Backend/Server/Party/PartyServiceImpl.cs
Normal file
50
Aurora/Backend/Server/Party/PartyServiceImpl.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using Aurora.Backend.Proto;
|
||||
using Aurora.Backend.Models;
|
||||
|
||||
namespace Aurora.Backend.Server.Party
|
||||
{
|
||||
class PartyServiceImpl : PartyService.PartyServiceBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Dictionary of party members. Key -> ClientId
|
||||
/// </summary>
|
||||
private Dictionary<string, PartyMember> _partyMembers;
|
||||
|
||||
public PartyServiceImpl()
|
||||
{
|
||||
_partyMembers = new Dictionary<string, PartyMember>();
|
||||
}
|
||||
|
||||
public Dictionary<string, PartyMember> PartyMembers
|
||||
{
|
||||
get
|
||||
{
|
||||
return _partyMembers;
|
||||
}
|
||||
}
|
||||
|
||||
public override Task<JoinPartyResponse> JoinParty(JoinPartyRequest request, Grpc.Core.ServerCallContext context)
|
||||
{
|
||||
_partyMembers.Add(request.ClientId, new PartyMember()
|
||||
{
|
||||
Username = request.UserName,
|
||||
Id = request.ClientId,
|
||||
IpAddress = request.IpAddress,
|
||||
Port = request.Port,
|
||||
});
|
||||
|
||||
JoinPartyResponse response = new JoinPartyResponse() { Status = PartyJoinedStatusEnum.Connected };
|
||||
return Task.FromResult(response);
|
||||
}
|
||||
|
||||
public override Task<LeavePartyResponse> LeaveParty(LeavePartyRequest request, Grpc.Core.ServerCallContext context)
|
||||
{
|
||||
_partyMembers.Remove(request.ClientId);
|
||||
LeavePartyResponse response = new LeavePartyResponse() { Status = PartyJoinedStatusEnum.Disconnected };
|
||||
return Task.FromResult(response);
|
||||
}
|
||||
}
|
||||
}
|
10
Aurora/Backend/Server/Playback/PlaybackServiceImpl.cs
Normal file
10
Aurora/Backend/Server/Playback/PlaybackServiceImpl.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using Aurora.Backend.Proto;
|
||||
|
||||
namespace Aurora.Backend.Server
|
||||
{
|
||||
class PlaybackServiceImpl : PlaybackService.PlaybackServiceBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user