Advertisement
ChristianSDM

command info

Apr 6th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2jFrozen_DataPack
  3. Index: data/html/srvinfo.htm
  4. ===================================================================
  5. --- data/html/srvinfo.htm (revision 0)
  6. +++ data/html/srvinfo.htm (working copy)
  7. @@ -0,0 +1,4 @@
  8. +<html>
  9. +Welcome!
  10. +If you are seeing this text, edit the content of this file on srvinfo.htm.
  11. +</html>
  12. \ No newline at end of file
  13. #P L2jFrozen_GameServer
  14. Index: head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java
  15. ===================================================================
  16. --- head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (revision 1004)
  17. +++ head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (working copy)
  18. @@ -35,6 +35,7 @@
  19. import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.StatsCmd;
  20. import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.TvTCmd;
  21. import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.VersionCmd;
  22. +import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.VoiceInfo;
  23. import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Voting;
  24. import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Wedding;
  25.  
  26. @@ -117,7 +118,9 @@
  27. {
  28. registerVoicedCommandHandler(new OfflineShop());
  29. }
  30. -
  31. +
  32. + registerVoicedCommandHandler(new VoiceInfo());
  33. +
  34. _log.config("VoicedCommandHandler: Loaded " + _datatable.size() + " handlers.");
  35.  
  36. }
  37. Index: head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/VoiceInfo.java
  38. ===================================================================
  39. --- head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/VoiceInfo.java (revision 0)
  40. +++ head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/VoiceInfo.java (working copy)
  41. @@ -0,0 +1,59 @@
  42. +/*
  43. + * This program is free software: you can redistribute it and/or modify it under
  44. + * the terms of the GNU General Public License as published by the Free Software
  45. + * Foundation, either version 3 of the License, or (at your option) any later
  46. + * version.
  47. + *
  48. + * This program is distributed in the hope that it will be useful, but WITHOUT
  49. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  50. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  51. + * details.
  52. + *
  53. + * You should have received a copy of the GNU General Public License along with
  54. + * this program. If not, see http://www.gnu.org/licenses/
  55. + */
  56. +package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
  57. +
  58. +import com.l2jfrozen.gameserver.cache.HtmCache;
  59. +import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
  60. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  61. +import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
  62. +
  63. +public class VoiceInfo implements IVoicedCommandHandler
  64. +{
  65. + private static String[] VOICED_COMMANDS =
  66. + {
  67. + "srvinfo"
  68. + };
  69. +
  70. + /*
  71. + * (non-Javadoc)
  72. + * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  73. + */
  74. + @Override
  75. + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  76. + {
  77. + String htmFile = "data/html/srvinfo.htm";
  78. + String htmContent = HtmCache.getInstance().getHtm(htmFile);
  79. + if (htmContent != null)
  80. + {
  81. + NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
  82. + infoHtml.setHtml(htmContent);
  83. + activeChar.sendPacket(infoHtml);
  84. + }
  85. + else
  86. + {
  87. + activeChar.sendMessage("Error 404: File " + htmFile + " was not found.");
  88. + }
  89. + return true;
  90. + }
  91. +
  92. + @Override
  93. + public String[] getVoicedCommandList()
  94. + {
  95. + return VOICED_COMMANDS;
  96. + }
  97. +}
  98. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement