responseCode = Constants.SMSG_HIGH_SCORE;
}
@Override
public byte[] constructResponseInBytes() {
GamePacket packet = new GamePacket(responseCode);
packet.addShort16(type);
packet.addShort16((short) scoreList.size());
for (String[] score : scoreList) {
packet.addString(score[0]);
packet.addInt32(Integer.parseInt(score[1]));
}
packet.addShort16((short) totalScoreList.size());
for (String[] score : totalScoreList) {
packet.addString(score[0]);
packet.addInt32(Integer.parseInt(score[1]));
}
packet.addShort16((short) currentScoreList.size());
for (String[] score : currentScoreList) {
packet.addString(score[0]);
packet.addInt32(Integer.parseInt(score[1]));
}
return packet.getBytes();
}