****UPDATE****
completed all the mistakes
but the CommunityBoard still don't work
im feeling the its with the TopBBS manager
if somebody know what wrong here please let me know
Thanks again 4 ur time
public void parseCmd(String command, Player player) {
String fileName = "";
StringTokenizer st;
String ip;
String content;
if (Config.ENABLE_COMMUNITY_BOARD) {
if (command.equals("_bbstop") || command.equals("_bbshome")) {
fileName = "data/html/CommunityBoard/Custom/CustomIndex.htm";
}
if (command.startsWith("_bbshome;")) {
st = new StringTokenizer(command, ";");
st.nextToken();
ip = st.nextToken();
fileName = "data/html/CommunityBoard/Custom" + ip + ".htm";
}
if (fileName.length() == 0) {
return;
}
content = HtmCache.getInstance().getHtm(fileName);
ip = "N/A";
String account = "N/A";
try {
String clientInfo = player.getClient().toString();
account = clientInfo.substring(clientInfo.indexOf("Account: ") + 9, clientInfo.indexOf(" - IP: "));
ip = clientInfo.substring(clientInfo.indexOf(" - IP: ") + 7, clientInfo.lastIndexOf("]"));
} catch (Exception var8) {
}
if (fileName.equals("data/html/CommunityBoard/Custom/toppvp.htm")) {
}
PlayerList pk = new PlayerList(1);
content = content.replaceAll("%pvplist%", pk.loadPlayerList());
if (fileName.equals("data/html/CommunityBoard/Custom/castle.htm")) {
}
CastleStatus status = new CastleStatus();
content = content.replaceAll("%castle%", status.loadCastleList());
if (fileName.equals("data/html/CommunityBoard/Custom/toppk.htm")) {
}
pk = new PlayerList(0);
content = content.replaceAll("%pklist%", pk.loadPlayerList());
if (fileName.equals("data/html/CommunityBoard/Custom/accinfo.htm")) {
}
content = content.replaceAll("%name%", player.getName());
content = content.replaceAll("%level%", String.valueOf(player.getLevel()));
content = content.replaceAll("%clan%", String.valueOf(ClanTable.getInstance().getClan(player.getClanId())));
content = content.replaceAll("%xp%", String.valueOf(player.getExp()));
content = content.replaceAll("%sp%", String.valueOf(player.getSp()));
content = content.replaceAll("%class%", player.getTemplate().getClassName());
content = content.replaceAll("%classid%", String.valueOf(player.getClassId()));
content = content.replaceAll("%currenthp%", String.valueOf((int)player.getCurrentHp()));
content = content.replaceAll("%maxhp%", String.valueOf(player.getMaxHp()));
content = content.replaceAll("%currentmp%", String.valueOf((int)player.getCurrentMp()));
content = content.replaceAll("%maxmp%", String.valueOf(player.getMaxMp()));
content = content.replaceAll("%currentcp%", String.valueOf((int)player.getCurrentCp()));
content = content.replaceAll("%maxcp%", String.valueOf(player.getMaxCp()));
content = content.replaceAll("%currentload%", String.valueOf(player.getCurrentLoad()));
content = content.replaceAll("%maxload%", String.valueOf(player.getMaxLoad()));
content = content.replaceAll("%access%", String.valueOf(player.getAccessLevel().getLevel()));
content = content.replaceAll("%account%", account);
content = content.replaceAll("%ip%", ip);
if (fileName.equals("data/html/CommunityBoard/Custom/topadena.htm")) {
}
TopAdena topAdena = new TopAdena();
content = content.replaceAll("%topadena%", topAdena.loadPlayerList());
if (fileName.equals("data/html/CommunityBoard/Custom/gms.htm")) {
}
content = content.replaceAll("%antharas%", bossStatus(29019));
content = content.replaceAll("%valakas%", bossStatus(29028));
content = content.replaceAll("%baium%", bossStatus(29001));
content = content.replaceAll("%antqueen%", bossStatus(29020));
content = content.replaceAll("%core%", bossStatus(29006));
content = content.replaceAll("%zaken%", bossStatus(29022));
content = content.replaceAll("%frintezza%", bossStatus(29045));
if (fileName.equals("data/html/CommunityBoard/Custom/repair.htm")) {
}
content = content.replaceAll("%acc_chars%", getCharList(player));
if (fileName.equals("data/html/CommunityBoard/Custom/stats.htm")) {
}
} else {
if (command.equals("_bbstop") || command.equals("_bbshome")) {
fileName = "data/html/CommunityBoard/Index.htm";
}
if (command.startsWith("_bbstop;")) {
st = new StringTokenizer(command, ";");
st.nextToken();
ip = st.nextToken();
fileName = "data/html/CommunityBoard/" + ip + ".htm";
}
if (fileName.length() == 0) {
return;
}
content = HtmCache.getInstance().getHtm(fileName);
if (content != null) {
separateAndSend(content, player);
}
}
}
public void parseWrite(String ar1, String ar2, String ar3, String ar4, String ar5, Player player) {
}
private static String bossStatus(int bossId) {
long delay = GrandBossManager.getInstance().getStatsSet(bossId).getLong("respawn_time");
return delay <= System.currentTimeMillis() ? "<font color=\"9CC300\">Alive</font>" : "<font color=\"ff0000\">Dead</font>";
}
private static String getCharList(Player player) {
String result = "";
String repCharAcc = player.getAccountName();
Connection con = null;
String var5;
try {
con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement("SELECT char_name FROM characters WHERE account_name=?");
statement.setString(1, repCharAcc);
ResultSet rset = statement.executeQuery();
while(rset.next()) {
if (player.getName().compareTo(rset.getString(1)) != 0) {
result = result + rset.getString(1) + ";";
}
}
rset.close();
statement.close();
return result;
} catch (SQLException var9) {
var9.printStackTrace();
var5 = result;
} finally {
CloseUtil.close(con);
}
return var5;
}
public static TopBBSManager getInstance() {
return SingletonHolder.INSTANCE;
}
private static class SingletonHolder {
protected static final TopBBSManager INSTANCE = new TopBBSManager();
private SingletonHolder() {
}
}
}