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.hasClubId()) {
			this.clubId = buf.getInt();
		}

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

		if(this.hasIdentity()) {
			this.identity = (ENUM_PLAYER_IDENTITY) buf.get();
		}

	} 
Exemple #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.hasClubId())
            {
                this.clubId = buf.getInt();
            }

            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.hasGameId())
            {
                this.gameId = buf.getInt();
            }

            if (this.hasRoomId())
            {
                this.roomId = buf.getInt();
            }

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

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

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

            if (this.hasOnline())
            {
                this.online = buf.getLong();
            }

            if (this.hasIdentity())
            {
                this.identity = (ENUM_PLAYER_IDENTITY)buf.get();
            }
        }