Party invitation button

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Nerimah
Posts: 76
Joined: Mon May 02, 2011 10:19 am
Location: Paris, France
Contact:

Party invitation button

Post by Nerimah »

Hello,

I'm trying to improve players profile inside the community board -> region when we click on player's name.
I would like to create a button in each player profile to invite him in party/clan or friend but cannot find the right functions to do that.

So far I have this inside RegionBBSManager.java:

Code: Select all

StringUtil.append(htmlCode, "<td align=center width=30%><button value=\"Invite\" width=40 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\" action=\"bypass _bbslocparty;", name, "\"></td>");

Code: Select all

else if (command.startsWith("_bbslocparty;"))        {            StringTokenizer st = new StringTokenizer(command, ";");            st.nextToken();            String name = st.nextToken();                        activeChar.sendMessage("You invited " + name + " to party");            new RequestJoinParty();        }
When I click on the button, I receive the system message "You invited XXXX to party" but nothing more happens and the invitation is not sent. I guess new RequestJoinParty(); is not the right way to send the invitation...

I wish you can help me with this
French touch.
xban1x
L2j Veteran
L2j Veteran
Posts: 1228
Joined: Thu Jan 17, 2013 9:46 am

Re: Party invitation button

Post by xban1x »

Maybe send that packet to the actual player?
Nerimah
Posts: 76
Joined: Mon May 02, 2011 10:19 am
Location: Paris, France
Contact:

Re: Party invitation button

Post by Nerimah »

xban1x wrote:Maybe send that packet to the actual player?
How would you do that?
French touch.
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Party invitation button

Post by UnAfraid »

Code: Select all

activeChar.sendPacket(new RequestJoinParty());
Image
Nerimah
Posts: 76
Joined: Mon May 02, 2011 10:19 am
Location: Paris, France
Contact:

Re: Party invitation button

Post by Nerimah »

UnAfraid wrote:activeChar.sendPacket(new RequestJoinParty());
RequestJoinParty() is not a L2GameServerPacket but a L2GameClientPacket and i get this error message on SendPacket:

Code: Select all

 The method sendPacket(L2GameServerPacket) in the type L2PcInstance is not applicable for the arguments (RequestJoinParty)
French touch.
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Party invitation button

Post by UnAfraid »

Nerimah wrote:
UnAfraid wrote:activeChar.sendPacket(new RequestJoinParty());
RequestJoinParty() is not a L2GameServerPacket but a L2GameClientPacket and i get this error message on SendPacket:

Code: Select all

 The method sendPacket(L2GameServerPacket) in the type L2PcInstance is not applicable for the arguments (RequestJoinParty)
Oh because that's client packet not server packet.
Check it's logic com.l2jserver.gameserver.network.clientpackets.RequestJoinParty
You must do bunch of checks otherwise you'll open huge vulnerability.
Image
Nerimah
Posts: 76
Joined: Mon May 02, 2011 10:19 am
Location: Paris, France
Contact:

Re: Party invitation button

Post by Nerimah »

I will try to create a function copying all the checks inside RequestJoinParty and which will send the invitation.
Copy/paste is my best weapon ;>

I'll update this post later, thanks for help
French touch.
Nerimah
Posts: 76
Joined: Mon May 02, 2011 10:19 am
Location: Paris, France
Contact:

Re: Party invitation button

Post by Nerimah »

Nerimah wrote:I will try to create a function copying all the checks inside RequestJoinParty and which will send the invitation.
This worked like a charm, problem solved
French touch.
Post Reply