diff --git a/L2J_Mobius_CT_2.6_HighFive/.classpath b/L2J_Mobius_CT_2.6_HighFive/.classpath index fbf4264a09..73cb392424 100644 --- a/L2J_Mobius_CT_2.6_HighFive/.classpath +++ b/L2J_Mobius_CT_2.6_HighFive/.classpath @@ -7,5 +7,6 @@ + diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/General.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/General.ini index 1c563dd1e9..056765cf27 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/General.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/General.ini @@ -145,27 +145,6 @@ SkillCheckRemove = True SkillCheckGM = False -# --------------------------------------------------------------------------- -# Thread Configuration -# --------------------------------------------------------------------------- - -# Determines the amount of scheduled thread pools. If set to -1, the server will decide the amount depending on the available processors. -# Default: -1 -ScheduledThreadPoolCount = -1 - -# Specifies how many threads will be in a single scheduled pool. -# Default: 4 -ThreadsPerScheduledThreadPool = 40 - -# Determines the amount of instant thread pools. If set to -1, the server will decide the amount depending on the available processors. -# Default: -1 -InstantThreadPoolCount = -1 - -# Specifies how many threads will be in a single instant pool. -# Default: 2 -ThreadsPerInstantThreadPool = 20 - - # --------------------------------------------------------------------------- # Dead Lock Detector (separate thread for detecting deadlocks) # --------------------------------------------------------------------------- diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/MMO.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/MMO.ini deleted file mode 100644 index f425a33d97..0000000000 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/MMO.ini +++ /dev/null @@ -1,26 +0,0 @@ -#--------------------------------------------------------------- -# MMO -#--------------------------------------------------------------- - -# Sleep time for all Selectors -# After he finished his job the Selector waits the given time in milliseconds -# Lower values will speed up the loop and the Ping is smaller -SleepTime = 20 - -# Every loop it send a maximum of the given packages to each connection -# Lower values will speed up the loop and the Ping is smaller but cause less output -# Default: 12 -MaxSendPerPass = 60 - -# Every loop it read a maximum of the given packages from each connection -# Lower values will speed up the loop and the Ping is smaller but cause less input -# Default: 12 -MaxReadPerPass = 60 - -# Each unfinished read/write need a TEMP storage Buffer -# on large player amount we need more Buffers -# if there are not enough buffers new ones are generated but not stored for future usage -HelperBufferCount = 20 - -# Setting this to True will lower your ping, at the cost of an increase in bandwidth consumption. -TcpNoDelay = True \ No newline at end of file diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Server.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Server.ini index 5ee42d0faa..ec18ea846b 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Server.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Server.ini @@ -26,7 +26,7 @@ LoginPort = 9014 # WARNING: Please don't change default IPs here if you don't know what are you doing! # WARNING: External/Internal IPs are now inside "ipconfig.xml" file. # Default: * (0.0.0.0) -GameserverHostname = * +GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 @@ -91,6 +91,30 @@ MaximumOnlineUsers = 2000 AllowedProtocolRevisions = 267;268;271;273 +# --------------------------------------------------------------------------- +# Thread Configuration +# --------------------------------------------------------------------------- + +# Determines the amount of scheduled thread pools. If set to -1, the server will decide the amount depending on the available processors. +# Default: -1 +ScheduledThreadPoolCount = -1 + +# Specifies how many threads will be in a single scheduled pool. +# Default: 4 +ThreadsPerScheduledThreadPool = 40 + +# Determines the amount of instant thread pools. If set to -1, the server will decide the amount depending on the available processors. +# Default: -1 +InstantThreadPoolCount = -1 + +# Specifies how many threads will be in a single instant pool. +# Default: 2 +ThreadsPerInstantThreadPool = 20 + +# Default: 2 +UrgentPacketThreadCoreSize = 20 + + # --------------------------------------------------------------------------- # Misc Player Settings # --------------------------------------------------------------------------- diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Telnet.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Telnet.ini index f375cc8e76..c10912945b 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Telnet.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Telnet.ini @@ -5,7 +5,6 @@ # Warning: # Please take extreme caution when changing anything. Also please understand what you are changing before you do so on a live server. # --------------------------------------------------------------------------- - # Allows text based monitoring and administration of L2J GS # by using a telnet client. Communication protocol is insecure # and you should use SSL tunnels, VPN, etc. if you plan to connect @@ -13,16 +12,20 @@ # Default: False EnableTelnet = False +# This is the hostname address on which telnet server will be listening. +# Note for all adapters use: * +# Default: 127.0.0.1 +BindAddress = 127.0.0.1 + # This is the port L2J should listen to for incoming telnet # requests. # Default: 54321 -StatusPort = 54321 +Port = 54321 # If the following is not set, a random password is generated on server startup. -# Usage: StatusPW = somePass -StatusPW = +Password = somepassword # This list can contain IPs or Hosts of clients you wish to allow. Hostnames must be resolvable to an IP. # Example: 0.0.0.0,host,0.0.0.1,host2,host3,host4,0.0.0.3 -# Default: 127.0.0.1,localhost -ListOfHosts = 127.0.0.1,localhost \ No newline at end of file +# Default: 127.0.0.1,localhost,::1 +ListOfHosts = 127.0.0.1,localhost,::1 \ No newline at end of file diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java index 13fca577e3..723005a3fc 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java @@ -39,7 +39,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; -import com.l2jmobius.gameserver.network.serverpackets.L2GameServerPacket; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; import com.l2jmobius.gameserver.network.serverpackets.NpcSay; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.util.Util; @@ -691,7 +691,7 @@ public class HallOfErosionAttack extends AbstractNpcAI } } - protected void broadCastPacket(HEAWorld world, L2GameServerPacket packet) + protected void broadCastPacket(HEAWorld world, IClientOutgoingPacket packet) { for (int objId : world.getAllowed()) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java index c055871d04..eb982fbb08 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java @@ -39,7 +39,7 @@ import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; -import com.l2jmobius.gameserver.network.serverpackets.L2GameServerPacket; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; import com.l2jmobius.gameserver.network.serverpackets.NpcSay; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.util.Util; @@ -684,7 +684,7 @@ public class HallOfErosionDefence extends AbstractNpcAI } } - protected void broadCastPacket(HEDWorld world, L2GameServerPacket packet) + protected void broadCastPacket(HEDWorld world, IClientOutgoingPacket packet) { for (int objId : world.getAllowed()) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityAttack/HeartInfinityAttack.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityAttack/HeartInfinityAttack.java index 96bbf3419b..dda8c53ffc 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityAttack/HeartInfinityAttack.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityAttack/HeartInfinityAttack.java @@ -43,7 +43,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; -import com.l2jmobius.gameserver.network.serverpackets.L2GameServerPacket; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; import com.l2jmobius.gameserver.network.serverpackets.NpcSay; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.util.Util; @@ -867,7 +867,7 @@ public class HeartInfinityAttack extends Quest } } - protected void broadCastPacket(HIAWorld world, L2GameServerPacket packet) + protected void broadCastPacket(HIAWorld world, IClientOutgoingPacket packet) { for (int objId : world.getAllowed()) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java index 96d1c9f6df..613bba04c4 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java @@ -42,7 +42,7 @@ import com.l2jmobius.gameserver.model.zone.L2ZoneType; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; -import com.l2jmobius.gameserver.network.serverpackets.L2GameServerPacket; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; import com.l2jmobius.gameserver.network.serverpackets.NpcSay; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.util.Util; @@ -762,7 +762,7 @@ public class HeartInfinityDefence extends Quest return null; } - protected void broadCastPacket(HIDWorld world, L2GameServerPacket packet) + protected void broadCastPacket(HIDWorld world, IClientOutgoingPacket packet) { for (int objId : world.getAllowed()) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/SeedOfDestruction/SeedOfDestruction.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/SeedOfDestruction/SeedOfDestruction.java index dd8ea2f552..a2bd3aa1a2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/SeedOfDestruction/SeedOfDestruction.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/gracia/instances/SeedOfDestruction/SeedOfDestruction.java @@ -48,7 +48,7 @@ import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.CameraMode; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; -import com.l2jmobius.gameserver.network.serverpackets.L2GameServerPacket; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; import com.l2jmobius.gameserver.network.serverpackets.NormalCamera; import com.l2jmobius.gameserver.network.serverpackets.SocialAction; import com.l2jmobius.gameserver.network.serverpackets.SpecialCamera; @@ -1732,7 +1732,7 @@ public class SeedOfDestruction extends AbstractNpcAI return super.onEnterZone(character, zone); } - private void broadcastPacket(L2GameServerPacket mov, SODWorld world) + private void broadcastPacket(IClientOutgoingPacket mov, SODWorld world) { for (L2PcInstance player : world.PlayersInInstance) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java index 4f8ddd172b..590a47aabf 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/MasterHandler.java @@ -34,9 +34,9 @@ import com.l2jmobius.gameserver.handler.IHandler; import com.l2jmobius.gameserver.handler.ItemHandler; import com.l2jmobius.gameserver.handler.PunishmentHandler; import com.l2jmobius.gameserver.handler.TargetHandler; -import com.l2jmobius.gameserver.handler.TelnetHandler; import com.l2jmobius.gameserver.handler.UserCommandHandler; import com.l2jmobius.gameserver.handler.VoicedCommandHandler; +import com.l2jmobius.gameserver.network.telnet.TelnetServer; import handlers.actionhandlers.L2ArtefactInstanceAction; import handlers.actionhandlers.L2DecoyAction; @@ -250,14 +250,30 @@ import handlers.targethandlers.Servitor; import handlers.targethandlers.Summon; import handlers.targethandlers.TargetParty; import handlers.targethandlers.Unlockable; -import handlers.telnethandlers.ChatsHandler; -import handlers.telnethandlers.DebugHandler; -import handlers.telnethandlers.HelpHandler; -import handlers.telnethandlers.PlayerHandler; -import handlers.telnethandlers.ReloadHandler; -import handlers.telnethandlers.ServerHandler; -import handlers.telnethandlers.StatusHandler; -import handlers.telnethandlers.ThreadHandler; +import handlers.telnethandlers.chat.Announce; +import handlers.telnethandlers.chat.GMChat; +import handlers.telnethandlers.chat.Msg; +import handlers.telnethandlers.player.AccessLevel; +import handlers.telnethandlers.player.Ban; +import handlers.telnethandlers.player.BanChat; +import handlers.telnethandlers.player.Enchant; +import handlers.telnethandlers.player.GMList; +import handlers.telnethandlers.player.Give; +import handlers.telnethandlers.player.Jail; +import handlers.telnethandlers.player.Kick; +import handlers.telnethandlers.player.SendMail; +import handlers.telnethandlers.player.Unban; +import handlers.telnethandlers.player.UnbanChat; +import handlers.telnethandlers.player.Unjail; +import handlers.telnethandlers.server.ForceGC; +import handlers.telnethandlers.server.Memusage; +import handlers.telnethandlers.server.Performance; +import handlers.telnethandlers.server.Purge; +import handlers.telnethandlers.server.Reload; +import handlers.telnethandlers.server.ServerAbort; +import handlers.telnethandlers.server.ServerRestart; +import handlers.telnethandlers.server.ServerShutdown; +import handlers.telnethandlers.server.Status; import handlers.usercommandhandlers.ChannelDelete; import handlers.usercommandhandlers.ChannelInfo; import handlers.usercommandhandlers.ChannelLeave; @@ -304,7 +320,6 @@ public class MasterHandler UserCommandHandler.getInstance(), VoicedCommandHandler.getInstance(), TargetHandler.getInstance(), - TelnetHandler.getInstance(), }; private static final Class[][] HANDLERS = @@ -581,17 +596,6 @@ public class MasterHandler TargetParty.class, Unlockable.class, }, - { - // Telnet Handlers - ChatsHandler.class, - DebugHandler.class, - HelpHandler.class, - PlayerHandler.class, - ReloadHandler.class, - ServerHandler.class, - StatusHandler.class, - ThreadHandler.class, - }, }; public static void main(String[] args) @@ -644,6 +648,35 @@ public class MasterHandler } } + if (Config.TELNET_ENABLED) + { + TelnetServer.getInstance().addHandler(new Announce()); + TelnetServer.getInstance().addHandler(new GMChat()); + TelnetServer.getInstance().addHandler(new Msg()); + TelnetServer.getInstance().addHandler(new AccessLevel()); + TelnetServer.getInstance().addHandler(new Ban()); + TelnetServer.getInstance().addHandler(new BanChat()); + TelnetServer.getInstance().addHandler(new Enchant()); + TelnetServer.getInstance().addHandler(new Give()); + TelnetServer.getInstance().addHandler(new GMList()); + TelnetServer.getInstance().addHandler(new Jail()); + TelnetServer.getInstance().addHandler(new Kick()); + TelnetServer.getInstance().addHandler(new Unban()); + TelnetServer.getInstance().addHandler(new UnbanChat()); + TelnetServer.getInstance().addHandler(new Unjail()); + TelnetServer.getInstance().addHandler(new ForceGC()); + TelnetServer.getInstance().addHandler(new Memusage()); + TelnetServer.getInstance().addHandler(new Performance()); + TelnetServer.getInstance().addHandler(new Purge()); + TelnetServer.getInstance().addHandler(new Reload()); + TelnetServer.getInstance().addHandler(new SendMail()); + TelnetServer.getInstance().addHandler(new ServerAbort()); + TelnetServer.getInstance().addHandler(new ServerRestart()); + TelnetServer.getInstance().addHandler(new ServerShutdown()); + TelnetServer.getInstance().addHandler(new Status()); + TelnetServer.getInstance().addHandler(new handlers.telnethandlers.server.Debug()); + } + for (IHandler loadInstance : LOAD_INSTANCES) { _log.log(Level.INFO, loadInstance.getClass().getSimpleName() + ": Loaded " + loadInstance.size() + " Handlers"); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java index da81f8b100..77fac03783 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java @@ -296,7 +296,7 @@ public final class AdminCHSiege implements IAdminCommandHandler } else if (split[0].equals(COMMANDS[7])) { - activeChar.sendPacket(new SiegeInfo(hall)); + activeChar.sendPacket(new SiegeInfo(hall, activeChar)); } else if (split[0].equals(COMMANDS[8])) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index 89fc474fb3..3525949b57 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -991,7 +991,7 @@ public class AdminEditChar implements IAdminCommandHandler } else { - ip = client.getConnection().getInetAddress().getHostAddress(); + ip = client.getConnectionAddress().getHostAddress(); // if (client.getHWID() != null) // { // hwid = client.getHWID(); @@ -1209,7 +1209,7 @@ public class AdminEditChar implements IAdminCommandHandler continue; } - ip = client.getConnection().getInetAddress().getHostAddress(); + ip = client.getConnectionAddress().getHostAddress(); if (!ip.equals(IpAdress)) { continue; @@ -1304,7 +1304,7 @@ public class AdminEditChar implements IAdminCommandHandler continue; } - ip = client.getConnection().getInetAddress().getHostAddress(); + ip = client.getConnectionAddress().getHostAddress(); if (ipMap.get(ip) == null) { ipMap.put(ip, new ArrayList()); @@ -1356,7 +1356,7 @@ public class AdminEditChar implements IAdminCommandHandler continue; } - final IpPack pack = new IpPack(client.getConnection().getInetAddress().getHostAddress(), client.getTrace()); + final IpPack pack = new IpPack(client.getConnectionAddress().getHostAddress(), client.getTrace()); if (ipMap.get(pack) == null) { ipMap.put(pack, new ArrayList()); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java index 2bd233a60c..dfd944bb84 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java @@ -31,18 +31,15 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; -import com.l2jmobius.gameserver.network.serverpackets.CharInfo; import com.l2jmobius.gameserver.network.serverpackets.Earthquake; -import com.l2jmobius.gameserver.network.serverpackets.ExBrExtraUserInfo; import com.l2jmobius.gameserver.network.serverpackets.ExRedSky; -import com.l2jmobius.gameserver.network.serverpackets.L2GameServerPacket; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse; import com.l2jmobius.gameserver.network.serverpackets.PlaySound; import com.l2jmobius.gameserver.network.serverpackets.SSQInfo; import com.l2jmobius.gameserver.network.serverpackets.SocialAction; import com.l2jmobius.gameserver.network.serverpackets.SunRise; import com.l2jmobius.gameserver.network.serverpackets.SunSet; -import com.l2jmobius.gameserver.network.serverpackets.UserInfo; import com.l2jmobius.gameserver.util.Broadcast; import com.l2jmobius.gameserver.util.Util; @@ -382,11 +379,7 @@ public class AdminEffects implements IAdminCommandHandler final String id = st.nextToken(); activeChar.getPoly().setPolyInfo("npc", id); activeChar.teleToLocation(activeChar.getLocation()); - final CharInfo info1 = new CharInfo(activeChar); - activeChar.broadcastPacket(info1); - final UserInfo info2 = new UserInfo(activeChar); - activeChar.sendPacket(info2); - activeChar.broadcastPacket(new ExBrExtraUserInfo(activeChar)); + activeChar.broadcastUserInfo(); } catch (Exception e) { @@ -398,11 +391,7 @@ public class AdminEffects implements IAdminCommandHandler activeChar.getPoly().setPolyInfo(null, "1"); activeChar.decayMe(); activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ()); - final CharInfo info1 = new CharInfo(activeChar); - activeChar.broadcastPacket(info1); - final UserInfo info2 = new UserInfo(activeChar); - activeChar.sendPacket(info2); - activeChar.broadcastPacket(new ExBrExtraUserInfo(activeChar)); + activeChar.broadcastUserInfo(); } else if (command.equals("admin_clearteams")) { @@ -718,7 +707,7 @@ public class AdminEffects implements IAdminCommandHandler */ private void adminAtmosphere(String type, String state, int duration, L2PcInstance activeChar) { - L2GameServerPacket packet = null; + IClientOutgoingPacket packet = null; if (type.equals("signsky")) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEnchant.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEnchant.java index c16443a45a..20dbed7966 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEnchant.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEnchant.java @@ -25,10 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.SystemMessageId; -import com.l2jmobius.gameserver.network.serverpackets.CharInfo; -import com.l2jmobius.gameserver.network.serverpackets.ExBrExtraUserInfo; import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; -import com.l2jmobius.gameserver.network.serverpackets.UserInfo; /** * This class handles following admin commands: - enchant_armor @@ -214,9 +211,7 @@ public class AdminEnchant implements IAdminCommandHandler final InventoryUpdate iu = new InventoryUpdate(); iu.addModifiedItem(itemInstance); player.sendPacket(iu); - player.broadcastPacket(new CharInfo(player)); - player.sendPacket(new UserInfo(player)); - player.broadcastPacket(new ExBrExtraUserInfo(player)); + player.broadcastUserInfo(); // informations activeChar.sendMessage("Changed enchantment of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + "."); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java index 0873b40a47..c67ef1dd7c 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java @@ -35,11 +35,8 @@ import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.entity.L2Event; import com.l2jmobius.gameserver.model.entity.L2Event.EventState; -import com.l2jmobius.gameserver.network.serverpackets.CharInfo; -import com.l2jmobius.gameserver.network.serverpackets.ExBrExtraUserInfo; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.PlaySound; -import com.l2jmobius.gameserver.network.serverpackets.UserInfo; import com.l2jmobius.gameserver.util.Broadcast; /** @@ -324,11 +321,7 @@ public class AdminEventEngine implements IAdminCommandHandler { player.getPoly().setPolyInfo("npc", polyIds[Rnd.get(polyIds.length)]); player.teleToLocation(player.getLocation(), true); - final CharInfo info1 = new CharInfo(player); - player.broadcastPacket(info1); - final UserInfo info2 = new UserInfo(player); - player.sendPacket(info2); - player.broadcastPacket(new ExBrExtraUserInfo(player)); + player.broadcastUserInfo(); } showEventControl(activeChar); } @@ -341,11 +334,7 @@ public class AdminEventEngine implements IAdminCommandHandler player.getPoly().setPolyInfo(null, "1"); player.decayMe(); player.spawnMe(player.getX(), player.getY(), player.getZ()); - final CharInfo info1 = new CharInfo(player); - player.broadcastPacket(info1); - final UserInfo info2 = new UserInfo(player); - player.sendPacket(info2); - player.broadcastPacket(new ExBrExtraUserInfo(player)); + player.broadcastUserInfo(); } } showEventControl(activeChar); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java index 9858be96c2..35c1aef685 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java @@ -22,9 +22,6 @@ import java.util.Collection; import java.util.LinkedList; import java.util.StringTokenizer; -import com.l2jmobius.commons.concurrent.ThreadPool; -import com.l2jmobius.commons.mmocore.NioNetStringBuffer; -import com.l2jmobius.gameserver.GameServer; import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.model.L2Object; @@ -32,7 +29,6 @@ import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Playable; import com.l2jmobius.gameserver.model.actor.instance.L2BoatInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.network.clientpackets.L2GameClientPacket; import com.l2jmobius.gameserver.network.serverpackets.AdminForgePacket; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; @@ -88,7 +84,7 @@ public final class AdminPForge implements IAdminCommandHandler long opCodeLong; try { - opCodeLong = Long.parseLong(opCode); + opCodeLong = Long.decode(opCode); } catch (Exception e) { @@ -596,16 +592,20 @@ public final class AdminPForge implements IAdminCommandHandler } else if (bb != null) { - bb.flip(); - final L2GameClientPacket p = (L2GameClientPacket) GameServer.gameServer.getL2GamePacketHandler().handlePacket(bb, activeChar.getClient()); + // TODO: Implement me! + // @formatter:off + /*bb.flip(); + L2GameClientPacket p = (L2GameClientPacket) GameServer.gameServer.getL2GamePacketHandler().handlePacket(bb, activeChar.getClient()); if (p != null) { p.setBuffers(bb, activeChar.getClient(), new NioNetStringBuffer(2000)); if (p.read()) { - ThreadPool.execute(p); + ThreadPoolManager.getInstance().executePacket(p); } - } + }*/ + // @formatter:on + throw new UnsupportedOperationException("Not implemented yet!"); } showValuesPage(activeChar, opCodes, format); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java index 187079317b..3c4c099d11 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java @@ -334,7 +334,7 @@ public class AdminShowQuests implements IAdminCommandHandler { Quest.deleteQuestInDb(qs, true); qs.exitQuest(true); - target.sendPacket(new QuestList()); + target.sendPacket(new QuestList(target)); target.sendPacket(new ExShowQuestMark(qs.getQuest().getId())); break; } @@ -343,7 +343,7 @@ public class AdminShowQuests implements IAdminCommandHandler qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target); qs.setState(State.STARTED); qs.set("cond", "1"); - target.sendPacket(new QuestList()); + target.sendPacket(new QuestList(target)); target.sendPacket(new ExShowQuestMark(qs.getQuest().getId())); val[0] = qs.getQuest().getName(); break; @@ -352,7 +352,7 @@ public class AdminShowQuests implements IAdminCommandHandler { qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target); qs.exitQuest(false); - target.sendPacket(new QuestList()); + target.sendPacket(new QuestList(target)); target.sendPacket(new ExShowQuestMark(qs.getQuest().getId())); val[0] = qs.getQuest().getName(); break; @@ -369,7 +369,7 @@ public class AdminShowQuests implements IAdminCommandHandler { qs.set(val[1], val[2]); } - target.sendPacket(new QuestList()); + target.sendPacket(new QuestList(target)); target.sendPacket(new ExShowQuestMark(qs.getQuest().getId())); } actor.sendMessage(""); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/ChatsHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/ChatsHandler.java deleted file mode 100644 index 39de274d30..0000000000 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/ChatsHandler.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * 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 . - */ -package handlers.telnethandlers; - -import java.io.PrintWriter; -import java.net.Socket; -import java.util.StringTokenizer; - -import com.l2jmobius.gameserver.data.xml.impl.AdminData; -import com.l2jmobius.gameserver.enums.ChatType; -import com.l2jmobius.gameserver.handler.ITelnetHandler; -import com.l2jmobius.gameserver.model.L2World; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.network.serverpackets.CreatureSay; -import com.l2jmobius.gameserver.util.Broadcast; - -/** - * @author UnAfraid - */ -public class ChatsHandler implements ITelnetHandler -{ - private final String[] _commands = - { - "announce", - "msg", - "gmchat" - }; - - @Override - public boolean useCommand(String command, PrintWriter _print, Socket _cSocket, int _uptime) - { - if (command.startsWith("announce")) - { - try - { - command = command.substring(9); - Broadcast.toAllOnlinePlayers(command); - _print.println("Announcement Sent!"); - } - catch (StringIndexOutOfBoundsException e) - { - _print.println("Please Enter Some Text To Announce!"); - } - } - else if (command.startsWith("msg")) - { - try - { - final String val = command.substring(4); - final StringTokenizer st = new StringTokenizer(val); - final String name = st.nextToken(); - final String message = val.substring(name.length() + 1); - final L2PcInstance reciever = L2World.getInstance().getPlayer(name); - final CreatureSay cs = new CreatureSay(0, ChatType.WHISPER, "Telnet Priv", message); - if (reciever != null) - { - reciever.sendPacket(cs); - _print.println("Telnet Priv->" + name + ": " + message); - _print.println("Message Sent!"); - } - else - { - _print.println("Unable To Find Username: " + name); - } - } - catch (StringIndexOutOfBoundsException e) - { - _print.println("Please Enter Some Text!"); - } - } - else if (command.startsWith("gmchat")) - { - try - { - command = command.substring(7); - final CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, "Telnet GM Broadcast from " + _cSocket.getInetAddress().getHostAddress(), command); - AdminData.getInstance().broadcastToGMs(cs); - _print.println("Your Message Has Been Sent To " + getOnlineGMS() + " GM(s)."); - } - catch (StringIndexOutOfBoundsException e) - { - _print.println("Please Enter Some Text To Announce!"); - } - } - return false; - } - - private int getOnlineGMS() - { - return AdminData.getInstance().getAllGms(true).size(); - } - - @Override - public String[] getCommandList() - { - return _commands; - } -} diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java deleted file mode 100644 index aaa51a0e89..0000000000 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java +++ /dev/null @@ -1,420 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * 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 . - */ -package handlers.telnethandlers; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.lang.management.ManagementFactory; -import java.lang.management.ThreadInfo; -import java.lang.management.ThreadMXBean; -import java.net.Socket; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.StringTokenizer; - -import com.l2jmobius.commons.concurrent.ThreadPool; -import com.l2jmobius.gameserver.GameTimeController; -import com.l2jmobius.gameserver.LoginServerThread; -import com.l2jmobius.gameserver.data.xml.impl.AdminData; -import com.l2jmobius.gameserver.enums.ItemLocation; -import com.l2jmobius.gameserver.handler.ITelnetHandler; -import com.l2jmobius.gameserver.model.L2Object; -import com.l2jmobius.gameserver.model.L2World; -import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; -import com.l2jmobius.gameserver.model.actor.L2Summon; -import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; -import com.l2jmobius.gameserver.network.serverpackets.AdminForgePacket; -import com.l2jmobius.gameserver.taskmanager.DecayTaskManager; - -/** - * @author UnAfraid - */ -public class DebugHandler implements ITelnetHandler -{ - private final String[] _commands = - { - "debug" - }; - - private int uptime = 0; - - @Override - public boolean useCommand(String command, PrintWriter _print, Socket _cSocket, int _uptime) - { - if (command.startsWith("debug") && (command.length() > 6)) - { - final StringTokenizer st = new StringTokenizer(command.substring(6)); - // TODO: Rewrite to use ARM. - FileOutputStream fos = null; - OutputStreamWriter out = null; - try - { - final String dbg = st.nextToken(); - - if (dbg.equals("decay")) - { - _print.print(DecayTaskManager.getInstance().toString()); - } - else if (dbg.equals("packetsend")) - { - if (st.countTokens() < 2) - { - _print.println("Usage: debug packetsend "); - return false; - } - final String charName = st.nextToken(); - final L2PcInstance targetPlayer = L2World.getInstance().getPlayer(charName); - - if (targetPlayer == null) - { - _print.println("Player " + charName + " cannot be found online"); - return false; - } - - final AdminForgePacket sp = new AdminForgePacket(); - while (st.hasMoreTokens()) - { - final String b = st.nextToken(); - if (!b.isEmpty()) - { - sp.addPart("C".getBytes()[0], "0x" + b); - } - } - - targetPlayer.sendPacket(sp); - _print.println("Packet sent to player " + charName); - } - else if (dbg.equals("full")) - { - final Calendar cal = Calendar.getInstance(); - final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); - - final StringBuilder sb = new StringBuilder(); - sb.append(sdf.format(cal.getTime())); - sb.append("\n\n"); - uptime = _uptime; - sb.append(getServerStatus()); - sb.append("\n\n"); - sb.append("\n## Java Platform Information ##"); - sb.append("\nJava Runtime Name: " + System.getProperty("java.runtime.name")); - sb.append("\nJava Version: " + System.getProperty("java.version")); - sb.append("\nJava Class Version: " + System.getProperty("java.class.version")); - sb.append('\n'); - sb.append("\n## Virtual Machine Information ##"); - sb.append("\nVM Name: " + System.getProperty("java.vm.name")); - sb.append("\nVM Version: " + System.getProperty("java.vm.version")); - sb.append("\nVM Vendor: " + System.getProperty("java.vm.vendor")); - sb.append("\nVM Info: " + System.getProperty("java.vm.info")); - sb.append('\n'); - sb.append("\n## OS Information ##"); - sb.append("\nName: " + System.getProperty("os.name")); - sb.append("\nArchiteture: " + System.getProperty("os.arch")); - sb.append("\nVersion: " + System.getProperty("os.version")); - sb.append('\n'); - sb.append("\n## Runtime Information ##"); - sb.append("\nCPU Count: " + Runtime.getRuntime().availableProcessors()); - sb.append("\nCurrent Free Heap Size: " + (Runtime.getRuntime().freeMemory() / 1024 / 1024) + " mb"); - sb.append("\nCurrent Heap Size: " + (Runtime.getRuntime().totalMemory() / 1024 / 1024) + " mb"); - sb.append("\nMaximum Heap Size: " + (Runtime.getRuntime().maxMemory() / 1024 / 1024) + " mb"); - - sb.append('\n'); - sb.append("\n## Class Path Information ##\n"); - final String cp = System.getProperty("java.class.path"); - final String[] libs = cp.split(File.pathSeparator); - for (String lib : libs) - { - sb.append(lib); - sb.append('\n'); - } - - sb.append('\n'); - sb.append("## Threads Information ##\n"); - final Map allThread = Thread.getAllStackTraces(); - - final List> entries = new ArrayList<>(allThread.entrySet()); - Collections.sort(entries, (e1, e2) -> e1.getKey().getName().compareTo(e2.getKey().getName())); - - for (Entry entry : entries) - { - final StackTraceElement[] stes = entry.getValue(); - final Thread t = entry.getKey(); - sb.append("--------------\n"); - sb.append(t + " (" + t.getId() + ")\n"); - sb.append("State: " + t.getState() + '\n'); - sb.append("isAlive: " + t.isAlive() + " | isDaemon: " + t.isDaemon() + " | isInterrupted: " + t.isInterrupted() + '\n'); - sb.append('\n'); - for (StackTraceElement ste : stes) - { - sb.append(ste.toString()); - sb.append('\n'); - } - sb.append('\n'); - } - - sb.append('\n'); - final ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); - final long[] ids = findDeadlockedThreads(mbean); - if ((ids != null) && (ids.length > 0)) - { - final Thread[] threads = new Thread[ids.length]; - for (int i = 0; i < threads.length; i++) - { - threads[i] = findMatchingThread(mbean.getThreadInfo(ids[i])); - } - sb.append("Deadlocked Threads:\n"); - sb.append("-------------------\n"); - for (Thread thread : threads) - { - System.err.println(thread); - for (StackTraceElement ste : thread.getStackTrace()) - { - sb.append("\t" + ste); - sb.append('\n'); - } - } - } - - sb.append("\n\n## Thread Pool Manager Statistics ##\n"); - for (String line : ThreadPool.getStats()) - { - sb.append(line); - sb.append('\n'); - } - - int i = 0; - File f = new File("./log/Debug-" + i + ".txt"); - while (f.exists()) - { - i++; - f = new File("./log/Debug-" + i + ".txt"); - } - f.getParentFile().mkdirs(); - fos = new FileOutputStream(f); - out = new OutputStreamWriter(fos, "UTF-8"); - out.write(sb.toString()); - out.flush(); - out.close(); - fos.close(); - - _print.println("Debug output saved to log/" + f.getName()); - _print.flush(); - } - } - catch (Exception e) - { - } - finally - { - try - { - if (out != null) - { - out.close(); - } - } - catch (Exception e) - { - } - - try - { - if (fos != null) - { - fos.close(); - } - } - catch (Exception e) - { - } - } - - } - return false; - } - - private long[] findDeadlockedThreads(ThreadMXBean mbean) - { - // JDK 1.5 only supports the findMonitorDeadlockedThreads() - // method, so you need to comment out the following three lines - if (mbean.isSynchronizerUsageSupported()) - { - return mbean.findDeadlockedThreads(); - } - return mbean.findMonitorDeadlockedThreads(); - } - - private Thread findMatchingThread(ThreadInfo inf) - { - for (Thread thread : Thread.getAllStackTraces().keySet()) - { - if (thread.getId() == inf.getThreadId()) - { - return thread; - } - } - throw new IllegalStateException("Deadlocked Thread not found"); - } - - public String getServerStatus() - { - int playerCount = 0, objectCount = 0; - final int max = LoginServerThread.getInstance().getMaxPlayer(); - - playerCount = L2World.getInstance().getAllPlayersCount(); - objectCount = L2World.getInstance().getVisibleObjectsCount(); - - int itemCount = 0; - int itemVoidCount = 0; - int monsterCount = 0; - int minionCount = 0; - int minionsGroupCount = 0; - int npcCount = 0; - int charCount = 0; - int pcCount = 0; - int detachedCount = 0; - int doorCount = 0; - int summonCount = 0; - int AICount = 0; - - for (L2Object obj : L2World.getInstance().getVisibleObjects()) - { - if (obj == null) - { - continue; - } - if (obj instanceof L2Character) - { - if (((L2Character) obj).hasAI()) - { - AICount++; - } - } - if (obj instanceof L2ItemInstance) - { - if (((L2ItemInstance) obj).getItemLocation() == ItemLocation.VOID) - { - itemVoidCount++; - } - else - { - itemCount++; - } - } - else if (obj instanceof L2MonsterInstance) - { - monsterCount++; - if (((L2MonsterInstance) obj).hasMinions()) - { - minionCount += ((L2MonsterInstance) obj).getMinionList().countSpawnedMinions(); - minionsGroupCount += ((L2MonsterInstance) obj).getMinionList().lazyCountSpawnedMinionsGroups(); - } - } - else if (obj instanceof L2Npc) - { - npcCount++; - } - else if (obj instanceof L2PcInstance) - { - pcCount++; - if ((((L2PcInstance) obj).getClient() != null) && ((L2PcInstance) obj).getClient().isDetached()) - { - detachedCount++; - } - } - else if (obj instanceof L2Summon) - { - summonCount++; - } - else if (obj instanceof L2DoorInstance) - { - doorCount++; - } - else if (obj instanceof L2Character) - { - charCount++; - } - } - final StringBuilder sb = new StringBuilder(); - sb.append("Server Status: "); - sb.append("\r\n ---> Player Count: " + playerCount + "/" + max); - sb.append("\r\n ---> Offline Count: " + detachedCount + "/" + playerCount); - sb.append("\r\n +--> Object Count: " + objectCount); - sb.append("\r\n +--> AI Count: " + AICount); - sb.append("\r\n +.... L2Item(Void): " + itemVoidCount); - sb.append("\r\n +.......... L2Item: " + itemCount); - sb.append("\r\n +....... L2Monster: " + monsterCount); - sb.append("\r\n +......... Minions: " + minionCount); - sb.append("\r\n +.. Minions Groups: " + minionsGroupCount); - sb.append("\r\n +........... L2Npc: " + npcCount); - sb.append("\r\n +............ L2Pc: " + pcCount); - sb.append("\r\n +........ L2Summon: " + summonCount); - sb.append("\r\n +.......... L2Door: " + doorCount); - sb.append("\r\n +.......... L2Char: " + charCount); - sb.append("\r\n ---> Ingame Time: " + gameTime()); - sb.append("\r\n ---> Server Uptime: " + getUptime(uptime)); - sb.append("\r\n ---> GM Count: " + getOnlineGMS()); - sb.append("\r\n ---> Threads: " + Thread.activeCount()); - sb.append("\r\n RAM Used: " + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576)); // 1024 * 1024 = 1048576 - sb.append("\r\n"); - - return sb.toString(); - } - - private int getOnlineGMS() - { - return AdminData.getInstance().getAllGms(true).size(); - } - - private String getUptime(int time) - { - int uptime = (int) System.currentTimeMillis() - time; - uptime = uptime / 1000; - final int h = uptime / 3600; - final int m = (uptime - (h * 3600)) / 60; - final int s = ((uptime - (h * 3600)) - (m * 60)); - return h + "hrs " + m + "mins " + s + "secs"; - } - - private String gameTime() - { - final int t = GameTimeController.getInstance().getGameTime(); - final int h = t / 60; - final int m = t % 60; - final SimpleDateFormat format = new SimpleDateFormat("H:mm"); - final Calendar cal = Calendar.getInstance(); - cal.set(Calendar.HOUR_OF_DAY, h); - cal.set(Calendar.MINUTE, m); - return format.format(cal.getTime()); - } - - @Override - public String[] getCommandList() - { - return _commands; - } -} diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/HelpHandler.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/HelpHandler.java deleted file mode 100644 index 4a583ea5f5..0000000000 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/telnethandlers/HelpHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * 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 . - */ -package handlers.telnethandlers; - -import java.io.PrintWriter; -import java.net.Socket; - -import com.l2jmobius.gameserver.handler.ITelnetHandler; - -/** - * @author UnAfraid - */ -public class HelpHandler implements ITelnetHandler -{ - private final String[] _commands = - { - "help" - }; - - @Override - public boolean useCommand(String command, PrintWriter _print, Socket _cSocket, int _uptime) - { - if (command.equals("help")) - { - _print.println("The following is a list of all available commands: "); - _print.println("help - shows this help."); - _print.println("status - displays basic server statistics."); - _print.println("gamestat privatestore - displays info about stores"); - _print.println("performance - shows server performance statistics."); - _print.println("forcegc - forced garbage collection."); - _print.println("purge - removes finished threads from thread pools."); - _print.println("memusage - displays memory amounts in JVM."); - _print.println("announce - announces in game."); - _print.println("msg - Sends a whisper to char with ."); - _print.println("gmchat - Sends a message to all GMs with ."); - _print.println("gmlist - lists all gms online."); - _print.println("kick - kick player from server."); - _print.println("shutdown