use of org.apollo.game.message.impl.PlayerDesignMessage in project apollo by apollo-rsps.
the class PlayerDesignMessageDecoder method decode.
@Override
public PlayerDesignMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int genderIntValue = (int) reader.getUnsigned(DataType.BYTE);
int[] style = new int[7];
for (int i = 0; i < style.length; i++) {
style[i] = (int) reader.getUnsigned(DataType.BYTE);
}
int[] color = new int[5];
for (int i = 0; i < color.length; i++) {
color[i] = (int) reader.getUnsigned(DataType.BYTE);
}
Gender gender = genderIntValue == Gender.MALE.toInteger() ? Gender.MALE : Gender.FEMALE;
return new PlayerDesignMessage(new Appearance(gender, style, color));
}
use of org.apollo.game.message.impl.PlayerDesignMessage in project apollo by apollo-rsps.
the class PlayerDesignMessageDecoder method decode.
@Override
public PlayerDesignMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int genderIntValue = (int) reader.getUnsigned(DataType.BYTE);
int[] style = new int[7];
for (int i = 0; i < style.length; i++) {
style[i] = (int) reader.getUnsigned(DataType.BYTE);
}
int[] color = new int[5];
for (int i = 0; i < color.length; i++) {
color[i] = (int) reader.getUnsigned(DataType.BYTE);
}
Gender gender = genderIntValue == Gender.MALE.toInteger() ? Gender.MALE : Gender.FEMALE;
return new PlayerDesignMessage(new Appearance(gender, style, color));
}
Aggregations