private void OnDataReceive(byte[] data)
 {
     try
     {
         var pluto = Pluto.Decode(data);
         pluto.HandleData();
         //temp 以下代码需放在PRCCallPluto里面
         //if (!String.IsNullOrEmpty(pluto.FuncName) && pluto.Arguments != null)
         //    EventDispatcher.TriggerEvent<object[]>(pluto.FuncName, pluto.Arguments);
         //else
         //    LoggerHelper.Warning(String.Format("Null function in RpcCallPluto."));
         //LoggerHelper.Debug("OnDataReceive " + pluto.FuncName);
     }
     catch (Exception ex)
     {
         LoggerHelper.Except(ex);
     }
 }
Exemple #2
0
        private void OnDataReceive(ClientListener client, Byte[] data)
        {
            var pluto = Pluto.Decode(data);
            var type  = pluto.GetType();

            if (type == typeof(LoginPluto))
            {
                HandleLogin(client, pluto);
            }
            else if (type == typeof(MovePluto))
            {
                HandleMove(client, pluto);
            }
            else if (type == typeof(RpcCallPluto))
            {
                HandleRPCCall(client, pluto);
            }
            else
            {
                LoggerHelper.Debug("Unkown type pluto: " + pluto.GetType().ToString());
            }
        }