예제 #1
0
        public override void WriteTo(TBufferWriter writer)
        {
            int gender = (int)Gender;

            writer.Write(UserID);
            writer.Write(NickName);
            writer.Write(Region);
            writer.Write(AccountType);
            writer.Write(gender);
            writer.Write(Age);
            writer.Write(Level);
        }
예제 #2
0
        public bool Encode(out byte[] buffer)
        {
            try
            {
                TBufferWriter writer = new TBufferWriter();
                BeforeEncode(writer);
                WriteTo(writer);

                buffer = writer.GetBufferData();
                return(true);
            }
            catch (Exception ex)
            {
                buffer = null;
                TLog.TError(ex);
                return(false);
            }
        }
예제 #3
0
        public bool Encode(TBufferWriter writer)
        {
            if (writer == null)
            {
                return(false);
            }
            try
            {
                BeforeEncode(writer);
                WriteTo(writer);

                return(true);
            }
            catch (Exception ex)
            {
                TLog.TError(ex);
                return(false);
            }
        }
예제 #4
0
 public override void WriteTo(TBufferWriter writer)
 {
     writer.Write(KVInfo);
 }
예제 #5
0
 protected virtual void BeforeEncode(TBufferWriter writer)
 {
 }
예제 #6
0
 public abstract void WriteTo(TBufferWriter writer);