Guest User

Voiced Command Handler in Bypass

a guest
Aug 18th, 2012
1,662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.55 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2J_Server
  3. Index: java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java
  4. ===================================================================
  5. --- java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java  (revision 5563)
  6. +++ java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java  (working copy)
  7. @@ -25,6 +25,8 @@
  8.  import com.l2jserver.gameserver.handler.BypassHandler;
  9.  import com.l2jserver.gameserver.handler.IAdminCommandHandler;
  10.  import com.l2jserver.gameserver.handler.IBypassHandler;
  11. +import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
  12. +import com.l2jserver.gameserver.handler.VoicedCommandHandler;
  13.  import com.l2jserver.gameserver.model.L2CharPosition;
  14.  import com.l2jserver.gameserver.model.L2Object;
  15.  import com.l2jserver.gameserver.model.L2World;
  16. @@ -117,6 +119,17 @@
  17.                     ach.useAdminCommand(_command, activeChar);
  18.                 }
  19.             }
  20. +           else if (_command.startsWith(".")) {
  21. +               String command = _command.substring(1).split(" ")[0];
  22. +               String params = _command.substring(1).split(" ").length > 1 ? _command.substring(1).split(" ")[1] : "";
  23. +               IVoicedCommandHandler vch = VoicedCommandHandler.getInstance().getHandler(command);
  24. +               if (vch == null)
  25. +               {
  26. +                   _log.warning(activeChar + " requested not registered admin command '" + command + "'");
  27. +                   return;
  28. +               }
  29. +               vch.useVoicedCommand(command, activeChar, params);
  30. +           }
  31.             else if (_command.equals("come_here") && activeChar.isGM())
  32.             {
  33.                 comeHere(activeChar);
Advertisement
Add Comment
Please, Sign In to add comment