FloodProtectors.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. * Creates new instance of FloodProtectors.
  57. *
  58. * @param player
  59. * player for which the collection of flood protectors is being created.
  60. */
  61. public FloodProtectors(final L2PcInstance player)
  62. {
  63. super();
  64. _useItem = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_USE_ITEM);
  65. _rollDice = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_ROLL_DICE);
  66. _firework = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_FIREWORK);
  67. _itemPetSummon = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_ITEM_PET_SUMMON);
  68. _heroVoice = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_HERO_VOICE);
  69. _subclass = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SUBCLASS);
  70. _dropItem = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_DROP_ITEM);
  71. _serverBypass = new FloodProtectorAction(player, Config.FLOOD_PROTECTOR_SERVER_BYPASS);
  72. }
  73. /**
  74. * Returns {@link #_useItem}.
  75. *
  76. * @return {@link #_useItem}
  77. */
  78. public FloodProtectorAction getUseItem()
  79. {
  80. return _useItem;
  81. }
  82. /**
  83. * Returns {@link #_rollDice}.
  84. *
  85. * @return {@link #_rollDice}
  86. */
  87. public FloodProtectorAction getRollDice()
  88. {
  89. return _rollDice;
  90. }
  91. /**
  92. * Returns {@link #_firework}.
  93. *
  94. * @return {@link #_firework}
  95. */
  96. public FloodProtectorAction getFirework()
  97. {
  98. return _firework;
  99. }
  100. /**
  101. * Returns {@link #_itemPetSummon}.
  102. *
  103. * @return {@link #_itemPetSummon}
  104. */
  105. public FloodProtectorAction getItemPetSummon()
  106. {
  107. return _itemPetSummon;
  108. }
  109. /**
  110. * Returns {@link #_heroVoice}.
  111. *
  112. * @return {@link #_heroVoice}
  113. */
  114. public FloodProtectorAction getHeroVoice()
  115. {
  116. return _heroVoice;
  117. }
  118. /**
  119. * Returns {@link #_subclass}.
  120. *
  121. * @return {@link #_subclass}
  122. */
  123. public FloodProtectorAction getSubclass()
  124. {
  125. return _subclass;
  126. }
  127. /**
  128. * Returns {@link #_dropItem}.
  129. *
  130. * @return {@link #_dropItem}
  131. */
  132. public FloodProtectorAction getDropItem()
  133. {
  134. return _dropItem;
  135. }
  136. /**
  137. * Returns {@link #_serverBypass}.
  138. *
  139. * @return {@link #_serverBypass}
  140. */
  141. public FloodProtectorAction getServerBypass()
  142. {
  143. return _serverBypass;
  144. }
  145. }