Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2jFrozen_DataPack
- Index: data/html/srvinfo.htm
- ===================================================================
- --- data/html/srvinfo.htm (revision 0)
- +++ data/html/srvinfo.htm (working copy)
- @@ -0,0 +1,4 @@
- +<html>
- +Welcome!
- +If you are seeing this text, edit the content of this file on srvinfo.htm.
- +</html>
- \ No newline at end of file
- #P L2jFrozen_GameServer
- Index: head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (working copy)
- @@ -35,6 +35,7 @@
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.StatsCmd;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.TvTCmd;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.VersionCmd;
- +import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.VoiceInfo;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Voting;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Wedding;
- @@ -117,7 +118,9 @@
- {
- registerVoicedCommandHandler(new OfflineShop());
- }
- -
- +
- + registerVoicedCommandHandler(new VoiceInfo());
- +
- _log.config("VoicedCommandHandler: Loaded " + _datatable.size() + " handlers.");
- }
- Index: head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/VoiceInfo.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/VoiceInfo.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/VoiceInfo.java (working copy)
- @@ -0,0 +1,59 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see http://www.gnu.org/licenses/
- + */
- +package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
- +
- +import com.l2jfrozen.gameserver.cache.HtmCache;
- +import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
- +
- +public class VoiceInfo implements IVoicedCommandHandler
- +{
- + private static String[] VOICED_COMMANDS =
- + {
- + "srvinfo"
- + };
- +
- + /*
- + * (non-Javadoc)
- + * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
- + */
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- + String htmFile = "data/html/srvinfo.htm";
- + String htmContent = HtmCache.getInstance().getHtm(htmFile);
- + if (htmContent != null)
- + {
- + NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
- + infoHtml.setHtml(htmContent);
- + activeChar.sendPacket(infoHtml);
- + }
- + else
- + {
- + activeChar.sendMessage("Error 404: File " + htmFile + " was not found.");
- + }
- + return true;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement