Advertisement
warc222

Say2

Sep 24th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.19 KB | None | 0 0
  1. Index: java/net/sf/l2j/gameserver/clientpackets/Say2.java
  2. ===================================================================
  3. --- java/net/sf/l2j/gameserver/clientpackets/Say2.java (revision 2)
  4. +++ java/net/sf/l2j/gameserver/clientpackets/Say2.java (revision 5)
  5. @@ -26,15 +26,7 @@
  6.  
  7. import net.sf.l2j.Config;
  8. -import net.sf.l2j.gameserver.datatables.MapRegionTable;
  9. -import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  10. -import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
  11. -import net.sf.l2j.gameserver.instancemanager.PetitionManager;
  12. -import net.sf.l2j.gameserver.model.BlockList;
  13. -import net.sf.l2j.gameserver.model.L2World;
  14. +import net.sf.l2j.gameserver.handler.ChatHandler;
  15. +import net.sf.l2j.gameserver.handler.IChatHandler;
  16. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  17. -import net.sf.l2j.gameserver.network.SystemMessageId;
  18. -import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  19. -import net.sf.l2j.gameserver.serverpackets.SystemMessage;
  20. -import net.sf.l2j.gameserver.util.FloodProtector;
  21.  
  22. /**
  23. @@ -156,172 +148,8 @@
  24. _logChat.log(record);
  25. }
  26. -
  27. - CreatureSay cs = new CreatureSay(activeChar.getObjectId(), _type, activeChar.getName(), _text);
  28. -
  29. - switch (_type)
  30. + IChatHandler handler = ChatHandler.getInstance().getChatHandler(_type);
  31. + if (handler != null)
  32. {
  33. - case TELL:
  34. - L2PcInstance receiver = L2World.getInstance().getPlayer(_target);
  35. -
  36. - if (receiver != null &&
  37. - !BlockList.isBlocked(receiver, activeChar))
  38. - {
  39. - if (Config.JAIL_DISABLE_CHAT && receiver.isInJail())
  40. - {
  41. - activeChar.sendMessage("Player is in jail.");
  42. - return;
  43. - }
  44. - if (receiver.isChatBanned())
  45. - {
  46. - activeChar.sendMessage("Player is chat banned.");
  47. - return;
  48. - }
  49. -
  50. - if (!receiver.getMessageRefusal())
  51. - {
  52. - receiver.sendPacket(cs);
  53. - activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), _type, "->" + receiver.getName(), _text));
  54. - }
  55. - else
  56. - {
  57. - activeChar.sendPacket(new SystemMessage(SystemMessageId.THE_PERSON_IS_IN_MESSAGE_REFUSAL_MODE));
  58. - }
  59. - }
  60. - else
  61. - {
  62. - SystemMessage sm = new SystemMessage(SystemMessageId.S1_IS_NOT_ONLINE);
  63. - sm.addString(_target);
  64. - activeChar.sendPacket(sm);
  65. - sm = null;
  66. - }
  67. - break;
  68. - case SHOUT:
  69. - if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") ||
  70. - (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.isGM()))
  71. - {
  72. - int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY());
  73. - for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  74. - {
  75. - if (region == MapRegionTable.getInstance().getMapRegion(player.getX(),player.getY()))
  76. - player.sendPacket(cs);
  77. - }
  78. - }
  79. - else if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("global"))
  80. - {
  81. - for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  82. - {
  83. - player.sendPacket(cs);
  84. - }
  85. - }
  86. - break;
  87. - case TRADE:
  88. - if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") ||
  89. - (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.isGM()))
  90. - {
  91. - for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  92. - {
  93. - player.sendPacket(cs);
  94. - }
  95. - } else if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("limited"))
  96. - {
  97. - int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY());
  98. - for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  99. - {
  100. - if (region == MapRegionTable.getInstance().getMapRegion(player.getX(),player.getY()))
  101. - player.sendPacket(cs);
  102. - }
  103. - }
  104. - break;
  105. - case ALL:
  106. - if (_text.startsWith("."))
  107. - {
  108. - StringTokenizer st = new StringTokenizer(_text);
  109. - IVoicedCommandHandler vch;
  110. - String command = "";
  111. - String target = "";
  112. -
  113. - if (st.countTokens() > 1)
  114. - {
  115. - command = st.nextToken().substring(1);
  116. - target = _text.substring(command.length() + 2);
  117. - vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command);
  118. - }
  119. - else
  120. - {
  121. - command = _text.substring(1);
  122. - if (Config.DEBUG) _log.info("Command: "+command);
  123. - vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command);
  124. - }
  125. - if (vch != null)
  126. - vch.useVoicedCommand(command, activeChar, target);
  127. - else
  128. - {
  129. - if (Config.DEBUG) _log.warning("No handler registered for bypass '"+command+"'");
  130. - }
  131. - }
  132. - else
  133. - {
  134. - for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
  135. - {
  136. - if (player != null && activeChar.isInsideRadius(player, 1250, false, true))
  137. - player.sendPacket(cs);
  138. - }
  139. - activeChar.sendPacket(cs);
  140. - }
  141. - break;
  142. - case CLAN:
  143. - if (activeChar.getClan() != null)
  144. - activeChar.getClan().broadcastToOnlineMembers(cs);
  145. - break;
  146. - case ALLIANCE:
  147. - if (activeChar.getClan() != null)
  148. - activeChar.getClan().broadcastToOnlineAllyMembers(cs);
  149. - break;
  150. - case PARTY:
  151. - if (activeChar.isInParty())
  152. - activeChar.getParty().broadcastToPartyMembers(cs);
  153. - break;
  154. - case PETITION_PLAYER:
  155. - case PETITION_GM:
  156. - if (!PetitionManager.getInstance().isPlayerInConsultation(activeChar))
  157. - {
  158. - activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_ARE_NOT_IN_PETITION_CHAT));
  159. - break;
  160. - }
  161. -
  162. - PetitionManager.getInstance().sendActivePetitionMessage(activeChar, _text);
  163. - break;
  164. - case PARTYROOM_ALL:
  165. - if (activeChar.isInParty())
  166. - {
  167. - if (activeChar.getParty().isInCommandChannel() && activeChar.getParty().isLeader(activeChar))
  168. - {
  169. - activeChar.getParty().getCommandChannel().broadcastToChannelMembers(cs);
  170. - }
  171. - }
  172. - break;
  173. - case PARTYROOM_COMMANDER:
  174. - if (activeChar.isInParty())
  175. - {
  176. - if (activeChar.getParty().isInCommandChannel() &&
  177. - activeChar.getParty().getCommandChannel().getChannelLeader().equals(activeChar))
  178. - {
  179. - activeChar.getParty().getCommandChannel().broadcastToChannelMembers(cs);
  180. - }
  181. - }
  182. - break;
  183. - case HERO_VOICE:
  184. - if (activeChar.isHero())
  185. - {
  186. - if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_HEROVOICE))
  187. - {
  188. - activeChar.sendMessage("Action failed. Heroes are only able to speak in the global channel once every 10 seconds.");
  189. - return;
  190. - }
  191. - for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  192. - if (!BlockList.isBlocked(player, activeChar))
  193. - player.sendPacket(cs);
  194. - }
  195. - break;
  196. + handler.handleChat(_type, activeChar, _target, _text);
  197. }
  198. }
  199. Index: java/net/sf/l2j/gameserver/handler/ChatHandler.java
  200. ===================================================================
  201. --- java/net/sf/l2j/gameserver/handler/ChatHandler.java (revision 5)
  202. +++ java/net/sf/l2j/gameserver/handler/ChatHandler.java (revision 5)
  203. @@ -0,0 +1,84 @@
  204. +/*
  205. + * This program is free software: you can redistribute it and/or modify it under
  206. + * the terms of the GNU General Public License as published by the Free Software
  207. + * Foundation, either version 3 of the License, or (at your option) any later
  208. + * version.
  209. + *
  210. + * This program is distributed in the hope that it will be useful, but WITHOUT
  211. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  212. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  213. + * details.
  214. + *
  215. + * You should have received a copy of the GNU General Public License along with
  216. + * this program. If not, see <http://www.gnu.org/licenses/>.
  217. + */
  218. +package net.sf.l2j.gameserver.handler;
  219. +
  220. +import java.util.logging.Logger;
  221. +
  222. +import javolution.util.FastMap;
  223. +import net.sf.l2j.Config;
  224. +
  225. + /**
  226. + * This class handles all chat handlers
  227. + *
  228. + * @author durgus
  229. + */
  230. +public class ChatHandler
  231. +{
  232. + private static Logger _log = Logger.getLogger(ChatHandler.class.getName());
  233. +
  234. + private static ChatHandler _instance;
  235. +
  236. + private FastMap<Integer, IChatHandler> _datatable;
  237. +
  238. + public static ChatHandler getInstance()
  239. + {
  240. + if (_instance == null)
  241. + {
  242. + _instance = new ChatHandler();
  243. + }
  244. + return _instance;
  245. + }
  246. +
  247. + /**
  248. + * Singleton constructor
  249. + */
  250. + private ChatHandler()
  251. + {
  252. + _datatable = new FastMap<Integer, IChatHandler>();
  253. + }
  254. +
  255. + /**
  256. + * Register a new chat handler
  257. + * @param handler
  258. + */
  259. + public void registerChatHandler(IChatHandler handler)
  260. + {
  261. + int[] ids = handler.getChatTypeList();
  262. + for (int i = 0; i < ids.length; i++)
  263. + {
  264. + if (Config.DEBUG) _log.fine("Adding handler for chat type "+ids[i]);
  265. + _datatable.put(ids[i], handler);
  266. + }
  267. + }
  268. +
  269. + /**
  270. + * Get the chat handler for the given chat type
  271. + * @param chatType
  272. + * @return
  273. + */
  274. + public IChatHandler getChatHandler(int chatType)
  275. + {
  276. + return _datatable.get(chatType);
  277. + }
  278. +
  279. + /**
  280. + * Returns the size
  281. + * @return
  282. + */
  283. + public int size()
  284. + {
  285. + return _datatable.size();
  286. + }
  287. +}
  288. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatParty.java
  289. ===================================================================
  290. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatParty.java (revision 5)
  291. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatParty.java (revision 5)
  292. @@ -0,0 +1,52 @@
  293. +/*
  294. + * This program is free software: you can redistribute it and/or modify it under
  295. + * the terms of the GNU General Public License as published by the Free Software
  296. + * Foundation, either version 3 of the License, or (at your option) any later
  297. + * version.
  298. + *
  299. + * This program is distributed in the hope that it will be useful, but WITHOUT
  300. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  301. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  302. + * details.
  303. + *
  304. + * You should have received a copy of the GNU General Public License along with
  305. + * this program. If not, see <http://www.gnu.org/licenses/>.
  306. + */
  307. +package net.sf.l2j.gameserver.handler.chathandlers;
  308. +
  309. +import net.sf.l2j.gameserver.handler.IChatHandler;
  310. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  311. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  312. +
  313. +/**
  314. + * A chat handler
  315. + *
  316. + * @author durgus
  317. + */
  318. +public class ChatParty implements IChatHandler
  319. +{
  320. + private static final int[] COMMAND_IDS = { 3 };
  321. +
  322. + /**
  323. + * Handle chat type 'party'
  324. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  325. + */
  326. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  327. + {
  328. + if (activeChar.isInParty())
  329. + {
  330. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  331. +
  332. + activeChar.getParty().broadcastToPartyMembers(cs);
  333. + }
  334. + }
  335. +
  336. + /**
  337. + * Returns the chat types registered to this handler
  338. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  339. + */
  340. + public int[] getChatTypeList()
  341. + {
  342. + return COMMAND_IDS;
  343. + }
  344. +}
  345. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java
  346. ===================================================================
  347. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java (revision 5)
  348. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatTrade.java (revision 5)
  349. @@ -0,0 +1,69 @@
  350. +/*
  351. + * This program is free software: you can redistribute it and/or modify it under
  352. + * the terms of the GNU General Public License as published by the Free Software
  353. + * Foundation, either version 3 of the License, or (at your option) any later
  354. + * version.
  355. + *
  356. + * This program is distributed in the hope that it will be useful, but WITHOUT
  357. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  358. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  359. + * details.
  360. + *
  361. + * You should have received a copy of the GNU General Public License along with
  362. + * this program. If not, see <http://www.gnu.org/licenses/>.
  363. + */
  364. +package net.sf.l2j.gameserver.handler.chathandlers;
  365. +
  366. +import net.sf.l2j.Config;
  367. +import net.sf.l2j.gameserver.datatables.MapRegionTable;
  368. +import net.sf.l2j.gameserver.handler.IChatHandler;
  369. +import net.sf.l2j.gameserver.model.L2World;
  370. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  371. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  372. +
  373. +/**
  374. + * A chat handler
  375. + *
  376. + * @author durgus
  377. + */
  378. +public class ChatTrade implements IChatHandler
  379. +{
  380. + private static final int[] COMMAND_IDS = { 8 };
  381. +
  382. + /**
  383. + * Handle chat type 'trade'
  384. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  385. + */
  386. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  387. + {
  388. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  389. +
  390. + if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.isGM()))
  391. + {
  392. + for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  393. + {
  394. + player.sendPacket(cs);
  395. + }
  396. + }
  397. + else if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("limited"))
  398. + {
  399. + int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY());
  400. + for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  401. + {
  402. + if (region == MapRegionTable.getInstance().getMapRegion(player.getX(),player.getY()))
  403. + {
  404. + player.sendPacket(cs);
  405. + }
  406. + }
  407. + }
  408. + }
  409. +
  410. + /**
  411. + * Returns the chat types registered to this handler
  412. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  413. + */
  414. + public int[] getChatTypeList()
  415. + {
  416. + return COMMAND_IDS;
  417. + }
  418. +}
  419. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatTell.java
  420. ===================================================================
  421. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatTell.java (revision 5)
  422. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatTell.java (revision 5)
  423. @@ -0,0 +1,91 @@
  424. +/*
  425. + * This program is free software: you can redistribute it and/or modify it under
  426. + * the terms of the GNU General Public License as published by the Free Software
  427. + * Foundation, either version 3 of the License, or (at your option) any later
  428. + * version.
  429. + *
  430. + * This program is distributed in the hope that it will be useful, but WITHOUT
  431. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  432. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  433. + * details.
  434. + *
  435. + * You should have received a copy of the GNU General Public License along with
  436. + * this program. If not, see <http://www.gnu.org/licenses/>.
  437. + */
  438. +package net.sf.l2j.gameserver.handler.chathandlers;
  439. +
  440. +import net.sf.l2j.Config;
  441. +import net.sf.l2j.gameserver.handler.IChatHandler;
  442. +import net.sf.l2j.gameserver.model.BlockList;
  443. +import net.sf.l2j.gameserver.model.L2World;
  444. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  445. +import net.sf.l2j.gameserver.network.SystemMessageId;
  446. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  447. +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
  448. +
  449. +/**
  450. + * A chat handler
  451. + *
  452. + * @author durgus
  453. + */
  454. +public class ChatTell implements IChatHandler
  455. +{
  456. + private static final int[] COMMAND_IDS = { 2 };
  457. +
  458. + /**
  459. + * Handle chat type 'tell'
  460. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  461. + */
  462. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  463. + {
  464. + // Return if no target is set
  465. + if (target == null) return;
  466. +
  467. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  468. + L2PcInstance receiver = null;
  469. +
  470. + receiver = L2World.getInstance().getPlayer(target);
  471. +
  472. + if (receiver != null && !BlockList.isBlocked(receiver, activeChar))
  473. + {
  474. + if (Config.JAIL_DISABLE_CHAT && receiver.isInJail())
  475. + {
  476. + activeChar.sendMessage("Player is in jail.");
  477. + return;
  478. + }
  479. +
  480. +
  481. + if (receiver.isChatBanned())
  482. + {
  483. + activeChar.sendMessage("Player is chat banned.");
  484. + return;
  485. + }
  486. +
  487. + if (!receiver.getMessageRefusal())
  488. + {
  489. + receiver.sendPacket(cs);
  490. + activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), type, "->" + receiver.getName(), text));
  491. + }
  492. + else
  493. + {
  494. + activeChar.sendPacket(new SystemMessage(SystemMessageId.THE_PERSON_IS_IN_MESSAGE_REFUSAL_MODE));
  495. + }
  496. + }
  497. + else
  498. + {
  499. + SystemMessage sm = new SystemMessage(SystemMessageId.S1_IS_NOT_ONLINE);
  500. + sm.addString(target);
  501. + activeChar.sendPacket(sm);
  502. + sm = null;
  503. + }
  504. + }
  505. +
  506. + /**
  507. + * Returns the chat types registered to this handler
  508. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  509. + */
  510. + public int[] getChatTypeList()
  511. + {
  512. + return COMMAND_IDS;
  513. + }
  514. +}
  515. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatPartyRoomCommander.java
  516. ===================================================================
  517. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatPartyRoomCommander.java (revision 5)
  518. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatPartyRoomCommander.java (revision 5)
  519. @@ -0,0 +1,54 @@
  520. +/*
  521. + * This program is free software: you can redistribute it and/or modify it under
  522. + * the terms of the GNU General Public License as published by the Free Software
  523. + * Foundation, either version 3 of the License, or (at your option) any later
  524. + * version.
  525. + *
  526. + * This program is distributed in the hope that it will be useful, but WITHOUT
  527. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  528. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  529. + * details.
  530. + *
  531. + * You should have received a copy of the GNU General Public License along with
  532. + * this program. If not, see <http://www.gnu.org/licenses/>.
  533. + */
  534. +package net.sf.l2j.gameserver.handler.chathandlers;
  535. +
  536. +import net.sf.l2j.gameserver.handler.IChatHandler;
  537. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  538. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  539. +
  540. +/**
  541. + * A chat handler
  542. + *
  543. + * @author durgus
  544. + */
  545. +public class ChatPartyRoomCommander implements IChatHandler
  546. +{
  547. + private static final int[] COMMAND_IDS = { 15 };
  548. +
  549. + /**
  550. + * Handle chat type 'party room commander'
  551. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  552. + */
  553. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  554. + {
  555. + if (activeChar.isInParty())
  556. + {
  557. + if (activeChar.getParty().isInCommandChannel() && activeChar.getParty().getCommandChannel().getChannelLeader().equals(activeChar))
  558. + {
  559. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  560. + activeChar.getParty().getCommandChannel().broadcastToChannelMembers(cs);
  561. + }
  562. + }
  563. + }
  564. +
  565. + /**
  566. + * Returns the chat types registered to this handler
  567. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  568. + */
  569. + public int[] getChatTypeList()
  570. + {
  571. + return COMMAND_IDS;
  572. + }
  573. +}
  574. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java
  575. ===================================================================
  576. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java (revision 5)
  577. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatShout.java (revision 5)
  578. @@ -0,0 +1,69 @@
  579. +/*
  580. + * This program is free software: you can redistribute it and/or modify it under
  581. + * the terms of the GNU General Public License as published by the Free Software
  582. + * Foundation, either version 3 of the License, or (at your option) any later
  583. + * version.
  584. + *
  585. + * This program is distributed in the hope that it will be useful, but WITHOUT
  586. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  587. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  588. + * details.
  589. + *
  590. + * You should have received a copy of the GNU General Public License along with
  591. + * this program. If not, see <http://www.gnu.org/licenses/>.
  592. + */
  593. +package net.sf.l2j.gameserver.handler.chathandlers;
  594. +
  595. +import net.sf.l2j.Config;
  596. +import net.sf.l2j.gameserver.datatables.MapRegionTable;
  597. +import net.sf.l2j.gameserver.handler.IChatHandler;
  598. +import net.sf.l2j.gameserver.model.L2World;
  599. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  600. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  601. +
  602. +/**
  603. + * A chat handler
  604. + *
  605. + * @author durgus
  606. + */
  607. +public class ChatShout implements IChatHandler
  608. +{
  609. + private static final int[] COMMAND_IDS = { 1 };
  610. +
  611. + /**
  612. + * Handle chat type 'shout'
  613. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  614. + */
  615. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  616. + {
  617. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  618. +
  619. + if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.isGM()))
  620. + {
  621. + int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY());
  622. + for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  623. + {
  624. + if (region == MapRegionTable.getInstance().getMapRegion(player.getX(),player.getY()))
  625. + {
  626. + player.sendPacket(cs);
  627. + }
  628. + }
  629. + }
  630. + else if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("global"))
  631. + {
  632. + for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  633. + {
  634. + player.sendPacket(cs);
  635. + }
  636. + }
  637. + }
  638. +
  639. + /**
  640. + * Returns the chat types registered to this handler
  641. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  642. + */
  643. + public int[] getChatTypeList()
  644. + {
  645. + return COMMAND_IDS;
  646. + }
  647. +}
  648. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatHeroVoice.java
  649. ===================================================================
  650. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatHeroVoice.java (revision 5)
  651. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatHeroVoice.java (revision 5)
  652. @@ -0,0 +1,67 @@
  653. +/*
  654. + * This program is free software: you can redistribute it and/or modify it under
  655. + * the terms of the GNU General Public License as published by the Free Software
  656. + * Foundation, either version 3 of the License, or (at your option) any later
  657. + * version.
  658. + *
  659. + * This program is distributed in the hope that it will be useful, but WITHOUT
  660. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  661. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  662. + * details.
  663. + *
  664. + * You should have received a copy of the GNU General Public License along with
  665. + * this program. If not, see <http://www.gnu.org/licenses/>.
  666. + */
  667. +package net.sf.l2j.gameserver.handler.chathandlers;
  668. +
  669. +import net.sf.l2j.gameserver.handler.IChatHandler;
  670. +import net.sf.l2j.gameserver.model.BlockList;
  671. +import net.sf.l2j.gameserver.model.L2World;
  672. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  673. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  674. +import net.sf.l2j.gameserver.util.FloodProtector;
  675. +
  676. +/**
  677. + * A chat handler
  678. + *
  679. + * @author durgus
  680. + */
  681. +public class ChatHeroVoice implements IChatHandler
  682. +{
  683. + private static final int[] COMMAND_IDS = { 17 };
  684. +
  685. + /**
  686. + * Handle chat type 'hero voice'
  687. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  688. + */
  689. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  690. + {
  691. + if (activeChar.isHero() || activeChar.isGM())
  692. + {
  693. + if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_HEROVOICE))
  694. + {
  695. + activeChar.sendMessage("Action failed. Heroes are only able to speak in the global channel once every 10 seconds.");
  696. + return;
  697. + }
  698. +
  699. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  700. +
  701. + for (L2PcInstance player : L2World.getInstance().getAllPlayers())
  702. + {
  703. + if (!BlockList.isBlocked(player, activeChar))
  704. + {
  705. + player.sendPacket(cs);
  706. + }
  707. + }
  708. + }
  709. + }
  710. +
  711. + /**
  712. + * Returns the chat types registered to this handler
  713. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  714. + */
  715. + public int[] getChatTypeList()
  716. + {
  717. + return COMMAND_IDS;
  718. + }
  719. +}
  720. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatPartyRoomAll.java
  721. ===================================================================
  722. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatPartyRoomAll.java (revision 5)
  723. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatPartyRoomAll.java (revision 5)
  724. @@ -0,0 +1,54 @@
  725. +/*
  726. + * This program is free software: you can redistribute it and/or modify it under
  727. + * the terms of the GNU General Public License as published by the Free Software
  728. + * Foundation, either version 3 of the License, or (at your option) any later
  729. + * version.
  730. + *
  731. + * This program is distributed in the hope that it will be useful, but WITHOUT
  732. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  733. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  734. + * details.
  735. + *
  736. + * You should have received a copy of the GNU General Public License along with
  737. + * this program. If not, see <http://www.gnu.org/licenses/>.
  738. + */
  739. +package net.sf.l2j.gameserver.handler.chathandlers;
  740. +
  741. +import net.sf.l2j.gameserver.handler.IChatHandler;
  742. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  743. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  744. +
  745. +/**
  746. + * A chat handler
  747. + *
  748. + * @author durgus
  749. + */
  750. +public class ChatPartyRoomAll implements IChatHandler
  751. +{
  752. + private static final int[] COMMAND_IDS = { 16 };
  753. +
  754. + /**
  755. + * Handle chat type 'party room all'
  756. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  757. + */
  758. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  759. + {
  760. + if (activeChar.isInParty())
  761. + {
  762. + if (activeChar.getParty().isInCommandChannel() && activeChar.getParty().isLeader(activeChar))
  763. + {
  764. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  765. + activeChar.getParty().getCommandChannel().broadcastToChannelMembers(cs);
  766. + }
  767. + }
  768. + }
  769. +
  770. + /**
  771. + * Returns the chat types registered to this handler
  772. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  773. + */
  774. + public int[] getChatTypeList()
  775. + {
  776. + return COMMAND_IDS;
  777. + }
  778. +}
  779. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java
  780. ===================================================================
  781. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java (revision 5)
  782. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatAll.java (revision 5)
  783. @@ -0,0 +1,94 @@
  784. +/*
  785. + * This program is free software: you can redistribute it and/or modify it under
  786. + * the terms of the GNU General Public License as published by the Free Software
  787. + * Foundation, either version 3 of the License, or (at your option) any later
  788. + * version.
  789. + *
  790. + * This program is distributed in the hope that it will be useful, but WITHOUT
  791. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  792. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  793. + * details.
  794. + *
  795. + * You should have received a copy of the GNU General Public License along with
  796. + * this program. If not, see <http://www.gnu.org/licenses/>.
  797. + */
  798. +package net.sf.l2j.gameserver.handler.chathandlers;
  799. +
  800. +import java.util.StringTokenizer;
  801. +import java.util.logging.Logger;
  802. +
  803. +import net.sf.l2j.Config;
  804. +import net.sf.l2j.gameserver.handler.IChatHandler;
  805. +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  806. +import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
  807. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  808. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  809. +
  810. +/**
  811. + * A chat handler
  812. + *
  813. + * @author durgus
  814. + */
  815. +public class ChatAll implements IChatHandler
  816. +{
  817. + private static final int[] COMMAND_IDS = { 0 };
  818. + private static Logger _log = Logger.getLogger(ChatAll.class.getName());
  819. +
  820. + /**
  821. + * Handle chat type 'all'
  822. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  823. + */
  824. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  825. + {
  826. + if (text.startsWith("."))
  827. + {
  828. + StringTokenizer st = new StringTokenizer(text);
  829. + IVoicedCommandHandler vch;
  830. + String command = "";
  831. +
  832. + if (st.countTokens() > 1)
  833. + {
  834. + command = st.nextToken().substring(1);
  835. + target = text.substring(command.length() + 2);
  836. + vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command);
  837. + }
  838. + else
  839. + {
  840. + command = text.substring(1);
  841. + if (Config.DEBUG) _log.info("Command: "+command);
  842. + vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command);
  843. + }
  844. + if (vch != null)
  845. + {
  846. + vch.useVoicedCommand(command, activeChar, target);
  847. + }
  848. + else
  849. + {
  850. + if (Config.DEBUG) _log.warning("No handler registered for bypass '"+command+"'");
  851. + }
  852. + }
  853. + else
  854. + {
  855. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  856. +
  857. + for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
  858. + {
  859. + if (player != null && activeChar.isInsideRadius(player, 1250, false, true))
  860. + {
  861. + player.sendPacket(cs);
  862. + }
  863. + }
  864. +
  865. + activeChar.sendPacket(cs);
  866. + }
  867. + }
  868. +
  869. + /**
  870. + * Returns the chat types registered to this handler
  871. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  872. + */
  873. + public int[] getChatTypeList()
  874. + {
  875. + return COMMAND_IDS;
  876. + }
  877. +}
  878. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatAlliance.java
  879. ===================================================================
  880. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatAlliance.java (revision 5)
  881. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatAlliance.java (revision 5)
  882. @@ -0,0 +1,46 @@
  883. +/*
  884. + * This program is free software: you can redistribute it and/or modify it under
  885. + * the terms of the GNU General Public License as published by the Free Software
  886. + * Foundation, either version 3 of the License, or (at your option) any later
  887. + * version.
  888. + *
  889. + * This program is distributed in the hope that it will be useful, but WITHOUT
  890. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  891. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  892. + * details.
  893. + *
  894. + * You should have received a copy of the GNU General Public License along with
  895. + * this program. If not, see <http://www.gnu.org/licenses/>.
  896. + */
  897. +package net.sf.l2j.gameserver.handler.chathandlers;
  898. +
  899. +import net.sf.l2j.gameserver.handler.IChatHandler;
  900. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  901. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  902. +
  903. +public class ChatAlliance implements IChatHandler
  904. +{
  905. + private static final int[] COMMAND_IDS = { 9 };
  906. +
  907. + /**
  908. + * Handle chat type 'alliance'
  909. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  910. + */
  911. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  912. + {
  913. + if (activeChar.getClan() != null)
  914. + {
  915. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  916. + activeChar.getClan().broadcastToOnlineAllyMembers(cs);
  917. + }
  918. + }
  919. +
  920. + /**
  921. + * Returns the chat types registered to this handler
  922. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  923. + */
  924. + public int[] getChatTypeList()
  925. + {
  926. + return COMMAND_IDS;
  927. + }
  928. +}
  929. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatPetition.java
  930. ===================================================================
  931. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatPetition.java (revision 5)
  932. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatPetition.java (revision 5)
  933. @@ -0,0 +1,55 @@
  934. +/*
  935. + * This program is free software: you can redistribute it and/or modify it under
  936. + * the terms of the GNU General Public License as published by the Free Software
  937. + * Foundation, either version 3 of the License, or (at your option) any later
  938. + * version.
  939. + *
  940. + * This program is distributed in the hope that it will be useful, but WITHOUT
  941. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  942. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  943. + * details.
  944. + *
  945. + * You should have received a copy of the GNU General Public License along with
  946. + * this program. If not, see <http://www.gnu.org/licenses/>.
  947. + */
  948. +package net.sf.l2j.gameserver.handler.chathandlers;
  949. +
  950. +import net.sf.l2j.gameserver.handler.IChatHandler;
  951. +import net.sf.l2j.gameserver.instancemanager.PetitionManager;
  952. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  953. +import net.sf.l2j.gameserver.network.SystemMessageId;
  954. +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
  955. +
  956. +/**
  957. + * A chat handler
  958. + *
  959. + * @author durgus
  960. + */
  961. +public class ChatPetition implements IChatHandler
  962. +{
  963. + private static final int[] COMMAND_IDS = { 6, 7 };
  964. +
  965. + /**
  966. + * Handle chat type 'petition player'
  967. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  968. + */
  969. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  970. + {
  971. + if (!PetitionManager.getInstance().isPlayerInConsultation(activeChar))
  972. + {
  973. + activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_ARE_NOT_IN_PETITION_CHAT));
  974. + return;
  975. + }
  976. +
  977. + PetitionManager.getInstance().sendActivePetitionMessage(activeChar, text);
  978. + }
  979. +
  980. + /**
  981. + * Returns the chat types registered to this handler
  982. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  983. + */
  984. + public int[] getChatTypeList()
  985. + {
  986. + return COMMAND_IDS;
  987. + }
  988. +}
  989. Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatClan.java
  990. ===================================================================
  991. --- java/net/sf/l2j/gameserver/handler/chathandlers/ChatClan.java (revision 5)
  992. +++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatClan.java (revision 5)
  993. @@ -0,0 +1,51 @@
  994. +/*
  995. + * This program is free software: you can redistribute it and/or modify it under
  996. + * the terms of the GNU General Public License as published by the Free Software
  997. + * Foundation, either version 3 of the License, or (at your option) any later
  998. + * version.
  999. + *
  1000. + * This program is distributed in the hope that it will be useful, but WITHOUT
  1001. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1002. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1003. + * details.
  1004. + *
  1005. + * You should have received a copy of the GNU General Public License along with
  1006. + * this program. If not, see <http://www.gnu.org/licenses/>.
  1007. + */
  1008. +package net.sf.l2j.gameserver.handler.chathandlers;
  1009. +
  1010. +import net.sf.l2j.gameserver.handler.IChatHandler;
  1011. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1012. +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
  1013. +
  1014. +/**
  1015. + * A chat handler
  1016. + *
  1017. + * @author durgus
  1018. + */
  1019. +public class ChatClan implements IChatHandler
  1020. +{
  1021. + private static final int[] COMMAND_IDS = { 4 };
  1022. +
  1023. + /**
  1024. + * Handle chat type 'clan'
  1025. + * @see net.sf.l2j.gameserver.handler.IChatHandler#handleChat(int, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  1026. + */
  1027. + public void handleChat(int type, L2PcInstance activeChar, String target, String text)
  1028. + {
  1029. + if (activeChar.getClan() != null)
  1030. + {
  1031. + CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
  1032. + activeChar.getClan().broadcastToOnlineMembers(cs);
  1033. + }
  1034. + }
  1035. +
  1036. + /**
  1037. + * Returns the chat types registered to this handler
  1038. + * @see net.sf.l2j.gameserver.handler.IChatHandler#getChatTypeList()
  1039. + */
  1040. + public int[] getChatTypeList()
  1041. + {
  1042. + return COMMAND_IDS;
  1043. + }
  1044. +}
  1045. Index: java/net/sf/l2j/gameserver/handler/IChatHandler.java
  1046. ===================================================================
  1047. --- java/net/sf/l2j/gameserver/handler/IChatHandler.java (revision 5)
  1048. +++ java/net/sf/l2j/gameserver/handler/IChatHandler.java (revision 5)
  1049. @@ -0,0 +1,39 @@
  1050. +/*
  1051. + * This program is free software: you can redistribute it and/or modify it under
  1052. + * the terms of the GNU General Public License as published by the Free Software
  1053. + * Foundation, either version 3 of the License, or (at your option) any later
  1054. + * version.
  1055. + *
  1056. + * This program is distributed in the hope that it will be useful, but WITHOUT
  1057. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1058. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1059. + * details.
  1060. + *
  1061. + * You should have received a copy of the GNU General Public License along with
  1062. + * this program. If not, see <http://www.gnu.org/licenses/>.
  1063. + */
  1064. +package net.sf.l2j.gameserver.handler;
  1065. +
  1066. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  1067. +
  1068. +/**
  1069. + * Interface for chat handlers
  1070. + *
  1071. + * @author durgus
  1072. + */
  1073. +public interface IChatHandler
  1074. +{
  1075. + /**
  1076. + * Handles a specific type of chat messages
  1077. + * @param type
  1078. + * @param activeChar
  1079. + * @param target
  1080. + */
  1081. + public void handleChat(int type, L2PcInstance activeChar, String target, String text);
  1082. +
  1083. + /**
  1084. + * Returns a list of all chat types registered to this handler
  1085. + * @return
  1086. + */
  1087. + public int[] getChatTypeList();
  1088. +}
  1089. Index: java/net/sf/l2j/gameserver/GameServer.java
  1090. ===================================================================
  1091. --- java/net/sf/l2j/gameserver/GameServer.java (revision 2)
  1092. +++ java/net/sf/l2j/gameserver/GameServer.java (revision 5)
  1093. @@ -63,4 +63,5 @@
  1094. import net.sf.l2j.gameserver.geoeditorcon.GeoEditorListener;
  1095. import net.sf.l2j.gameserver.handler.AdminCommandHandler;
  1096. +import net.sf.l2j.gameserver.handler.ChatHandler;
  1097. import net.sf.l2j.gameserver.handler.ItemHandler;
  1098. import net.sf.l2j.gameserver.handler.SkillHandler;
  1099. @@ -121,4 +122,15 @@
  1100. import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminUnblockIp;
  1101. import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminZone;
  1102. +import net.sf.l2j.gameserver.handler.chathandlers.ChatAll;
  1103. +import net.sf.l2j.gameserver.handler.chathandlers.ChatAlliance;
  1104. +import net.sf.l2j.gameserver.handler.chathandlers.ChatClan;
  1105. +import net.sf.l2j.gameserver.handler.chathandlers.ChatHeroVoice;
  1106. +import net.sf.l2j.gameserver.handler.chathandlers.ChatParty;
  1107. +import net.sf.l2j.gameserver.handler.chathandlers.ChatPartyRoomAll;
  1108. +import net.sf.l2j.gameserver.handler.chathandlers.ChatPartyRoomCommander;
  1109. +import net.sf.l2j.gameserver.handler.chathandlers.ChatPetition;
  1110. +import net.sf.l2j.gameserver.handler.chathandlers.ChatShout;
  1111. +import net.sf.l2j.gameserver.handler.chathandlers.ChatTell;
  1112. +import net.sf.l2j.gameserver.handler.chathandlers.ChatTrade;
  1113. import net.sf.l2j.gameserver.handler.itemhandlers.BeastSoulShot;
  1114. import net.sf.l2j.gameserver.handler.itemhandlers.BeastSpice;
  1115. @@ -256,4 +268,5 @@
  1116. private final UserCommandHandler _userCommandHandler;
  1117. private final VoicedCommandHandler _voicedCommandHandler;
  1118. + private final ChatHandler _chatHandler;
  1119. private final DoorTable _doorTable;
  1120. private final SevenSigns _sevenSignsEngine;
  1121. @@ -587,4 +600,19 @@
  1122.  
  1123. _log.config("UserCommandHandler: Loaded " + _userCommandHandler.size() + " handlers.");
  1124. +
  1125. + _chatHandler = ChatHandler.getInstance();
  1126. + _chatHandler.registerChatHandler(new ChatAll());
  1127. + _chatHandler.registerChatHandler(new ChatAlliance());
  1128. + _chatHandler.registerChatHandler(new ChatClan());
  1129. + _chatHandler.registerChatHandler(new ChatHeroVoice());
  1130. + _chatHandler.registerChatHandler(new ChatParty());
  1131. + _chatHandler.registerChatHandler(new ChatPartyRoomAll());
  1132. + _chatHandler.registerChatHandler(new ChatPartyRoomCommander());
  1133. + _chatHandler.registerChatHandler(new ChatPetition());
  1134. + _chatHandler.registerChatHandler(new ChatShout());
  1135. + _chatHandler.registerChatHandler(new ChatTell());
  1136. + _chatHandler.registerChatHandler(new ChatTrade());
  1137. +
  1138. + _log.config("ChatHandler: Loaded " + _chatHandler.size() + " handlers.");
  1139.  
  1140. _voicedCommandHandler = VoicedCommandHandler.getInstance();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement