示例#1
0
        public override void ReadFrom(TBufferReader reader)
        {
            int gender = 0;

            reader.Read(ref UserID);
            reader.Read(ref NickName);
            reader.Read(ref Region);
            reader.Read(ref AccountType);
            reader.Read(ref gender);
            reader.Read(ref Age);
            reader.Read(ref Level);
            Gender = (UserGender)gender;
        }
示例#2
0
 public bool Decode(TBufferReader reader)
 {
     if (reader != null)
     {
         try
         {
             BeforeDecode(reader);
             ReadFrom(reader);
             return(true);
         }
         catch (Exception ex)
         {
             TLog.TError(ex);
             return(false);
         }
     }
     return(false);
 }
示例#3
0
 public bool Decode(byte[] data)
 {
     if (data != null)
     {
         try
         {
             TBufferReader reader = new TBufferReader(data);
             BeforeDecode(reader);
             ReadFrom(reader);
             return(true);
         }
         catch (Exception ex)
         {
             TLog.TError(ex);
             return(false);
         }
     }
     return(false);
 }
示例#4
0
 public override void ReadFrom(TBufferReader reader)
 {
     reader.Read(ref KVInfo);
 }
示例#5
0
 protected virtual void BeforeDecode(TBufferReader reader)
 {
 }
示例#6
0
 public abstract void ReadFrom(TBufferReader reader);