2
0

FloodProtectors.java 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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 com.l2jserver.gameserver.util;
  14. import com.l2jserver.Config;
  15. import com.l2jserver.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. * Send mail flood protector.
  69. */
  70. private final FloodProtectorAction _sendMail;
  71. /**
  72. * Creates new instance of FloodProtectors.
  73. *
  74. * @param player
  75. * player for which the collection of flood protectors is being created.
  76. */
  77. public FloodProtectors(final L2PcInstance player)
  78. {
  79. super();
  80. _useItem = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_USE_ITEM);
  81. _rollDice = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_ROLL_DICE);
  82. _firework = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_FIREWORK);
  83. _itemPetSummon = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_ITEM_PET_SUMMON);
  84. _heroVoice = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_HERO_VOICE);
  85. _globalChat = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_GLOBAL_CHAT);
  86. _subclass = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SUBCLASS);
  87. _dropItem = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_DROP_ITEM);
  88. _serverBypass = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SERVER_BYPASS);
  89. _multiSell = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_MULTISELL);
  90. _transaction = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_TRANSACTION);
  91. _sendMail = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SENDMAIL);
  92. }
  93. /**
  94. * Returns {@link #_useItem}.
  95. *
  96. * @return {@link #_useItem}
  97. */
  98. public FloodProtectorAction getUseItem()
  99. {
  100. return _useItem;
  101. }
  102. /**
  103. * Returns {@link #_rollDice}.
  104. *
  105. * @return {@link #_rollDice}
  106. */
  107. public FloodProtectorAction getRollDice()
  108. {
  109. return _rollDice;
  110. }
  111. /**
  112. * Returns {@link #_firework}.
  113. *
  114. * @return {@link #_firework}
  115. */
  116. public FloodProtectorAction getFirework()
  117. {
  118. return _firework;
  119. }
  120. /**
  121. * Returns {@link #_itemPetSummon}.
  122. *
  123. * @return {@link #_itemPetSummon}
  124. */
  125. public FloodProtectorAction getItemPetSummon()
  126. {
  127. return _itemPetSummon;
  128. }
  129. /**
  130. * Returns {@link #_heroVoice}.
  131. *
  132. * @return {@link #_heroVoice}
  133. */
  134. public FloodProtectorAction getHeroVoice()
  135. {
  136. return _heroVoice;
  137. }
  138. /**
  139. * Returns {@link #_globalChat}.
  140. *
  141. * @return {@link #_globalChat}
  142. */
  143. public FloodProtectorAction getGlobalChat()
  144. {
  145. return _globalChat;
  146. }
  147. /**
  148. * Returns {@link #_subclass}.
  149. *
  150. * @return {@link #_subclass}
  151. */
  152. public FloodProtectorAction getSubclass()
  153. {
  154. return _subclass;
  155. }
  156. /**
  157. * Returns {@link #_dropItem}.
  158. *
  159. * @return {@link #_dropItem}
  160. */
  161. public FloodProtectorAction getDropItem()
  162. {
  163. return _dropItem;
  164. }
  165. /**
  166. * Returns {@link #_serverBypass}.
  167. *
  168. * @return {@link #_serverBypass}
  169. */
  170. public FloodProtectorAction getServerBypass()
  171. {
  172. return _serverBypass;
  173. }
  174. /**
  175. * Returns {@link #_multisell}.
  176. *
  177. * @return {@link #_multisell}
  178. */
  179. public FloodProtectorAction getMultiSell()
  180. {
  181. return _multiSell;
  182. }
  183. /**
  184. * Returns {@link #_transaction}.
  185. *
  186. * @return {@link #_transaction}
  187. */
  188. public FloodProtectorAction getTransaction()
  189. {
  190. return _transaction;
  191. }
  192. /**
  193. * Returns {@link #_sendMail}.
  194. *
  195. * @return {@link #_sendMail}
  196. */
  197. public FloodProtectorAction getSendMail()
  198. {
  199. return _sendMail;
  200. }
  201. }