Esempio n. 1
0
        public override void ExecuteAstralCommand(AboSession 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.ReflectedType != typeof (void))
                {
                    session.Send(responseObj);
                }
            }
            catch (Exception exc)
            {
                Logger.Exception(exc, "{0} failed ({1},  {2})", methodAndInstancePair.Item1.Name, request.GetType().Name, session.GetSessionName());
            }
        }
Esempio n. 2
0
 public override void ExecuteAstralCommand(AboSession session, byte[] data)
 {
 }
Esempio n. 3
0
 public override void ExecuteAstralCommand(AboSession session, byte[] data)
 {
     session.AppendResponse(data);
 }