Jump to content

Online Players Up Right On The Screen.


Recommended Posts

Hello , First of all i used as subject Preview and share , cause first i will show you some pic and later today will upload the java codes + client part .

 

The bad think on this , is that you couldnt use pcbang , actually you can but they will not get the V iew of points on the right side. You can make an external npc witch will show them their points and etC.

 

Lets take a look (PICTURES):

First

Second

 

And here a small video:

[MXC]FovosOTrelos Java Online On Screen

 

Its nothing special , but i didnt have what to do and was playing with serverpackets :P

 

-Client Side-

 

sysstring-e.dat

1274	Forced Petition
1275	Server Transfer
1276	- Selection -
-1277	PC Bang Points
+1277   Online Players
1278	One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten

systemmsg-e.dat

1704	1	Please close the the setup window for your private manufacturing store or private store, and try again.	0	79	9B	B0	FF			0	0	0	0	0		none
-1705	1	PC Bang Points acquisition period. Points acquisition period left $s1 hour.	0	79	9B	B0	FF			0	0	0	0	0		none
-1706	1	PC Bang Points use period. Points use period left $s1 hour.	0	79	9B	B0	FF			0	0	0	0	0		none
-1707	1	You acquired $s1 PC Bang Point.	0	79	9B	B0	FF		
0	0	0	0	0		none
+1705	1	It Shows Online Players Count ATM.	0	79	9B	B0	FF			0	0	0	0	0		none
+1706	1	It Shows Online Players Count ATM.	0	79	9B	B0	FF			0	0	0	0	0		none
+1707	1	It Shows Online Players Count ATM.	0	79	9B	B0	FF			0	0	0	0	0		none

DOWNLOAD CLIENT FILES : LINK

 

-Server Side-

Index: config/fun/pcBang.properties
===================================================================
--- config/fun/pcBang.properties	(revision 13)
+++ config/fun/pcBang.properties	(revision 16)
@@ -5,7 +5,7 @@
# Pc Bang Point are special points, XML id= 65436
# Enable PC Bang Point Event.
# Default: False
-PcBangPointEnable = True
+PcBangPointEnable = False

# Min Player Level.
# Default: 20
Index: config/frozen/frozen.properties
===================================================================
--- config/frozen/frozen.properties	(revision 13)
+++ config/frozen/frozen.properties	(revision 16)
@@ -31,4 +31,8 @@

# New players get fireworks the first time they log in
# Default: False
-NewPlayerEffect = True
\ No newline at end of file
+NewPlayerEffect = True
+
+# It will show at right side in a box of pcbang 
+# The number of online players.
+EnableOnlineRightSide = True
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/ExOnlineInfo.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/serverpackets/ExOnlineInfo.java	(revision 0)
+++ head-src/com/l2jfrozen/gameserver/network/serverpackets/ExOnlineInfo.java	(revision 16)
@@ -0,0 +1,33 @@
+package com.l2jfrozen.gameserver.network.serverpackets;
+
+import com.l2jfrozen.gameserver.model.L2World;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+
+
+public class ExOnlineInfo extends L2GameServerPacket
+{
+	/** The Constant _S__FE_31_EXPCCAFEPOINTINFO. */
+	private static final String _S__FE_31_EXPCCAFEPOINTINFO = "[s] FE:31 ExOnlineInfo";
+
+	
+	public ExOnlineInfo()
+	{}
+	
+	@Override
+	protected void writeImpl()
+	{
+		writeC(0xFE);
+		writeH(0x31);
+		writeD(L2World.getInstance().getAllPlayers().size());
+		writeD(1);
+		writeC(1);
+		writeD(1);
+		writeC(1);
+	}
+
+	@Override
+	public String getType()
+	{
+		return _S__FE_31_EXPCCAFEPOINTINFO;
+	}
+}
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java	(revision 13)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java	(revision 16)
@@ -20,6 +20,7 @@
import com.l2jfrozen.gameserver.communitybbs.Manager.RegionBBSManager;
import com.l2jfrozen.gameserver.datatables.SkillTable;
import com.l2jfrozen.gameserver.model.L2Party;
+import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
import com.l2jfrozen.gameserver.model.entity.sevensigns.SevenSignsFestival;
@@ -132,6 +133,13 @@

		RegionBBSManager.getInstance().changeCommunityBoard();
		player.deleteMe();
