public override async void ExecuteAstralCommand(AgendaOnlineSession session, byte[] data) { var request = DtoSerializer.Deserialize<RequestBase>(data); var methodAndInstancePair = AppServicesMethods[request.GetType()]; Logger.Trace("{0} {1} {2}", methodAndInstancePair.Item1.Name, request.GetType().Name, session.GetSessionName()); try { var responseObj = methodAndInstancePair.Item1.Invoke(methodAndInstancePair.Item2, methodAndInstancePair.Item3 == ArgumentsOrder.SessionRequest ? new object[] { session, request } : new object[] { request, session }); if (methodAndInstancePair.Item1.ReturnType.IsSubclassOf(typeof(Task))) { var value = await (dynamic)responseObj; session.Send(value); } else if (methodAndInstancePair.Item1.ReturnType != typeof(void)) { session.Send(responseObj); } } catch (Exception exc) { Logger.Exception(exc, "{0} failed ({1}, {2})", methodAndInstancePair.Item1.Name, request.GetType().Name, session.GetSessionName()); } }
public override void ExecuteAstralCommand(AgendaOnlineSession session, byte[] data) { }
public override void ExecuteAstralCommand(AgendaOnlineSession session, byte[] data) { session.AppendResponse(data); }