Цитата:
Сообщение от JackTheRipp
in login screen vitality point sends in CharacterSelectionInfo packet (opcode 0x09)
|
CharacterSelectionInfo already done, but still not work
Код:
writeD(charSelectionInfo.getVitalityPoints());
writeD(charInfoPackage.getAccessLevel() > -100 ? 0x01 : 0x00);// Активен ли.
i++;
}
}
public static CharSelectionInfo loadCharacterSelectInfo(String loginName) {
CharSelectionInfo charSelectionInfo = new CharSelectionInfo();
Connection con = null;
PreparedStatement statement = null;
ResultSet rset = null;
try {
con = DatabaseFactory.getInstance().getConnection();
statement = con.prepareStatement("SELECT * FROM characters AS c LEFT JOIN character_subclasses AS cs ON (c.obj_Id=cs.char_obj_id AND cs.active=1) WHERE account_name=? LIMIT 7");
statement.setString(1, loginName);
rset = statement.executeQuery();
while (rset.next()) { // fills the package
charSelectionInfo.addSelectionInfo(restoreChar(rset));
}
DbUtils.closeQuietly(statement, rset);
statement = con.prepareStatement("SELECT `points` FROM `vitality_points` WHERE `account_name`=?");
statement.setString(1, loginName);
rset = statement.executeQuery();
if (rset.next()) {
int points = rset.getInt(1);
charSelectionInfo.setVitalityPoints(points);
}
} catch (Exception e) {
_log.error("could not restore charinfo:", e);
} finally {
DbUtils.closeQuietly(con, statement, rset);
}
return charSelectionInfo;
}