+		
+		if(Config.ONLINE_RIGHT){
+			for(L2PcInstance playr : L2World.getInstance().getAllPlayers())
+			{
+				playr.showOnlinesWindow();
+			}
+		}
	}

	@Override
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(revision 13)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(revision 16)
@@ -330,6 +330,14 @@

		if (Config.PCB_ENABLE)
			activeChar.showPcBangWindow();
+		
+		if(Config.ONLINE_RIGHT){
+			for(L2PcInstance player : L2World.getInstance().getAllPlayers())
+			{
+				player.showOnlinesWindow();
+			}
+		}
+	

		if (Config.ANNOUNCE_CASTLE_LORDS)
				notifyCastleOwner(activeChar);
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java	(revision 13)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java	(revision 16)
@@ -26,6 +26,7 @@
import com.l2jfrozen.gameserver.datatables.SkillTable;
import com.l2jfrozen.gameserver.model.Inventory;
import com.l2jfrozen.gameserver.model.L2Party;
+import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
import com.l2jfrozen.gameserver.model.entity.sevensigns.SevenSignsFestival;
@@ -160,6 +161,7 @@
			player.onTradeCancel(player.getActiveRequester());
		}

+		
		// Check if player are flying
		if(player.isFlying())
		{
@@ -205,6 +207,13 @@
		CharSelectInfo cl = new CharSelectInfo(client.getAccountName(), client.getSessionId().playOkID1);
		sendPacket(cl);
		client.setCharSelection(cl.getCharInfo());
+		
+		if(Config.ONLINE_RIGHT){
+			for(L2PcInstance playr : L2World.getInstance().getAllPlayers())
+			{
+				playr.showOnlinesWindow();
+			}
+		}
	}

	@Override
Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java	(revision 13)
+++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java	(revision 16)
@@ -166,6 +166,7 @@
import com.l2jfrozen.gameserver.network.serverpackets.ExFishingStart;
import com.l2jfrozen.gameserver.network.serverpackets.ExOlympiadMode;
import com.l2jfrozen.gameserver.network.serverpackets.ExOlympiadUserInfo;
+import com.l2jfrozen.gameserver.network.serverpackets.ExOnlineInfo;
import com.l2jfrozen.gameserver.network.serverpackets.ExPCCafePointInfo;
import com.l2jfrozen.gameserver.network.serverpackets.ExSetCompassZoneCode;
import com.l2jfrozen.gameserver.network.serverpackets.FriendList;
@@ -18267,6 +18268,13 @@
		ExPCCafePointInfo wnd = new ExPCCafePointInfo(this, 0, false, 24, false);
		sendPacket(wnd);
	}
+	public void showOnlinesWindow()
+	{
+		/*user, int modify, boolean add, int hour, boolean _double) **/
+	
+		ExOnlineInfo wnd = new ExOnlineInfo();
+		sendPacket(wnd);
+	}

	/**
	 * String to hex.
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java	(revision 13)
+++ head-src/com/l2jfrozen/Config.java	(revision 16)
@@ -2124,6 +2124,7 @@
	public static String PM_TEXT1;
	public static String PM_TEXT2;
	public static boolean NEW_PLAYER_EFFECT;
+	public static boolean ONLINE_RIGHT;


	//============================================================
@@ -2138,6 +2139,7 @@
			frozenSettings.load(is);
			is.close();

+			ONLINE_RIGHT = Boolean.parseBoolean(frozenSettings.getProperty("EnableOnlineRightSide", "True"));
	       	TRANSFORM_PK      = Boolean.parseBoolean(frozenSettings.getProperty("EnableTransformPK", "False"));
	        TRANSFORM_NPC_ID             = frozenSettings.getProperty("TransformNPCID", "14040");
	       	TRANSFORM_NPC_NAME           = frozenSettings.getProperty("TransformNPCName", "Zombie");		

 

DIFF FILE

 

Credits : Goes to me :)

Link to comment
Share on other sites

its looks cool, my question is, what files did u change in client to change pc bang points to online players and what is wrote in "?"? :)

Link to comment
Share on other sites

its looks cool, my question is, what files did u change in client to change pc bang points to online players and what is wrote in "?"? :)

Thanks for good feedback , I fixed the bipping part..

You can change whatever is related with l2 client by modify sysstring-e.dat with file edit.

Its kinda cool , I changed even the front start of l2 . Example " named log in to connect , ID and PWD to username , password .

Link to comment
Share on other sites

Looks prety nice, most of servers(as i know) don't use PCBang so... it already is useless and can be replaced with online players.

 

Waiting for codes :P

Thanks , Yes i had the same thoughts about the pcbang thats why i used for greater purpuse :) .

 

Uploaded , I did some tests and working perfectly .

If you have any ussues pm me.

Link to comment
Share on other sites

I see many thing which are extra

 

public class ExOnlineInfo extends L2GameServerPacket

+{

+ /** The Constant _S__FE_31_EXPCCAFEPOINTINFO. */

