Exemplo n.º 1
0
 /// <summary>
 /// Deserialization the specified val and offset.
 /// </summary>
 /// <param name="val">Value.</param>
 /// <param name="offset">Offset.</param>
 public virtual int Deserialization(byte[] val, int offset)
 {
     if (val == null)
     {
         return(0);
     }
     MsgID            = BitConvert.GetInt16(val, ref offset);
     MsgType          = BitConvert.GetInt16(val, ref offset);
     MsgSeq           = BitConvert.GetInt32(val, ref offset);
     SourceType       = BitConvert.GetByte(val, ref offset);
     DestType         = BitConvert.GetByte(val, ref offset);
     DestId           = BitConvert.GetInt32(val, ref offset);
     Session.PlayerID = BitConvert.GetInt32(val, ref offset);
     if (MsgType == GlobalConstantNet.MsgResponse)
     {
         ReturnCode = BitConvert.GetInt16(val, ref offset);
     }
     return(offset);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Deserialization the specified val and offset.
        /// </summary>
        /// <param name="val">Value.</param>
        /// <param name="offset">Offset.</param>
        public override int Deserialization(byte[] val, int offset)
        {
            int index = base.Deserialization(val, offset);

            index += 2;                                      //gameId;
            index += 2;                                      //roomType;

            short num = BitConvert.GetInt16(val, ref index); //table num.

            tables = new CustomerArray <TableInfo>(num);
            num    = BitConvert.GetInt16(val, ref index); //player num.
            TableInfo table;

            for (int i = 0, max = tables.MaxLength; i < max; i++)
            {
                table        = new TableInfo();
                table.ID     = BitConvert.GetInt32(val, ref index);
                table.Status = BitConvert.GetUInt16(val, ref index);
                tables[i]    = table;
            }
            return(index);
        }