return isBanned(user);
}
@Override
public PlayerSave loadPlayer(long user) {
PlayerSave save = new PlayerSave(user);
ResultSet result = resultSetFromLongs(Statements.playerData, user);
try {
if (!result.next()) {
return save;
}
save.setEventCD(result.getLong("eventcd"));
save.setOwner(result.getInt("owner"), result.getInt("group_id"),
result.getLong("sub_expires"));
save.setMuted(result.getLong("muted"));
save.setLogin(result.getLong("login_date"),
DataConversions.IPToLong(result.getString("login_ip")));
save.setLocation(result.getInt("x"), result.getInt("y"));
save.setFatigue(result.getInt("fatigue"));
save.setCombatStyle((byte) result.getInt("combatstyle"));
save.setPrivacy(result.getInt("block_chat") == 1,
result.getInt("block_private") == 1,
result.getInt("block_trade") == 1,
result.getInt("block_duel") == 1);
save.setSettings(result.getInt("cameraauto") == 1,
result.getInt("onemouse") == 1,
result.getInt("soundoff") == 1,
result.getInt("showroof") == 1,
result.getInt("autoscreenshot") == 1,
result.getInt("combatwindow") == 1);
save.setAppearance((byte) result.getInt("haircolour"),
(byte) result.getInt("topcolour"),
(byte) result.getInt("trousercolour"),
(byte) result.getInt("skincolour"),
(byte) result.getInt("headsprite"),
(byte) result.getInt("bodysprite"),
result.getInt("male") == 1, result.getInt("skulled"));
save.setExp(intArrayFromStringArray(Statements.playerExp, "exp_",
Config.statArray, user));
save.setCurStats(intArrayFromStringArray(Statements.playerCurExp,
"cur_", Config.statArray, user));
close(result);
result = resultSetFromLongs(Statements.playerInvItems, user);
while (result.next()) {
save.addInvItem(result.getInt("id"), result.getInt("amount"),
result.getInt("wielded") == 1);
}
close(result);
result = resultSetFromLongs(Statements.playerBankItems, user);
while (result.next()) {
save.addBankItem(result.getInt("id"), result.getInt("amount"));
}
close(result);
save.addFriends(longListFromResultSet(
resultSetFromLongs(Statements.playerFriends, user),
"friend"));
save.addIgnore(longListFromResultSet(
resultSetFromLongs(Statements.playerIngored, user),
"ignore"));
result = resultSetFromLongs(Statements.playerQuests, user);
while (result.next()) {
save.setQuestStage(result.getInt("id"), result.getInt("stage"));
}
close(result);
} catch (SQLException e) {
e.printStackTrace();