Jump to content
  • 0

Problem with a bug.


Joκκєrino

Question

Hello community . As you know , there is a bug on L2jFrozen . If admin set to color clan leader title , you can make all players of this clan to have the same title by changing the clan leader .

 

Exemple : I am Leader . I have green color and then i change clan leader . After changing i'm not leader but i have green title color . My friend gonna give my clan back and then he will have green title color too as me , but he's not clan leader .

 

I tryied fix it and i successed.

 

 

                                L2jFrozen Code 

// Apply color settings to clan leader when entering  
	if (activeChar.getClan() != null && activeChar.isClanLeader() && Config.CLAN_LEADER_COLOR_ENABLED && activeChar.getClan().getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
	{
		if (Config.CLAN_LEADER_COLORED == 1)
			activeChar.getAppearance().setNameColor(Config.CLAN_LEADER_COLOR);
		else
			activeChar.getAppearance().setTitleColor(Config.CLAN_LEADER_COLOR);
	}

                   MY EDIT ADDED .
	if(activeChar.getClan() != null )
		if(!activeChar.isClanLeader())
			activeChar.getAppearance().setTitleColor(Config.CLAN_NOLEADER_COLOR);

 

But that's not really good , cuz player must restart to change his title color from "green"(Config.CLAN_LEADER_COLOR) to "white"Config.CLAN_NOLEADER_COLOR). Can you tell me how i can kill connection ? In moment when clan leader is changed , last clan leader to be kicked , not actually .

 

Sorry for my english ... :D But i hope you understand what i'm writing

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Hello community . As you know , there is a bug on L2jFrozen . If admin set to color clan leader title , you can make all players of this clan to have the same title by changing the clan leader .

 

Exemple : I am Leader . I have green color and then i change clan leader . After changing i'm not leader but i have green title color . My friend gonna give my clan back and then he will have green title color too as me , but he's not clan leader .

 

I tryied fix it and i successed.

 

 

                                L2jFrozen Code 

// Apply color settings to clan leader when entering  
	if (activeChar.getClan() != null && activeChar.isClanLeader() && Config.CLAN_LEADER_COLOR_ENABLED && activeChar.getClan().getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
	{
		if (Config.CLAN_LEADER_COLORED == 1)
			activeChar.getAppearance().setNameColor(Config.CLAN_LEADER_COLOR);
		else
			activeChar.getAppearance().setTitleColor(Config.CLAN_LEADER_COLOR);
	}

                   MY EDIT ADDED .
	if(activeChar.getClan() != null )
		if(!activeChar.isClanLeader())
			activeChar.getAppearance().setTitleColor(Config.CLAN_NOLEADER_COLOR);

 

But that's not really good , cuz player must restart to change his title color from "green"(Config.CLAN_LEADER_COLOR) to "white"Config.CLAN_NOLEADER_COLOR). Can you tell me how i can kill connection ? In moment when clan leader is changed , last clan leader to be kicked , not actually .

 

Sorry for my english ... :D But i hope you understand what i'm writing

 

 

 

    MY EDIT ADDED .

if(activeChar.getClan() != null )

if(!activeChar.isClanLeader())

-activeChar.getAppearance().setTitleColor(Config.CLAN_NOLEADER_COLOR);

                    +activeChar.getAppearance().setTitleColor(0xFFFFFF);

 

Link to comment
Share on other sites

  • 0

 

    MY EDIT ADDED .

if(activeChar.getClan() != null )

if(!activeChar.isClanLeader())

-activeChar.getAppearance().setTitleColor(Config.CLAN_NOLEADER_COLOR);

 

 

                    +activeChar.getAppearance().setTitleColor(0xFFFFFF);

 

 

 

Buddy , i already finished problem with bug , now i just want to kick last leader after changing leader

Link to comment
Share on other sites

  • 0

I don't know how l2jfrozen does clans but from the default interlude in L2Clan.java you could use this function after doing that crap.

 

public void removeClanMember(String name, long clanJoinExpiryTime)

 

 

Link to comment
Share on other sites

  • 0

I don't know how l2jfrozen does clans but from the default interlude in L2Clan.java you could use this function after doing that crap.

 

public void removeClanMember(String name, long clanJoinExpiryTime)

 

 

 

it's not about kicking him , just close his connection ( lineage 2 screen ).

Link to comment
Share on other sites

  • 0

it's not about kicking him , just close his connection ( lineage 2 screen ).

 

why do you want to close his connection? I don't really see the logic in that but, alright. What you can do is turn on the debugger, freeze your L2PcInstance and see what happens when you trigger a disconnect, perhaps there is a player disconnect function somewhere.

Link to comment
Share on other sites

  • 0

Hi, but about this, I can say, what I have been searching for leader color name changing, and I saw what, leaders name color is changing only when leader is crossing packet Enterworld (or in other words, he is starting playing) and then clan is destroying. But I didn't saw what clan leader color is changing, for example, when he creates the clan, or changes leader. So we can think like this:

Add these:

		if (Config.CLAN_LEADER_COLOR_ENABLED && getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
		{
			exLeader.getAppearance().setNameColor(0x000000);
			exLeader.getAppearance().setTitleColor(0x9900CC);
			exLeader.updateNameTitleColor();
		}

Below these:

public boolean setLeader(L2ClanMember member)
{
	if(member==null){
		return false;
	}

	L2ClanMember old_leader = _leader;
	_leader = member;
	_members.put(member.getName(), member);

	//refresh oldleader and new leader info
	if(old_leader!=null){

		L2PcInstance exLeader = old_leader.getPlayerInstance();
		exLeader.setClan(this);
		exLeader.setPledgeClass(exLeader.getClan().getClanMember(exLeader.getObjectId()).calculatePledgeClass(exLeader));
		exLeader.setClanPrivileges(L2Clan.CP_NOTHING);

And then, these:

		if (Config.CLAN_LEADER_COLOR_ENABLED && getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
		{
			if (Config.CLAN_LEADER_COLORED == 1)
				newLeader.getAppearance().setNameColor(Config.CLAN_LEADER_COLOR);
			else
				newLeader.getAppearance().setTitleColor(Config.CLAN_LEADER_COLOR);
			newLeader.updateNameTitleColor();
		}

Below these:

	updateClanInDB();


	if(member.getPlayerInstance()!=null){

		L2PcInstance newLeader = member.getPlayerInstance();
		newLeader.setClan(this);
		newLeader.setPledgeClass(member.calculatePledgeClass(newLeader));
		newLeader.setClanPrivileges(L2Clan.CP_ALL);

 

P.s. Sorry, I haven't finded good project with svn, so I couldn't put patch.

P.s.s. All this change is in L2Clan.java / setLeader method.

P.s.s.s. Sorry for bad English. :)

Link to comment
Share on other sites

  • 0

main thing:

exLeader.updateNameTitleColor();

But without these:

				exLeader.getAppearance().setNameColor(0x000000);
			exLeader.getAppearance().setTitleColor(0x9900CC);

You have nothing to update...  :-X

Link to comment
Share on other sites

  • 0

you set the colors, but you will not see them if you dont send some update packet to the client, that why the client still see the old colors, usualy its:

 

sendPacket(new ShortBuffStatusUpdate(0, 0, 0));

type

for example

 

but that function looks like it does send the packet inside it, check it, and if its ot doing it, the find what packet you need to send and send it

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
Answer this question...

×   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

    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore1 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11
    • L2 ArenaWar: Low Rate PvP Server with Free Buffs & Autofarm [PVP]⚔️ [Free]🆓 Classic Interlude with  3x XP rates! Free starter pack(no grade) to kickstart your adventure! Autofarm for convenient grinding! Free buffs to keep you fighting fit! (2 job buffs) No experience loss on death! (Except with Karma) Clear Karma system to keep things fair! ⚖️ Active community of 800-1k players! Join our Discord to learn more! >> Discord <<     Server website: https://l2arenawar.com/en/    
    • This is dedication! 2 years working on a problem. Congratulations!
    • You indeed have to save player position over Enterworld to properly clean it up later (if you don't, even trying to delete packet content would eventually keep it up), that's what we do with debug packet (which is a reusable Map of ExServerPrimitive packets) on aCis.   It doesn't solve the FPS stuttering - more you draw/delete lines, more your client becomes laggy. It's like if client wasn't deleting drawn points/lines properly, but instead simply hide them and redrawn content above.   If you got a solution, I would happy to integrate it.   You should check aCis#Player _debug packet integration, it allows very big amount of lines/points to be drawn, it is also reusable.   https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java?ref_type=heads https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java?ref_type=heads  
    • we sell website templates, make websites to order. Great selection at very good prices. My contacts discord : advert1231 telegram : https://t.me/ggwpins  
  • Topics

×
×
  • Create New...