ServeSATAN Posted August 31, 2010 Posted August 31, 2010 Hello.today i decide to create something usefull and i create extended online command. when you type .online you can see online players online good players and evil players(if you have GvE system) online hero players online noblesse players online donator players. Credits to me. Index: lt/equal/gameserver/handler/voicedcommandhandlers/OnlinePlayers.java =================================================================== --- lt/equal/gameserver/handler/voicedcommandhandlers/OnlinePlayers.java (revision 68) +++ lt/equal/gameserver/handler/voicedcommandhandlers/OnlinePlayers.java (working copy) @@ -1,6 +1,7 @@ package lt.equal.gameserver.handler.voicedcommandhandlers; import java.sql.PreparedStatement; +import lt.equal.Config; import lt.equal.L2DatabaseFactory; import lt.equal.gameserver.network.L2GameClient; import lt.equal.gameserver.handler.IVoicedCommandHandler; @@ -20,6 +21,14 @@ if(command.equals("online")) { activeChar.sendMessage("Online Players: " + L2World.getInstance().getAllPlayersCount()); + if (Config.MOD_GVE_ENABLE_FACTION) + { + activeChar.sendMessage("Good Players: " + L2World.getInstance().getAllgoodPlayersCount()); + activeChar.sendMessage("Evil Players: " + L2World.getInstance().getAllevilPlayersCount()); + } + activeChar.sendMessage("Hero Players: " + L2World.getInstance().getAllheroPlayersCount()); + activeChar.sendMessage("Noblesse Players: " + L2World.getInstance().getAllnoblesPlayersCount()); + activeChar.sendMessage("Donator Players: " + L2World.getInstance().getAlldonatorPlayersCount()); } return true; } Index: lt/equal/gameserver/model/L2World.java =================================================================== --- lt/equal/gameserver/model/L2World.java (revision 68) +++ lt/equal/gameserver/model/L2World.java (working copy) @@ -65,6 +65,9 @@ private Map<String, L2PcInstance> _allPlayers; private Map<String, L2PcInstance> _allgoodPlayers; private Map<String, L2PcInstance> _allevilPlayers; + private Map<String, L2PcInstance> _allheroPlayers; + private Map<String, L2PcInstance> _allnoblesPlayers; + private Map<String, L2PcInstance> _alldonatorPlayers; /** L2ObjectHashMap(L2Object) containing all visible objects */ private L2ObjectMap<L2Object> _allObjects; @@ -86,6 +89,9 @@ _allPlayers = new FastMap<String, L2PcInstance>().setShared(true); _allgoodPlayers = new FastMap<String, L2PcInstance>().setShared(true); _allevilPlayers = new FastMap<String, L2PcInstance>().setShared(true); + _allheroPlayers = new FastMap<String, L2PcInstance>().setShared(true); + _allnoblesPlayers = new FastMap<String, L2PcInstance>().setShared(true); + _alldonatorPlayers = new FastMap<String, L2PcInstance>().setShared(true); _petsInstance = new FastMap<Integer, L2PetInstance>().setShared(true); _allObjects = L2ObjectMap.createL2ObjectMap(); @@ -248,7 +254,22 @@ { return _allevilPlayers.values(); } + + public Collection<L2PcInstance> getAllheroPlayers() + { + return _allheroPlayers.values(); + } + public Collection<L2PcInstance> getAllnoblesPlayers() + { + return _allnoblesPlayers.values(); + } + + public Collection<L2PcInstance> getAlldonatorPlayers() + { + return _alldonatorPlayers.values(); + } + /** * Return how many players are online.<BR> * <BR> @@ -269,7 +290,22 @@ { return _allevilPlayers.size(); } + + public int getAllheroPlayersCount() + { + return _allheroPlayers.size(); + } + public int getAllnoblesPlayersCount() + { + return _allnoblesPlayers.size(); + } + + public int getAlldonatorPlayersCount() + { + return _alldonatorPlayers.size(); + } + /** * Return the player instance corresponding to the given name.<BR> * <BR> @@ -419,6 +455,14 @@ _allevilPlayers.put(player.getName().toLowerCase(), player); } _allPlayers.put(player.getName().toLowerCase(), player); + if (((L2PcInstance) object).isHero()) + _allheroPlayers.put(player.getName().toLowerCase(), player); + + if (((L2PcInstance) object).isNoble()) + _allnoblesPlayers.put(player.getName().toLowerCase(), player); + + if (((L2PcInstance) object).isDonator()) + _alldonatorPlayers.put(player.getName().toLowerCase(), player); } // Get all visible objects contained in the _visibleObjects of L2WorldRegions
Nosti21 Posted August 31, 2010 Posted August 31, 2010 wow great share man. thanks for this. is your 100%??
ServeSATAN Posted August 31, 2010 Author Posted August 31, 2010 wow great share man. thanks for this. is your 100%?? yes it mine 100% idea it's mine and i created it too
xAddytzu Posted August 31, 2010 Posted August 31, 2010 wow great share man. thanks for this. is your 100%?? Indeed it's really hard.
[Geo]Sky Posted August 31, 2010 Posted August 31, 2010 Yes Its Very CooL For Gve Servers Nice Share Tnx Leki
Coyote™ Posted August 31, 2010 Posted August 31, 2010 The only thing among these that is in L2J by default is the Hero. Do you expect us all to have your source, where everything else is defined as well?
Xanadu Posted August 31, 2010 Posted August 31, 2010 This code work on ep ? Meybe add some screens, thanks for share
xAddytzu Posted August 31, 2010 Posted August 31, 2010 This code work on ep ? Meybe add some screens, thanks for share Screens ? Are you kidding us ?
Nosti21 Posted August 31, 2010 Posted August 31, 2010 Screens ? Are you kidding us ? he is just spaming man. let him. Indeed it's really hard. what you say?
xAddytzu Posted August 31, 2010 Posted August 31, 2010 he is just spaming man. let him.what you say? It was irony ...
mogo Posted September 1, 2010 Posted September 1, 2010 Shall i remind the rule about posting simple strings or stupid configs?
YouWishToKnowMyNick Posted September 1, 2010 Posted September 1, 2010 Sky" post="1342489" timestamp="1283285032"] Yes Its Very CooL For Gve Servers Nice Share Tnx Leki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now