Beispiel #1
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.hasRewardDesc())
            {
                byte[] bytes = new byte[buf.getShort()];
                buf.get(ref bytes, 0, bytes.Length);
                this.rewardDesc = System.Text.Encoding.UTF8.GetString(bytes);
            }

            if (this.hasRanking())
            {
                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.ranking.Add(OP_MATCH_PLAYER_INFO.decode(bytes));
                }
            }
        }
        public static OP_MATCH_PLAYER_INFO decode(byte[] data)
        {
            OP_MATCH_PLAYER_INFO proto = newBuilder();

            proto.build(data);
            return(proto);
        }
Beispiel #3
0
 public void addRanking(OP_MATCH_PLAYER_INFO value)
 {
     if (!this.hasRanking())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 2);
     }
     this.ranking.Add(value);
 }