HelpHandler.java 3.6 KB

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