Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2jFrozen_GameServer
- Index: head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/ServerTimeCmd.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/ServerTimeCmd.java (nonexistent)
- +++ head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/ServerTimeCmd.java (working copy)
- @@ -0,0 +1,33 @@
- +package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
- +
- +import java.text.SimpleDateFormat;
- +import java.util.Date;
- +
- +import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +
- +public class ServerTimeCmd implements IVoicedCommandHandler
- +{
- + private final SimpleDateFormat fmt = new SimpleDateFormat("d MMM H:mm"); // 4 Jul 21:15
- +
- + private static final String[] VOICED_COMMANDS =
- + {
- + "servertime",
- + };
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- + if(activeChar == null)
- + return false;
- +
- + activeChar.sendMessage("Server time: " + fmt.format(new Date(System.currentTimeMillis())));
- + return true;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +}
- Index: head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (revision 1011)
- +++ head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (working copy)
- @@ -34,6 +34,7 @@
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.FarmPvpCmd;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.OfflineShop;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Online;
- +import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.ServerTimeCmd;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.StatsCmd;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.TvTCmd;
- import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.WeddingCmd;
- @@ -86,6 +87,8 @@
- if (Config.OFFLINE_TRADE_ENABLE && Config.OFFLINE_COMMAND2)
- registerVoicedCommandHandler(new OfflineShop());
- + registerVoicedCommandHandler(new ServerTimeCmd());
- +
- LOGGER.info("VoicedCommandHandler: Loaded " + voicedCommands.size() + " handlers.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement