using System; using System.Threading.Tasks; using Aurora.Proto.PartyV2; using Aurora.Proto.General; using Aurora.Utils; namespace Aurora.Services.Server.Controllers { public partial class RemotePartyController : RemotePartyService.RemotePartyServiceBase { public override Task ListEventSubscriptions(ListEventSubscriptionsRequest request, Grpc.Core.ServerCallContext context) { throw new NotImplementedException(); } public override Task CreateEventSubscription(CreateEventSubscriptionRequest request, Grpc.Core.ServerCallContext context) { Console.WriteLine(string.Format("SERVER - Subscription from client with id: {0}", request.Parent)); this._eventManager.AddSubscription(Misc.Combine(new string[] { context.Peer, request.Parent }), request.EventSubscription.Type); return Task.FromResult(request.EventSubscription); } public override Task DeleteEventSubscription(DeleteEventSubscriptionRequest request, Grpc.Core.ServerCallContext context) { this._eventManager.RemoveSubscription(Misc.Combine(new string[] { context.Peer, request.Parent }), request.Type); return Task.FromResult(new Empty()); } public override Task DeleteAllEventSubscriptions(DeleteAllEventSubscriptionsRequest request, Grpc.Core.ServerCallContext context) { this._eventManager.RemoveAllSubscriptions(Misc.Combine(new string[] { context.Peer, request.Parent })); return Task.FromResult(new Empty()); } } }