コード例 #1
0
        public static POCKER_INFO decode(byte[] data)
        {
            POCKER_INFO proto = newBuilder();

            proto.build(data);
            return(proto);
        }
コード例 #2
0
        public void build(byte[] data)
        {
            ByteBuffer buf = ByteBuffer.wrap(data);

            for (int i = 0; i < this.__flag.Length; i++)
            {
                this.__flag[i] = buf.get();
            }

            if (this.hasType())
            {
                this.type = buf.getInt();
            }

            if (this.hasPockerInfo())
            {
                int size = buf.getShort();
                for (int i = 0; i < size; i++)
                {
                    byte[] bytes = new byte[buf.getInt()];
                    buf.get(ref bytes, 0, bytes.Length);
                    this.pocker_info.Add(POCKER_INFO.decode(bytes));
                }
            }
        }
コード例 #3
0
 public void addPockerInfo(POCKER_INFO value)
 {
     if (!this.hasPockerInfo())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 1);
     }
     this.pocker_info.Add(value);
 }
コード例 #4
0
        public void build(byte[] data)
        {
            ByteBuffer buf = ByteBuffer.wrap(data);

            for (int i = 0; i < this.__flag.Length; i++)
            {
                this.__flag[i] = buf.get();
            }

            if (this.hasUnixtime())
            {
                this.unixtime = buf.getLong();
            }

            if (this.hasPos())
            {
                this.pos = buf.getInt();
            }

            if (this.hasLongitude())
            {
                this.longitude = buf.getFloat();
            }

            if (this.hasLatitude())
            {
                this.latitude = buf.getFloat();
            }

            if (this.hasPlayerId())
            {
                this.playerId = buf.getInt();
            }

            if (this.hasNickname())
            {
                byte[] bytes = new byte[buf.getShort()];
                buf.get(ref bytes, 0, bytes.Length);
                this.nickname = System.Text.Encoding.UTF8.GetString(bytes);
            }

            if (this.hasAvatar())
            {
                byte[] bytes = new byte[buf.getShort()];
                buf.get(ref bytes, 0, bytes.Length);
                this.avatar = System.Text.Encoding.UTF8.GetString(bytes);
            }

            if (this.hasGender())
            {
                this.gender = buf.get();
            }

            if (this.hasGold())
            {
                this.gold = buf.getInt();
            }

            if (this.hasPockerInfo())
            {
                int size = buf.getShort();
                for (int i = 0; i < size; i++)
                {
                    byte[] bytes = new byte[buf.getInt()];
                    buf.get(ref bytes, 0, bytes.Length);
                    this.pocker_info.Add(POCKER_INFO.decode(bytes));
                }
            }

            if (this.hasSeatStatus())
            {
                this.seat_status = (SEAT_STATUS)buf.get();
            }

            if (this.hasHandPocker())
            {
                this.HandPocker = buf.getInt();
            }
        }