Jump to content

Recommended Posts

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Dear players, Open beta test for C3 begins today at 19:00 server time (GMT +2). 💰 All participants who find bugs during OBT will be rewarded with Coin of Luck (CoL): - 1 CoL for each staticmesh issue found — e.g., walking through textures, etc., - 2 CoL or more for server-side issues, depending on their severity., We strongly recommend reviewing the quest list - when switching to Chronicle 3, the total number of quests should match the number shown in the upper right corner of the window and correspond to the quest count from Chronicle 2. To log into the game, use the same data you use to access the Airin server. 📌 Download client: Google Drive
    • 🔥 Sale Alert! 🔥 Twitter Accounts with 50 Followers — now on SALE! Looking to launch a project or warm up your account base fast? We’ve got starter Twitter accounts with ~50 followers at a sweet price. 💰 Limited-time offer – while stock lasts! ✅ Organic-Looking ✅ Clean & Safe ✅ Perfect for boosting credibility 📦 Instant delivery
    • Dear friends, right now we are holding a grand competition with a prize fund of more than $ 1000 in our stores https://socnet.store , telegram store: https://socnet.shop and SMM panel: https://socnet.pro There are more than 50 prize places in our competition, each lucky person can take one of the places. Important condition: you must make a purchase at any time before June 1, 2025. The more purchases you make - the more chances you have to win the main prize in the community of $ 300! ➡ Our Online Shop: socnet.store  ➡ Our SMM-Boosting Panel: socnet.pro  ➡ Telegram Shop Bot: socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: 79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • Dear friends, right now we are holding a grand competition with a prize fund of more than $ 1000 in our stores https://socnet.store , telegram store: https://socnet.shop and SMM panel: https://socnet.pro There are more than 50 prize places in our competition, each lucky person can take one of the places. Important condition: you must make a purchase at any time before June 1, 2025. The more purchases you make - the more chances you have to win the main prize in the community of $ 300! ➡ Our Online Shop: socnet.store  ➡ Our SMM-Boosting Panel: socnet.pro  ➡ Telegram Shop Bot: socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: 79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock