Advertisement
Guest User

Untitled

a guest
Sep 24th, 2011
3,126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.57 KB | None | 0 0
  1. Index: data/html/CommunityBoard/4.htm
  2. ===================================================================
  3. --- data/html/CommunityBoard/4.htm (revision 0)
  4. +++ data/html/CommunityBoard/4.htm (revision 0)
  5. @@ -0,0 +1,32 @@
  6. +<html>
  7. +<body>
  8. +<center><br><br>
  9. +
  10. +<table border=0 cellspacing=0 cellpadding=0>
  11. +<tr>
  12. +<td FIXWIDTH=15>&nbsp;</td>
  13. +<td width=750 height=30 align=left><a action="bypass _bbshome"> Back </a></td>
  14. +</tr></table>
  15. +<br>
  16. +<table border=0 cellspacing=0 cellpadding=2 bgcolor=5A5A5A width=750>
  17. +<tr>
  18. +
  19. +<td FIXWIDTH=2></td>
  20. +<td FIXWIDTH=15>#</td>
  21. +<td FIXWIDTH=90>Name</td>
  22. +<td FIXWIDTH=20>LvL</td>
  23. +<td FIXWIDTH=70>Class</td>
  24. +<td FIXWIDTH=70>Clan</td>
  25. +<td FIXWIDTH=70>Ally</td>
  26. +<td FIXWIDTH=25>PvP</td>
  27. +<td FIXWIDTH=90>Status</td>
  28. +<td FIXWIDTH=2></td>
  29. +</tr>
  30. +</table>
  31. +
  32. +%PlayerList%
  33. +
  34. +<br> <br> <br>
  35. +</center>
  36. +</body>
  37. +</html>
  38. \ No newline at end of file
  39. Index: data/html/CommunityBoard/index.htm
  40. ===================================================================
  41. --- data/html/CommunityBoard/index.htm (revision 0)
  42. +++ data/html/CommunityBoard/index.htm (revision 0)
  43. @@ -74,6 +74,22 @@
  44. +<html>
  45. +<body>
  46. +<br>
  47. +<br>
  48. +<center><font color="LEVEL">Community Board Manager</font><br></center>
  49. +
  50. +
  51. +
  52. +<table bgcolor=666666>
  53. +<tr>
  54. +<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>
  55. +<td width=800 height=80>
  56. +<table>
  57. +<tr><td><a action="bypass _bbstop;1">Server Rules</a> &nbsp;|&nbsp;
  58. +<a action="bypass _bbstop;2">Announcement</a><br>
  59. +Here you can Find Server Rules and the Current News from the Server.
  60. +</td></tr>
  61. +
  62. +
  63. +</table>
  64. +</td>
  65. +</tr>
  66. +</table>
  67. +<br>
  68. +
  69. +
  70. +
  71. +
  72. +<table bgcolor=444444>
  73. +<tr>
  74. +<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>
  75. +<td width=800 height=80>
  76. +<table>
  77. +<tr><td><a action="bypass _bbstop;1">Server Features</a> &nbsp;|&nbsp;
  78. +<a action="bypass _bbstop;2">ToDo List</a><br>
  79. +Here you can find a List of Features the Server can offer you, and a list of Comming Features.
  80. +</td></tr>
  81. +
  82. +
  83. +</table>
  84. +</td>
  85. +</tr>
  86. +</table>
  87. +<br>
  88. +
  89. +
  90. +
  91. +
  92. +
  93. +<table bgcolor=333333>
  94. +<tr>
  95. +<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>
  96. +<td width=800 height=80>
  97. +<table>
  98. +<tr><td><a action="bypass _bbshome;4">Top PvP</a> &nbsp;|&nbsp; <a action="bypass _bbshome;5">Top PK</a> &nbsp;|&nbsp;<a action="bypass _bbshome;6">Top Online</a>&nbsp;|&nbsp;<a action="bypass _bbshome;7">Top Online</a><br>
  99. +Wanna know Who is on Top?, here you go Check out the Top PvP or PK list.
  100. +</td></tr>
  101. +
  102. +
  103. +</table>
  104. +</td>
  105. +</tr>
  106. +</table>
  107. +<br><br>
  108. +
  109. +<center><font color=F2C202>Credits eKo of L2Velocity</font>
  110. +<br><br>
  111. +<img src="l2ui.squaregray" width="760" height="1">
  112. +<br>
  113. +<center>
  114. +<table width=460 border=0 bgcolor="444444">
  115. +<tr>
  116. +</tr>
  117. +</table>
  118. +</body>
  119. +</html>
  120. Index: java/net/sf/l2j/gameserver/communitybbs/Manager/TopBBSManager.java
  121. ===================================================================
  122. --- java/net/sf/l2j/gameserver/communitybbs/Manager/TopBBSManager.java (revision 0)
  123. +++ java/net/sf/l2j/gameserver/communitybbs/Manager/TopBBSManager.java (revision 0)
  124. @@ -21,6 +21,7 @@
  125. import java.util.StringTokenizer;
  126.  
  127. import net.sf.l2j.gameserver.cache.HtmCache;
  128. +import net.sf.l2j.gameserver.model.PlayerList;
  129. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  130. import net.sf.l2j.gameserver.network.serverpackets.ShowBoard;
  131.  
  132. @@ -51,6 +53,20 @@
  133. }
  134. separateAndSend(content,activeChar);
  135. }
  136. + else if(command.startsWith("_bbshome;"))
  137. + {
  138. + PlayerList pl = new PlayerList();
  139. + StringTokenizer st = new StringTokenizer(command, ";");
  140. + st.nextToken();
  141. + int idp = Integer.parseInt(st.nextToken());
  142. + String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/"+idp+".htm");
  143. + if (content == null)
  144. + {
  145. + content = "<html><body><br><br><center>404 :File Not foud: 'data/html/CommunityBoard/"+idp+".htm' </center></body></html>";
  146. + }
  147. + content = content.replaceAll("%PlayerList%", pl.loadPlayerList());
  148. + separateAndSend(content,activeChar);
  149. + }
  150. else if(command.startsWith("_bbstop;"))
  151. {
  152. StringTokenizer st = new StringTokenizer(command, ";");
  153. Index: java/net/sf/l2j/gameserver/model/PlayerList.java
  154. ===================================================================
  155. --- java/net/sf/l2j/gameserver/model/PlayerList.java (revision 0)
  156. +++ java/net/sf/l2j/gameserver/model/PlayerList.java (revision 0)
  157. @@ -0,0 +1,188 @@
  158. +package net.sf.l2j.gameserver.model;
  159. +
  160. +import java.sql.PreparedStatement;
  161. +import java.sql.ResultSet;
  162. +import java.util.Map;
  163. +import java.util.logging.Logger;
  164. +
  165. +import net.sf.l2j.L2DatabaseFactory;
  166. +
  167. +import javolution.text.TextBuilder;
  168. +import javolution.util.FastMap;
  169. +
  170. +public class PlayerList
  171. +{
  172. + private static Logger _log = Logger.getLogger(PlayerList.class.getName());
  173. + private int _posId;
  174. + private TextBuilder _playerList = new TextBuilder();
  175. +
  176. +
  177. + public PlayerList()
  178. + {
  179. + loadFromDB();
  180. + }
  181. +
  182. + private void loadFromDB() {
  183. + java.sql.Connection con = null;
  184. + String top;
  185. +
  186. + top = "pvpkills";
  187. +
  188. + try
  189. + {
  190. + _posId = 0;
  191. + con = L2DatabaseFactory.getInstance().getConnection();
  192. + 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");
  193. + ResultSet result = statement.executeQuery();
  194. +
  195. + while (result.next())
  196. + {
  197. + boolean status = false;
  198. +
  199. + _posId = _posId + 1;
  200. + if(result.getInt("online") == 1)
  201. + status = true;
  202. +
  203. + 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);
  204. + }
  205. +
  206. + result.close();
  207. + statement.close();
  208. + }
  209. + catch (Exception e)
  210. + {
  211. + e.printStackTrace();
  212. + }
  213. + finally
  214. + {
  215. + try
  216. + {
  217. + con.close();
  218. + }
  219. + catch (Exception e)
  220. + {
  221. + }
  222. + }
  223. + }
  224. +
  225. + public String loadPlayerList()
  226. + {
  227. + return _playerList.toString();
  228. + }
  229. +
  230. + private void addPlayerToList(int objId, String name, String clan, String alliance, int ChrClass, int level, int points, boolean isOnline)
  231. + {
  232. + _playerList.append("<table border=0 cellspacing=0 cellpadding=2 width=750>");
  233. + _playerList.append("<tr>");
  234. + _playerList.append("<td FIXWIDTH=2></td>");
  235. + _playerList.append("<td FIXWIDTH=15>"+objId+".</td>");
  236. + _playerList.append("<td FIXWIDTH=90>"+name+"</td>");
  237. + _playerList.append("<td FIXWIDTH=20>"+level+"</td>");
  238. + _playerList.append("<td FIXWIDTH=70>"+className(ChrClass)+"</td>");
  239. + _playerList.append("<td FIXWIDTH=70>"+clan+"</td>");
  240. + _playerList.append("<td FIXWIDTH=70>"+alliance+"</td>");
  241. + _playerList.append("<td FIXWIDTH=25>"+points+"</td>");
  242. + _playerList.append("<td FIXWIDTH=90>"+((isOnline) ? "<font color=99FF00>Online</font>" : "<font color=CC0000>Offline</font>")+"</td>");
  243. + _playerList.append("<td FIXWIDTH=2></td>");
  244. + _playerList.append("</tr>");
  245. + _playerList.append("</table>");
  246. + _playerList.append("<img src=\"L2UI.Squaregray\" width=\"740\" height=\"1\">");
  247. + }
  248. +
  249. + private final String className(int classId)
  250. + {
  251. + Map<Integer, String> classList;
  252. + classList = new FastMap<Integer, String>();
  253. + classList.put(0, "Fighter");
  254. + classList.put(1, "Warrior");
  255. + classList.put(2, "Gladiator");
  256. + classList.put(3, "Warlord");
  257. + classList.put(4, "Knight");
  258. + classList.put(5, "Paladin");
  259. + classList.put(6, "Dark Avenger");
  260. + classList.put(7, "Rogue");
  261. + classList.put(8, "Treasure Hunter");
  262. + classList.put(9, "Hawkeye");
  263. + classList.put(10, "Mage");
  264. + classList.put(11, "Wizard");
  265. + classList.put(12, "Sorcerer");
  266. + classList.put(13, "Necromancer");
  267. + classList.put(14, "Warlock");
  268. + classList.put(15, "Cleric");
  269. + classList.put(16, "Bishop");
  270. + classList.put(17, "Prophet");
  271. + classList.put(18, "Elven Fighter");
  272. + classList.put(19, "Elven Knight");
  273. + classList.put(20, "Temple Knight");
  274. + classList.put(21, "Swordsinger");
  275. + classList.put(22, "Elven Scout");
  276. + classList.put(23, "Plains Walker");
  277. + classList.put(24, "Silver Ranger");
  278. + classList.put(25, "Elven Mage");
  279. + classList.put(26, "Elven Wizard");
  280. + classList.put(27, "Spellsinger");
  281. + classList.put(28, "Elemental Summoner");
  282. + classList.put(29, "Oracle");
  283. + classList.put(30, "Elder");
  284. + classList.put(31, "Dark Fighter");
  285. + classList.put(32, "Palus Knightr");
  286. + classList.put(33, "Shillien Knight");
  287. + classList.put(34, "Bladedancer");
  288. + classList.put(35, "Assasin");
  289. + classList.put(36, "Abyss Walker");
  290. + classList.put(37, "Phantom Ranger");
  291. + classList.put(38, "Dark Mage");
  292. + classList.put(39, "Dark Wizard");
  293. + classList.put(40, "Spellhowler");
  294. + classList.put(41, "Phantom Summoner");
  295. + classList.put(42, "Shillien Oracle");
  296. + classList.put(43, "Shilien Elder");
  297. + classList.put(44, "Orc Fighter");
  298. + classList.put(45, "Orc Raider");
  299. + classList.put(46, "Destroyer");
  300. + classList.put(47, "Orc Monk");
  301. + classList.put(48, "Tyrant");
  302. + classList.put(49, "Orc Mage");
  303. + classList.put(50, "Orc Shaman");
  304. + classList.put(51, "Overlord");
  305. + classList.put(52, "Warcryer");
  306. + classList.put(53, "Dwarven Fighter");
  307. + classList.put(54, "Scavenger");
  308. + classList.put(55, "Bounty Hunter");
  309. + classList.put(56, "Artisan");
  310. + classList.put(57, "Warsmith");
  311. + classList.put(88, "Duelist");
  312. + classList.put(89, "Dreadnought");
  313. + classList.put(90, "Phoenix Knight");
  314. + classList.put(91, "Hell Knight");
  315. + classList.put(92, "Sagittarius");
  316. + classList.put(93, "Adventurer");
  317. + classList.put(94, "Archmage");
  318. + classList.put(95, "Soultaker");
  319. + classList.put(96, "Arcana Lord");
  320. + classList.put(97, "Cardinal");
  321. + classList.put(98, "Hierophant");
  322. + classList.put(99, "Evas Templar");
  323. + classList.put(100, "Sword Muse");
  324. + classList.put(101, "Wind Rider");
  325. + classList.put(102, "Moonlight Sentinel");
  326. + classList.put(103, "Mystic Muse");
  327. + classList.put(104, "Elemental Master");
  328. + classList.put(105, "Evas Saint");
  329. + classList.put(106, "Shillien Templar");
  330. + classList.put(107, "Spectral Dancer");
  331. + classList.put(108, "Ghost Hunter");
  332. + classList.put(109, "Ghost Sentinel");
  333. + classList.put(110, "Storm Screamer");
  334. + classList.put(111, "Spectral Master");
  335. + classList.put(112, "Shillien Saint");
  336. + classList.put(113, "Titan");
  337. + classList.put(114, "Grand Khavatari");
  338. + classList.put(115, "Dominator");
  339. + classList.put(116, "Doomcryer");
  340. + classList.put(117, "Fortune Seeker");
  341. + classList.put(118, "Maestro");
  342. +
  343. + return classList.get(classId);
  344. + }
  345. +}
  346. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement