Ejemplo n.º 1
0
		public Msg DeCode(byte[] data)
		{
            IoBuffer buffer = new IoBuffer();
            buffer.Write(data, 0, data.Length);
            IoBufferReader reader = new IoBufferReader(buffer);
			reader.readInt();
			int cmd = reader.readInt();
			Dictionary<object, object> param = (Dictionary<object, object>)reader.Read();
			Msg msg = new Msg(cmd);
			msg.ParamMap = param;
			return msg;
		}
Ejemplo n.º 2
0
 public int DeCode(Session session, OnPackageRev handler)
 {
     try
     {
         IoBuffer       buffer = session.ReceiveBuffer;
         IoBufferReader reader = new IoBufferReader(buffer);
         reader.readInt();
         int cmd = reader.readInt();
         Dictionary <object, object> param = (Dictionary <object, object>)reader.Read();
         Msg msg = new Msg(cmd);
         msg.ParamMap = param;
         handler(msg);
         return(OK);
     }
     catch (Exception e)
     {
         logReport.OnWarningReport("decode not ok,protocal erro,ex:" + e.StackTrace);
         return(NOT_OK);
     }
 }