public static POKER decode(byte[] data) { POKER proto = newBuilder(); proto.build(data); return(proto); }
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.hasPos()) { this.pos = buf.getInt(); } if (this.hasZjhPoker()) { 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.zjh_poker.Add(POKER.decode(bytes)); } } if (this.hasPokerstatus()) { this.pokerstatus = (ENUM_POKER_STATUS)buf.get(); } }
public void addZjhPoker(POKER value) { if (!this.hasZjhPoker()) { this.__flag[0] = (byte)(this.__flag[0] | 64); } this.zjh_poker.Add(value); }
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.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.hasZjhPoker()) { 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.zjh_poker.Add(POKER.decode(bytes)); } } if (this.hasGold()) { this.gold = buf.getFloat(); } }
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.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.hasPassportId()) { this.passportId = buf.getInt(); } if (this.hasPos()) { this.pos = buf.getInt(); } if (this.hasZjhPoker()) { 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.zjh_poker.Add(POKER.decode(bytes)); } } if (this.hasZjhEnumRoomresult()) { this.zjh_enum_roomresult = (ENUM_ROOMRESULT)buf.get(); } if (this.hasStatus()) { this.status = (ENUM_SEAT_STATUS)buf.get(); } if (this.hasHomeLorder()) { if (buf.get() == 1) { this.homeLorder = true; } else { this.homeLorder = false; } } if (this.hasIsWiner()) { if (buf.get() == 1) { this.isWiner = true; } else { this.isWiner = false; } } if (this.hasPokerstatus()) { this.pokerstatus = (ENUM_POKER_STATUS)buf.get(); } if (this.hasOpreateStatus()) { this.opreateStatus = (ENUM_SEATOPERATE_STATUS)buf.get(); } if (this.hasUnixtime()) { this.unixtime = buf.getLong(); } if (this.hasGold()) { this.gold = buf.getFloat(); } if (this.hasProfit()) { this.Profit = buf.getFloat(); } if (this.hasTotalPour()) { this.totalPour = buf.getFloat(); } if (this.hasPour()) { this.pour = buf.getFloat(); } if (this.hasMaxLoop()) { this.maxLoop = buf.getInt(); } if (this.hasISLOWSCORE()) { if (buf.get() == 1) { this.ISLOWSCORE = true; } else { this.ISLOWSCORE = false; } } if (this.hasType()) { this.type = 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.hasIsAfk()) { if (buf.get() == 1) { this.isAfk = true; } else { this.isAfk = false; } } }