FloodProtectors.java 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under the terms of the
  3. * GNU General Public License as published by the Free Software Foundation, either version 3 of the
  4. * License, or (at your option) any later version.
  5. *
  6. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  7. * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8. * General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with this program. If
  11. * not, see <http://www.gnu.org/licenses/>.
  12. */
  13. package net.sf.l2j.gameserver.util;
  14. import net.sf.l2j.Config;
  15. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  16. /**
  17. * Collection of flood protectors for single player.
  18. *
  19. * @author fordfrog
  20. */
  21. public final class FloodProtectors
  22. {
  23. /**
  24. * Use-item flood protector.
  25. */
  26. private final FloodProtectorAction _useItem;
  27. /**
  28. * Roll-dice flood protector.
  29. */
  30. private final FloodProtectorAction _rollDice;
  31. /**
  32. * Firework flood protector.
  33. */
  34. private final FloodProtectorAction _firework;
  35. /**
  36. * Item-pet-summon flood protector.
  37. */
  38. private final FloodProtectorAction _itemPetSummon;
  39. /**
  40. * Hero-voice flood protector.
  41. */
  42. private final FloodProtectorAction _heroVoice;
  43. /**
  44. * Global-chat flood protector.
  45. */
  46. private final FloodProtectorAction _globalChat;
  47. /**
  48. * Subclass flood protector.
  49. */
  50. private final FloodProtectorAction _subclass;
  51. /**
  52. * Drop-item flood protector.
  53. */
  54. private final FloodProtectorAction _dropItem;
  55. /**
  56. * Server-bypass flood protector.
  57. */
  58. private final FloodProtectorAction _serverBypass;
  59. /**
  60. * Multisell flood protector.
  61. */
  62. private final FloodProtectorAction _multiSell;
  63. /**
  64. * Transaction flood protector.
  65. */
  66. private final FloodProtectorAction _transaction;
  67. /**
  68. * Creates new instance of FloodProtectors.
  69. *
  70. * @param player
  71. * player for which the collection of flood protectors is being created.
  72. */
  73. public FloodProtectors(final L2PcInstance player)
  74. {
  75. super();
  76. _useItem = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_USE_ITEM);
  77. _rollDice = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_ROLL_DICE);
  78. _firework = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_FIREWORK);
  79. _itemPetSummon = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_ITEM_PET_SUMMON);
  80. _heroVoice = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_HERO_VOICE);
  81. _globalChat = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_GLOBAL_CHAT);
  82. _subclass = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SUBCLASS);
  83. _dropItem = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_DROP_ITEM);
  84. _serverBypass = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SERVER_BYPASS);
  85. _multiSell = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_MULTISELL);
  86. _transaction = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_TRANSACTION);
  87. }
  88. /**
  89. * Returns {@link #_useItem}.
  90. *
  91. * @return {@link #_useItem}
  92. */
  93. public FloodProtectorAction getUseItem()
  94. {
  95. return _useItem;
  96. }
  97. /**
  98. * Returns {@link #_rollDice}.
  99. *
  100. * @return {@link #_rollDice}
  101. */
  102. public FloodProtectorAction getRollDice()
  103. {
  104. return _rollDice;
  105. }
  106. /**
  107. * Returns {@link #_firework}.
  108. *
  109. * @return {@link #_firework}
  110. */
  111. public FloodProtectorAction getFirework()
  112. {
  113. return _firework;
  114. }
  115. /**
  116. * Returns {@link #_itemPetSummon}.
  117. *
  118. * @return {@link #_itemPetSummon}
  119. */
  120. public FloodProtectorAction getItemPetSummon()
  121. {
  122. return _itemPetSummon;
  123. }
  124. /**
  125. * Returns {@link #_heroVoice}.
  126. *
  127. * @return {@link #_heroVoice}
  128. */
  129. public FloodProtectorAction getHeroVoice()
  130. {
  131. return _heroVoice;
  132. }
  133. /**
  134. * Returns {@link #_globalChat}.
  135. *
  136. * @return {@link #_globalChat}
  137. */
  138. public FloodProtectorAction getGlobalChat()
  139. {
  140. return _globalChat;
  141. }
  142. /**
  143. * Returns {@link #_subclass}.
  144. *
  145. * @return {@link #_subclass}
  146. */
  147. public FloodProtectorAction getSubclass()
  148. {
  149. return _subclass;
  150. }
  151. /**
  152. * Returns {@link #_dropItem}.
  153. *
  154. * @return {@link #_dropItem}
  155. */
  156. public FloodProtectorAction getDropItem()
  157. {
  158. return _dropItem;
  159. }
  160. /**
  161. * Returns {@link #_serverBypass}.
  162. *
  163. * @return {@link #_serverBypass}
  164. */
  165. public FloodProtectorAction getServerBypass()
  166. {
  167. return _serverBypass;
  168. }
  169. /**
  170. * Returns {@link #_multisell}.
  171. *
  172. * @return {@link #_multisell}
  173. */
  174. public FloodProtectorAction getMultiSell()
  175. {
  176. return _multiSell;
  177. }
  178. /**
  179. * Returns {@link #_transaction}.
  180. *
  181. * @return {@link #_transaction}
  182. */
  183. public FloodProtectorAction getTransaction()
  184. {
  185. return _transaction;
  186. }
  187. }