FloodProtectors.java 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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.network.L2GameClient;
  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. * Manufacture flood protector.
  69. */
  70. private final FloodProtectorAction _manufacture;
  71. /**
  72. * Manor flood protector.
  73. */
  74. private final FloodProtectorAction _manor;
  75. /**
  76. * Send mail flood protector.
  77. */
  78. private final FloodProtectorAction _sendMail;
  79. /**
  80. * Character Select protector
  81. */
  82. private final FloodProtectorAction _characterSelect;
  83. /**
  84. * Creates new instance of FloodProtectors.
  85. *
  86. * @param player
  87. * player for which the collection of flood protectors is being created.
  88. */
  89. public FloodProtectors(final L2GameClient client)
  90. {
  91. super();
  92. _useItem = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_USE_ITEM);
  93. _rollDice = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_ROLL_DICE);
  94. _firework = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_FIREWORK);
  95. _itemPetSummon = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_ITEM_PET_SUMMON);
  96. _heroVoice = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_HERO_VOICE);
  97. _globalChat = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_GLOBAL_CHAT);
  98. _subclass = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SUBCLASS);
  99. _dropItem = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_DROP_ITEM);
  100. _serverBypass = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SERVER_BYPASS);
  101. _multiSell = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MULTISELL);
  102. _transaction = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_TRANSACTION);
  103. _manufacture = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MANUFACTURE);
  104. _manor = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MANOR);
  105. _sendMail = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SENDMAIL);
  106. _characterSelect = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_CHARACTER_SELECT);
  107. }
  108. /**
  109. * Returns {@link #_useItem}.
  110. *
  111. * @return {@link #_useItem}
  112. */
  113. public FloodProtectorAction getUseItem()
  114. {
  115. return _useItem;
  116. }
  117. /**
  118. * Returns {@link #_rollDice}.
  119. *
  120. * @return {@link #_rollDice}
  121. */
  122. public FloodProtectorAction getRollDice()
  123. {
  124. return _rollDice;
  125. }
  126. /**
  127. * Returns {@link #_firework}.
  128. *
  129. * @return {@link #_firework}
  130. */
  131. public FloodProtectorAction getFirework()
  132. {
  133. return _firework;
  134. }
  135. /**
  136. * Returns {@link #_itemPetSummon}.
  137. *
  138. * @return {@link #_itemPetSummon}
  139. */
  140. public FloodProtectorAction getItemPetSummon()
  141. {
  142. return _itemPetSummon;
  143. }
  144. /**
  145. * Returns {@link #_heroVoice}.
  146. *
  147. * @return {@link #_heroVoice}
  148. */
  149. public FloodProtectorAction getHeroVoice()
  150. {
  151. return _heroVoice;
  152. }
  153. /**
  154. * Returns {@link #_globalChat}.
  155. *
  156. * @return {@link #_globalChat}
  157. */
  158. public FloodProtectorAction getGlobalChat()
  159. {
  160. return _globalChat;
  161. }
  162. /**
  163. * Returns {@link #_subclass}.
  164. *
  165. * @return {@link #_subclass}
  166. */
  167. public FloodProtectorAction getSubclass()
  168. {
  169. return _subclass;
  170. }
  171. /**
  172. * Returns {@link #_dropItem}.
  173. *
  174. * @return {@link #_dropItem}
  175. */
  176. public FloodProtectorAction getDropItem()
  177. {
  178. return _dropItem;
  179. }
  180. /**
  181. * Returns {@link #_serverBypass}.
  182. *
  183. * @return {@link #_serverBypass}
  184. */
  185. public FloodProtectorAction getServerBypass()
  186. {
  187. return _serverBypass;
  188. }
  189. /**
  190. * Returns {@link #_multisell}.
  191. *
  192. * @return {@link #_multisell}
  193. */
  194. public FloodProtectorAction getMultiSell()
  195. {
  196. return _multiSell;
  197. }
  198. /**
  199. * Returns {@link #_transaction}.
  200. *
  201. * @return {@link #_transaction}
  202. */
  203. public FloodProtectorAction getTransaction()
  204. {
  205. return _transaction;
  206. }
  207. /**
  208. * Returns {@link #_manufacture}.
  209. *
  210. * @return {@link #_manufacture}
  211. */
  212. public FloodProtectorAction getManufacture()
  213. {
  214. return _manufacture;
  215. }
  216. /**
  217. * Returns {@link #_manor}.
  218. *
  219. * @return {@link #_manor}
  220. */
  221. public FloodProtectorAction getManor()
  222. {
  223. return _manor;
  224. }
  225. /**
  226. * Returns {@link #_sendMail}.
  227. *
  228. * @return {@link #_sendMail}
  229. */
  230. public FloodProtectorAction getSendMail()
  231. {
  232. return _sendMail;
  233. }
  234. /**
  235. * Returns {@link #_characterSelect}.
  236. *
  237. * @return {@link #_characterSelect}
  238. */
  239. public FloodProtectorAction getCharacterSelect()
  240. {
  241. return _characterSelect;
  242. }
  243. }