HelpHandler.java 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (C) 2004-2015 L2J DataPack
  3. *
  4. * This file is part of L2J DataPack.
  5. *
  6. * L2J DataPack is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J DataPack is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package handlers.telnethandlers;
  20. import java.io.PrintWriter;
  21. import java.net.Socket;
  22. import com.l2jserver.gameserver.handler.ITelnetHandler;
  23. /**
  24. * @author UnAfraid
  25. */
  26. public class HelpHandler implements ITelnetHandler
  27. {
  28. private final String[] _commands =
  29. {
  30. "help"
  31. };
  32. @Override
  33. public boolean useCommand(String command, PrintWriter _print, Socket _cSocket, int _uptime)
  34. {
  35. if (command.equals("help"))
  36. {
  37. _print.println("The following is a list of all available commands: ");
  38. _print.println("help - shows this help.");
  39. _print.println("status - displays basic server statistics.");
  40. _print.println("gamestat privatestore - displays info about stores");
  41. _print.println("performance - shows server performance statistics.");
  42. _print.println("forcegc - forced garbage collection.");
  43. _print.println("purge - removes finished threads from thread pools.");
  44. _print.println("memusage - displays memory amounts in JVM.");
  45. _print.println("announce <text> - announces <text> in game.");
  46. _print.println("msg <nick> <text> - Sends a whisper to char <nick> with <text>.");
  47. _print.println("gmchat <text> - Sends a message to all GMs with <text>.");
  48. _print.println("gmlist - lists all gms online.");
  49. _print.println("kick - kick player <name> from server.");
  50. _print.println("shutdown <time> - shuts down server in <time> seconds.");
  51. _print.println("restart <time> - restarts down server in <time> seconds.");
  52. _print.println("abort - aborts shutdown/restart.");
  53. _print.println("give <player> <itemid> <amount>");
  54. _print.println("enchant <player> <itemType> <enchant> (itemType: 1 - Helmet, 2 - Chest, 3 - Gloves, 4 - Feet, 5 - Legs, 6 - Right Hand, 7 - Left Hand, 8 - Left Ear, 9 - Right Ear , 10 - Left Finger, 11 - Right Finger, 12- Necklace, 13 - Underwear, 14 - Back, 15 - Belt, 0 - No Enchant)");
  55. _print.println("debug <cmd> - executes the debug command (see 'help debug').");
  56. _print.println("reload <type> - reload data");
  57. _print.println("jail <player> [time]");
  58. _print.println("unjail <player>");
  59. _print.println("quit - closes telnet session.");
  60. }
  61. else if (command.equals("help debug"))
  62. {
  63. _print.println("The following is a list of all available debug commands: ");
  64. _print.println("full - Dumps complete debug information to an file (recommended)");
  65. _print.println("decay - prints info about the DecayManager");
  66. _print.println("packetsend - Send packet data to a player");
  67. _print.println("PacketTP - prints info about the General Packet ThreadPool");
  68. _print.println("IOPacketTP - prints info about the I/O Packet ThreadPool");
  69. _print.println("GeneralTP - prints info about the General ThreadPool");
  70. }
  71. return false;
  72. }
  73. @Override
  74. public String[] getCommandList()
  75. {
  76. return _commands;
  77. }
  78. }