warc222

Share][FrozenFear's Request]Recallall admin command Elfocras

Dec 31st, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P trunk2
  3. Index: gameserver/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminRecallAll.java
  4. ===================================================================
  5. --- gameserver/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminRecallAll.java (revision 0)
  6. +++ gameserver/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminRecallAll.java (revision 0)
  7. @@ -0,0 +1,56 @@
  8. +/* This program is free software; you can redistribute it and/or modify
  9. + * it under the terms of the GNU General Public License as published by
  10. + * the Free Software Foundation; either version 2, or (at your option)
  11. + * any later version.
  12. + *
  13. + * This program is distributed in the hope that it will be useful,
  14. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. + * GNU General Public License for more details.
  17. + *
  18. + * You should have received a copy of the GNU General Public License
  19. + * along with this program; if not, write to the Free Software
  20. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  21. + * 02111-1307, USA.
  22. + *
  23. + * http://www.gnu.org/copyleft/gpl.html
  24. + */
  25. +package com.l2jfrozen.gameserver.handler.admincommandhandlers;
  26. +
  27. +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
  28. +import com.l2jfrozen.gameserver.model.L2World;
  29. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  30. +
  31. +
  32. +
  33. +public class AdminRecallAll implements IAdminCommandHandler
  34. +{
  35. + private static final String[] ADMIN_COMMANDS = { "admin_recallall" };
  36. +
  37. + private void teleportTo(L2PcInstance activeChar, int x, int y, int z)
  38. + {
  39. +
  40. + activeChar.teleToLocation(x, y, z, false);
  41. +
  42. + }
  43. + public boolean useAdminCommand(String command, L2PcInstance activeChar)
  44. + {
  45. + int x = 0;
  46. + int y = 0;
  47. + int z = 0;
  48. +
  49. + if (command.startsWith("admin_recallall"))
  50. + {
  51. + for(L2PcInstance players :L2World.getInstance().getAllPlayers())
  52. + {
  53. + teleportTo(players, activeChar.getX(), activeChar.getY(), activeChar.getZ());
  54. + }
  55. + }
  56. + return false;
  57. + }
  58. + public String[] getAdminCommandList()
  59. + {
  60. + return ADMIN_COMMANDS;
  61. + }
  62. +}
  63. \ No newline at end of file
  64. Index: gameserver/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
  65. ===================================================================
  66. --- gameserver/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (revision 909)
  67. +++ gameserver/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (working copy)
  68. @@ -74,11 +75,13 @@
  69. import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminPledge;
  70. import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminPolymorph;
  71. import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminQuest;
  72. +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminRecallAll;
  73. import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminReload;
  74. import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminRepairChar;
  75. import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminRes;
  76. @@ -131,6 +134,7 @@
  77. registerAdminCommandHandler(new AdminCreateItem());
  78. registerAdminCommandHandler(new AdminHeal());
  79. registerAdminCommandHandler(new AdminHelpPage());
  80. + registerAdminCommandHandler(new AdminRecallAll());
  81. registerAdminCommandHandler(new AdminShutdown());
  82. registerAdminCommandHandler(new AdminSpawn());
  83. registerAdminCommandHandler(new AdminSkill());
Advertisement
Add Comment
Please, Sign In to add comment