public void onValidateCreatedCharacter(P132_ValidateCreatedCharacter action)
{
LOGGER.debug("Got the validate created character packet");
// extract the session and attachment...
ClientBean client = ClientBean.get(action.getChannel());
// extract the data of the new char
String characterName = action.getCharName();
// get character properties
byte[] appearance = action.getAppearanceAndProfession();
byte sex = (byte) (appearance[0] & 1);
byte height = (byte) ((appearance[0] >> 1) & 0xF);
byte skin = (byte) (((appearance[0] >> 5) | (appearance[1] << 3)) & 0x1F);
byte haircolor = (byte) ((appearance[1] >> 2) & 0x1F);
byte face = (byte) (((appearance[1] >> 7) | (appearance[2] << 1)) & 0x1F);
byte hairstyle = (byte) (appearance[3] & 0x1F);
byte campaign = (byte) ((appearance[3] >> 6) & 3);
// extract the professions
byte primary = (byte) ((appearance[2] >> 4) & 0xF);
byte secondary = 0;
// perform some unkown action...
CharacterCreationView.unkownStep1(action.getChannel());
Character chara = CharacterJpaController.get().findByName(characterName);
// if name is in use ....
if (chara != null)
{
CharacterCreationView.error(action.getChannel(), ErrorCode.CCNameInUse);
}
// if name is not in use create a new char in the db
Character dbChar = new Character();
dbChar.setName(characterName);
dbChar.setAccountID(client.getAccount());
dbChar.setSex((short)sex);
dbChar.setHeight((short)height);
dbChar.setHeight((short)skin);
dbChar.setFace((short)face);
dbChar.setHaircolor((short)haircolor);