Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: data/html/CommunityBoard/4.htm
- ===================================================================
- --- data/html/CommunityBoard/4.htm (revision 0)
- +++ data/html/CommunityBoard/4.htm (revision 0)
- @@ -0,0 +1,32 @@
- +<html>
- +<body>
- +<center><br><br>
- +
- +<table border=0 cellspacing=0 cellpadding=0>
- +<tr>
- +<td FIXWIDTH=15> </td>
- +<td width=750 height=30 align=left><a action="bypass _bbshome"> Back </a></td>
- +</tr></table>
- +<br>
- +<table border=0 cellspacing=0 cellpadding=2 bgcolor=5A5A5A width=750>
- +<tr>
- +
- +<td FIXWIDTH=2></td>
- +<td FIXWIDTH=15>#</td>
- +<td FIXWIDTH=90>Name</td>
- +<td FIXWIDTH=20>LvL</td>
- +<td FIXWIDTH=70>Class</td>
- +<td FIXWIDTH=70>Clan</td>
- +<td FIXWIDTH=70>Ally</td>
- +<td FIXWIDTH=25>PvP</td>
- +<td FIXWIDTH=90>Status</td>
- +<td FIXWIDTH=2></td>
- +</tr>
- +</table>
- +
- +%PlayerList%
- +
- +<br> <br> <br>
- +</center>
- +</body>
- +</html>
- \ No newline at end of file
- Index: data/html/CommunityBoard/index.htm
- ===================================================================
- --- data/html/CommunityBoard/index.htm (revision 0)
- +++ data/html/CommunityBoard/index.htm (revision 0)
- @@ -74,6 +74,22 @@
- +<html>
- +<body>
- +<br>
- +<br>
- +<center><font color="LEVEL">Community Board Manager</font><br></center>
- +
- +
- +
- +<table bgcolor=666666>
- +<tr>
- +<td width=40><button action="bypass _bbstop" width=32 height=32 back="L2UI_CT1.Icon_df_Min_herochat_Over" fore="L2UI_CT1.Icon_df_Min_herochat_Over"></td>
- +<td width=800 height=80>
- +<table>
- +<tr><td><a action="bypass _bbstop;1">Server Rules</a> |
- +<a action="bypass _bbstop;2">Announcement</a><br>
- +Here you can Find Server Rules and the Current News from the Server.
- +</td></tr>
- +
- +
- +</table>
- +</td>
- +</tr>
- +</table>
- +<br>
- +
- +
- +
- +
- +<table bgcolor=444444>
- +<tr>
- +<td width=40><button action="bypass _bbstop" width=32 height=32 back="L2UI_CT1.Icon_df_Min_MacroList_Over" fore="L2UI_CT1.Icon_df_Min_MacroList_Over"></td>
- +<td width=800 height=80>
- +<table>
- +<tr><td><a action="bypass _bbstop;1">Server Features</a> |
- +<a action="bypass _bbstop;2">ToDo List</a><br>
- +Here you can find a List of Features the Server can offer you, and a list of Comming Features.
- +</td></tr>
- +
- +
- +</table>
- +</td>
- +</tr>
- +</table>
- +<br>
- +
- +
- +
- +
- +
- +<table bgcolor=333333>
- +<tr>
- +<td width=40><button action="bypass _bbstop" width=32 height=32 back="L2UI_CT1.clan_DF_clanwaricon_bothside" fore="L2UI_CT1.clan_DF_clanwaricon_bothside"></td>
- +<td width=800 height=80>
- +<table>
- +<tr><td><a action="bypass _bbshome;4">Top PvP</a> | <a action="bypass _bbshome;5">Top PK</a> | <a action="bypass _bbshome;6">Top Online</a> | <a action="bypass _bbshome;7">Top Online</a><br>
- +Wanna know Who is on Top?, here you go Check out the Top PvP or PK list.
- +</td></tr>
- +
- +
- +</table>
- +</td>
- +</tr>
- +</table>
- +<br><br>
- +
- +<center><font color=F2C202>Credits eKo of L2Velocity</font>
- +<br><br>
- +<img src="l2ui.squaregray" width="760" height="1">
- +<br>
- +<center>
- +<table width=460 border=0 bgcolor="444444">
- +<tr>
- +</tr>
- +</table>
- +</body>
- +</html>
- Index: java/net/sf/l2j/gameserver/communitybbs/Manager/TopBBSManager.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/communitybbs/Manager/TopBBSManager.java (revision 0)
- +++ java/net/sf/l2j/gameserver/communitybbs/Manager/TopBBSManager.java (revision 0)
- @@ -21,6 +21,7 @@
- import java.util.StringTokenizer;
- import net.sf.l2j.gameserver.cache.HtmCache;
- +import net.sf.l2j.gameserver.model.PlayerList;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.network.serverpackets.ShowBoard;
- @@ -51,6 +53,20 @@
- }
- separateAndSend(content,activeChar);
- }
- + else if(command.startsWith("_bbshome;"))
- + {
- + PlayerList pl = new PlayerList();
- + StringTokenizer st = new StringTokenizer(command, ";");
- + st.nextToken();
- + int idp = Integer.parseInt(st.nextToken());
- + String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/"+idp+".htm");
- + if (content == null)
- + {
- + content = "<html><body><br><br><center>404 :File Not foud: 'data/html/CommunityBoard/"+idp+".htm' </center></body></html>";
- + }
- + content = content.replaceAll("%PlayerList%", pl.loadPlayerList());
- + separateAndSend(content,activeChar);
- + }
- else if(command.startsWith("_bbstop;"))
- {
- StringTokenizer st = new StringTokenizer(command, ";");
- Index: java/net/sf/l2j/gameserver/model/PlayerList.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/PlayerList.java (revision 0)
- +++ java/net/sf/l2j/gameserver/model/PlayerList.java (revision 0)
- @@ -0,0 +1,188 @@
- +package net.sf.l2j.gameserver.model;
- +
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.util.Map;
- +import java.util.logging.Logger;
- +
- +import net.sf.l2j.L2DatabaseFactory;
- +
- +import javolution.text.TextBuilder;
- +import javolution.util.FastMap;
- +
- +public class PlayerList
- +{
- + private static Logger _log = Logger.getLogger(PlayerList.class.getName());
- + private int _posId;
- + private TextBuilder _playerList = new TextBuilder();
- +
- +
- + public PlayerList()
- + {
- + loadFromDB();
- + }
- +
- + private void loadFromDB() {
- + java.sql.Connection con = null;
- + String top;
- +
- + top = "pvpkills";
- +
- + try
- + {
- + _posId = 0;
- + con = L2DatabaseFactory.getInstance().getConnection();
- + PreparedStatement statement = con.prepareStatement("SELECT char_name, base_class, "+top+", level, online, clan_name, ally_name FROM characters LEFT JOIN clan_data ON clan_id=clanid WHERE accesslevel=0 ORDER BY "+top+" DESC, char_name ASC LIMIT 10");
- + ResultSet result = statement.executeQuery();
- +
- + while (result.next())
- + {
- + boolean status = false;
- +
- + _posId = _posId + 1;
- + if(result.getInt("online") == 1)
- + status = true;
- +
- + addPlayerToList(_posId, result.getString("char_name"), result.getString("clan_name"), result.getString("ally_name"), result.getInt("base_class"), result.getInt("level"), result.getInt(top), status);
- + }
- +
- + result.close();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + e.printStackTrace();
- + }
- + finally
- + {
- + try
- + {
- + con.close();
- + }
- + catch (Exception e)
- + {
- + }
- + }
- + }
- +
- + public String loadPlayerList()
- + {
- + return _playerList.toString();
- + }
- +
- + private void addPlayerToList(int objId, String name, String clan, String alliance, int ChrClass, int level, int points, boolean isOnline)
- + {
- + _playerList.append("<table border=0 cellspacing=0 cellpadding=2 width=750>");
- + _playerList.append("<tr>");
- + _playerList.append("<td FIXWIDTH=2></td>");
- + _playerList.append("<td FIXWIDTH=15>"+objId+".</td>");
- + _playerList.append("<td FIXWIDTH=90>"+name+"</td>");
- + _playerList.append("<td FIXWIDTH=20>"+level+"</td>");
- + _playerList.append("<td FIXWIDTH=70>"+className(ChrClass)+"</td>");
- + _playerList.append("<td FIXWIDTH=70>"+clan+"</td>");
- + _playerList.append("<td FIXWIDTH=70>"+alliance+"</td>");
- + _playerList.append("<td FIXWIDTH=25>"+points+"</td>");
- + _playerList.append("<td FIXWIDTH=90>"+((isOnline) ? "<font color=99FF00>Online</font>" : "<font color=CC0000>Offline</font>")+"</td>");
- + _playerList.append("<td FIXWIDTH=2></td>");
- + _playerList.append("</tr>");
- + _playerList.append("</table>");
- + _playerList.append("<img src=\"L2UI.Squaregray\" width=\"740\" height=\"1\">");
- + }
- +
- + private final String className(int classId)
- + {
- + Map<Integer, String> classList;
- + classList = new FastMap<Integer, String>();
- + classList.put(0, "Fighter");
- + classList.put(1, "Warrior");
- + classList.put(2, "Gladiator");
- + classList.put(3, "Warlord");
- + classList.put(4, "Knight");
- + classList.put(5, "Paladin");
- + classList.put(6, "Dark Avenger");
- + classList.put(7, "Rogue");
- + classList.put(8, "Treasure Hunter");
- + classList.put(9, "Hawkeye");
- + classList.put(10, "Mage");
- + classList.put(11, "Wizard");
- + classList.put(12, "Sorcerer");
- + classList.put(13, "Necromancer");
- + classList.put(14, "Warlock");
- + classList.put(15, "Cleric");
- + classList.put(16, "Bishop");
- + classList.put(17, "Prophet");
- + classList.put(18, "Elven Fighter");
- + classList.put(19, "Elven Knight");
- + classList.put(20, "Temple Knight");
- + classList.put(21, "Swordsinger");
- + classList.put(22, "Elven Scout");
- + classList.put(23, "Plains Walker");
- + classList.put(24, "Silver Ranger");
- + classList.put(25, "Elven Mage");
- + classList.put(26, "Elven Wizard");
- + classList.put(27, "Spellsinger");
- + classList.put(28, "Elemental Summoner");
- + classList.put(29, "Oracle");
- + classList.put(30, "Elder");
- + classList.put(31, "Dark Fighter");
- + classList.put(32, "Palus Knightr");
- + classList.put(33, "Shillien Knight");
- + classList.put(34, "Bladedancer");
- + classList.put(35, "Assasin");
- + classList.put(36, "Abyss Walker");
- + classList.put(37, "Phantom Ranger");
- + classList.put(38, "Dark Mage");
- + classList.put(39, "Dark Wizard");
- + classList.put(40, "Spellhowler");
- + classList.put(41, "Phantom Summoner");
- + classList.put(42, "Shillien Oracle");
- + classList.put(43, "Shilien Elder");
- + classList.put(44, "Orc Fighter");
- + classList.put(45, "Orc Raider");
- + classList.put(46, "Destroyer");
- + classList.put(47, "Orc Monk");
- + classList.put(48, "Tyrant");
- + classList.put(49, "Orc Mage");
- + classList.put(50, "Orc Shaman");
- + classList.put(51, "Overlord");
- + classList.put(52, "Warcryer");
- + classList.put(53, "Dwarven Fighter");
- + classList.put(54, "Scavenger");
- + classList.put(55, "Bounty Hunter");
- + classList.put(56, "Artisan");
- + classList.put(57, "Warsmith");
- + classList.put(88, "Duelist");
- + classList.put(89, "Dreadnought");
- + classList.put(90, "Phoenix Knight");
- + classList.put(91, "Hell Knight");
- + classList.put(92, "Sagittarius");
- + classList.put(93, "Adventurer");
- + classList.put(94, "Archmage");
- + classList.put(95, "Soultaker");
- + classList.put(96, "Arcana Lord");
- + classList.put(97, "Cardinal");
- + classList.put(98, "Hierophant");
- + classList.put(99, "Evas Templar");
- + classList.put(100, "Sword Muse");
- + classList.put(101, "Wind Rider");
- + classList.put(102, "Moonlight Sentinel");
- + classList.put(103, "Mystic Muse");
- + classList.put(104, "Elemental Master");
- + classList.put(105, "Evas Saint");
- + classList.put(106, "Shillien Templar");
- + classList.put(107, "Spectral Dancer");
- + classList.put(108, "Ghost Hunter");
- + classList.put(109, "Ghost Sentinel");
- + classList.put(110, "Storm Screamer");
- + classList.put(111, "Spectral Master");
- + classList.put(112, "Shillien Saint");
- + classList.put(113, "Titan");
- + classList.put(114, "Grand Khavatari");
- + classList.put(115, "Dominator");
- + classList.put(116, "Doomcryer");
- + classList.put(117, "Fortune Seeker");
- + classList.put(118, "Maestro");
- +
- + return classList.get(classId);
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement