Пример #1
0
 override public void Encode(WriteBuffer wb)
 {
     Eproto.PackArray(wb, 11);
     Eproto.PackInteger(wb, this.game_id);
     Eproto.PackString(wb, this.game_name);
     Eproto.PackInteger(wb, this.player_number);
     Eproto.PackInteger(wb, this.owner_uid);
     Eproto.PackString(wb, this.owner_name);
     Eproto.PackInteger(wb, this.tid);
     Eproto.PackInteger(wb, this.create_time);
     Eproto.PackInteger(wb, this.state);
     Eproto.PackString(wb, this.game_info);
     if (this.signup_users == null)
     {
         Eproto.PackNil(wb);
     }
     else
     {
         Eproto.PackArray(wb, this.signup_users.Length);
         for (int i = 0; i < this.signup_users.Length; ++i)
         {
             user_info v = this.signup_users[i];
             if (v == null)
             {
                 Eproto.PackNil(wb);
             }
             else
             {
                 v.Encode(wb);
             }
         }
     }
     Eproto.PackBool(wb, this.ss);
 }
Пример #2
0
        override public void Decode(ReadBuffer rb)
        {
            long c = Eproto.UnpackArray(rb);

            if (c <= 0)
            {
                return;
            }
            Eproto.UnpackInteger(rb, ref this.game_id);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackString(rb, ref this.game_name);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackInteger(rb, ref this.player_number);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackInteger(rb, ref this.owner_uid);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackString(rb, ref this.owner_name);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackInteger(rb, ref this.tid);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackInteger(rb, ref this.create_time);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackInteger(rb, ref this.state);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackString(rb, ref this.game_info);
            if (--c <= 0)
            {
                return;
            }
            {
                long n = Eproto.UnpackArray(rb);
                if (n < 0)
                {
                    this.signup_users = null;
                }
                else
                {
                    this.signup_users = new user_info[n];
                    for (int i = 0; i < n; ++i)
                    {
                        user_info v = null;
                        if (rb.NextIsNil())
                        {
                            rb.MoveNext();
                        }
                        else
                        {
                            v = new user_info(); v.Decode(rb);
                        }
                        this.signup_users[i] = v;
                    }
                }
            }
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackBool(rb, ref this.ss);
            if (--c <= 0)
            {
                return;
            }
            Eproto.UnpackDiscard(rb, c);
        }