DatabaseUtils.closeDatabaseCSR(con, st, rs);
}
GArray<HashMap<String, Object>> list = mysql
.getAll("SELECT `obj_id`, `value`, (SELECT `account_name` FROM `characters` WHERE `characters`.`obj_Id` = `character_variables`.`obj_id` LIMIT 1) AS `account_name` FROM `character_variables` WHERE name LIKE 'offline'");
for (HashMap<String, Object> e : list) {
L2GameClient client = new L2GameClient(new MMOConnection<L2GameClient>(null), true);
client.setCharSelection((Integer) e.get("obj_id"));
L2Player p = client.loadCharFromDisk(0);
if (p == null || p.isDead()) {
continue;
}
client.setLoginName(e.get("account_name") == null ? "OfflineTrader_" + p.getName() : (String) e
.get("account_name"));
client.OnOfflineTrade();
p.restoreBonus();
p.spawnMe();
p.updateTerritories();
p.setOnlineStatus(false);
p.setOfflineMode(true);