+ private static final String _S__FE_31_EXPCCAFEPOINTINFO = " FE:31 ExPCCafePointInfo";

+

+ /** The _character. */

+ private L2PcInstance _character;

+ /** The m_ add point. */

+ private int m_AddPoint;

+

+ /** The m_ period type. */

+ private int m_PeriodType;

+

+ /** The Remain time. */

+ private int RemainTime;

+

+ /** The Point type. */

+ private int PointType;

+

+ /**

+ * Instantiates a new ex pc cafe point info.

+ *

+ * @param user the user

+ * @param modify the modify

+ * @param add the add

+ * @param hour the hour

+ * @param _double the _double

+ */

+ public ExOnlineInfo(L2PcInstance user, int modify, boolean add, boolean _double)

+ {

+ _character = user;

+ m_AddPoint = modify;

+ m_PeriodType = 1;

+ PointType = 1;

+

+ RemainTime = 24;

+ }

+

+ @Override

+ protected void writeImpl()

+ {

+ writeC(0xFE);

+ writeH(0x31);

+ writeD(L2World.getInstance().getAllPlayers().size());

+ writeD(m_AddPoint);

+ writeC(m_PeriodType);

+ writeD(RemainTime);

+ writeC(PointType);

+ }

+

+ /**

+ * Gets the type.

+ *

+ * @return the type

+ */

+ @Override

+ public String getType()

+ {

+ return _S__FE_31_EXPCCAFEPOINTINFO;

+ }

+}

 

It can't be done without them?

Link to comment
Share on other sites

I see many thing which are extra

 

It can't be done without them?

I didnt tested without some writeC/D . I will make a clean up later and test if it works .

But as writeD/C/H is based on server / client communication i hope ncsoft didnt set a rule witch requires all of those , you know what i mean . Like phx when you send an packet if it doesnt contain all the data witch client need to process it will fail.

 

Anyway , an update will be done until tommorow.

Link to comment
Share on other sites

Soo... If we just replace PcBang Points with Online players will not it be better not to create ExOnlineInfo and just do this:

 

Index: net/sf/l2j/gameserver/network/serverpackets/ExPCCafePointInfo.java
package com.l2jfrozen.gameserver.network.serverpackets;

import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.L2World;

@
	writeC(0xFE);
	writeH(0x31);
-		writeD(_character.getPcBangScore());
+              writeD(L2World.getInstance().getAllPlayers().size());
	writeD(m_AddPoint);
	writeC(m_PeriodType);
	writeD(RemainTime);
	writeC(PointType);

Link to comment
Share on other sites

Soo... If we just replace PcBang Points with Online players will not it be better not to create ExOnlineInfo and just do this:

 

Index: net/sf/l2j/gameserver/network/serverpackets/ExPCCafePointInfo.java
	writeC(0xFE);
	writeH(0x31);
-		writeD(_character.getPcBangScore());
+              writeD(L2World.getInstance().getAllPlayers().size());
	writeD(m_AddPoint);
	writeC(m_PeriodType);
	writeD(RemainTime);
	writeC(PointType);

Nope , I dont want to change anything that exists , At my topic i said that pcbang can exist with online players together.

So we need both serverpackets to do that.

Link to comment
Share on other sites

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.




×
×
  • 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