FloodProtectors.java 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. * Subclass flood protector.
  45. */
  46. private final FloodProtectorAction _subclass;
  47. /**
  48. * Drop-item flood protector.
  49. */
  50. private final FloodProtectorAction _dropItem;
  51. /**
  52. * Server-bypass flood protector.
  53. */
  54. private final FloodProtectorAction _serverBypass;
  55. /**
  56. * Multisell flood protector.
  57. */
  58. private final FloodProtectorAction _multiSell;
  59. /**
  60. * Creates new instance of FloodProtectors.
  61. *
  62. * @param player
  63. * player for which the collection of flood protectors is being created.
  64. */
  65. public FloodProtectors(final L2PcInstance player)
  66. {
  67. super();
  68. _useItem = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_USE_ITEM);
  69. _rollDice = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_ROLL_DICE);
  70. _firework = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_FIREWORK);
  71. _itemPetSummon = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_ITEM_PET_SUMMON);
  72. _heroVoice = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_HERO_VOICE);
  73. _subclass = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SUBCLASS);
  74. _dropItem = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_DROP_ITEM);
  75. _serverBypass = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SERVER_BYPASS);
  76. _multiSell = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_MULTISELL);
  77. }
  78. /**
  79. * Returns {@link #_useItem}.
  80. *
  81. * @return {@link #_useItem}
  82. */
  83. public FloodProtectorAction getUseItem()
  84. {
  85. return _useItem;
  86. }
  87. /**
  88. * Returns {@link #_rollDice}.
  89. *
  90. * @return {@link #_rollDice}
  91. */
  92. public FloodProtectorAction getRollDice()
  93. {
  94. return _rollDice;
  95. }
  96. /**
  97. * Returns {@link #_firework}.
  98. *
  99. * @return {@link #_firework}
  100. */
  101. public FloodProtectorAction getFirework()
  102. {
  103. return _firework;
  104. }
  105. /**
  106. * Returns {@link #_itemPetSummon}.
  107. *
  108. * @return {@link #_itemPetSummon}
  109. */
  110. public FloodProtectorAction getItemPetSummon()
  111. {
  112. return _itemPetSummon;
  113. }
  114. /**
  115. * Returns {@link #_heroVoice}.
  116. *
  117. * @return {@link #_heroVoice}
  118. */
  119. public FloodProtectorAction getHeroVoice()
  120. {
  121. return _heroVoice;
  122. }
  123. /**
  124. * Returns {@link #_subclass}.
  125. *
  126. * @return {@link #_subclass}
  127. */
  128. public FloodProtectorAction getSubclass()
  129. {
  130. return _subclass;
  131. }
  132. /**
  133. * Returns {@link #_dropItem}.
  134. *
  135. * @return {@link #_dropItem}
  136. */
  137. public FloodProtectorAction getDropItem()
  138. {
  139. return _dropItem;
  140. }
  141. /**
  142. * Returns {@link #_serverBypass}.
  143. *
  144. * @return {@link #_serverBypass}
  145. */
  146. public FloodProtectorAction getServerBypass()
  147. {
  148. return _serverBypass;
  149. }
  150. /**
  151. * Returns {@link #_multisell}.
  152. *
  153. * @return {@link #_multisell}
  154. */
  155. public FloodProtectorAction getMultiSell()
  156. {
  157. return _multiSell;
  158. }
  159. }