Jump to content
metin2dev
Ekstasia2
Sign in to follow this  
Mali61

c++ Official Party Update

Recommended Posts

In official servers the party is the same in all channels, looking your code without touching the db src... you can delete Official from the title.

Share this post


Link to post
Share on other sites
6 minutes ago, Shang said:

In official servers the party is the same in all channels, looking your code without touching the db src... you can delete Official from the title.

What? 

Share this post


Link to post
Share on other sites

Thanks for share dude !

By the way, he means that your code is not like official as it's not reversed. He's just asking for a clarification in the title, such as "Party Update like Official" or just to remove "Official" in the title as it's just a recreation and not the official code.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for the share, but there is a bug with the system if you have party and you disconnect from both characters after when you login and one of the two characters are offline shows him online.

  • Like 1

Share this post


Link to post
Share on other sites

#Update:

Fixed offline/online problem(party.cpp->SendPartyJoinAllToOne, uiparty.py->AddPartyMember)

Code improvement(party.cpp->P2PJoin)

  • Like 2

Share this post


Link to post
Share on other sites

Thanks for the release. I found a bug: when you are at a party and you teleport to a map whose core is different from the map core of the other member of the party, it will show the member as [Offline], that should not happen. Can you look at it, please? : D

Regarding what @Shang says, he means that in the official server, when you create a party, that party is created in all the channels, that is, if you change the channel, the party will be in the channel that was created and in any channel that you change, but still without putting your release, at least in the majority of public sources this does not happen, I suppose the part of creating the party in all the channels at the same time was a recent update of gameforge. So this is not a problem, since it is simply to create the party manually on all channels. xD

Sorry for my bad English.

  • Like 2

Share this post


Link to post
Share on other sites
On 5/15/2018 at 10:50 PM, WLsj24 said:

Thanks for the release. I found a bug: when you are at a party and you teleport to a map whose core is different from the map core of the other member of the party, it will show the member as [Offline], that should not happen. Can you look at it, please? : D

Regarding what @Shang says, he means that in the official server, when you create a party, that party is created in all the channels, that is, if you change the channel, the party will be in the channel that was created and in any channel that you change, but still without putting your release, at least in the majority of public sources this does not happen, I suppose the part of creating the party in all the channels at the same time was a recent update of gameforge. So this is not a problem, since it is simply to create the party manually on all channels. xD

Sorry for my bad English.

It is working 100% right now?

Share this post


Link to post
Share on other sites
3 hours ago, zeimpekis9 said:

It is working 100% right now?

Yes, the only problem is that if "Player1" is in Pyugmoo and "Player2" is in "Spider Dungeon", that is, the members of the party are in different core, (you know, cities are usually in the core1, and maps like Yongbi are usually in the core2) because in that case it will show the one in a different cores as [Offline] (even if both members are online) in the party. If @Mali61 fix that, then one could already speak of a functional version without bugs.

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, WLsj24 said:

Yes, the only problem is that if "Player1" is in Pyugmoo and "Player2" is in "Spider Dungeon", that is, the members of the party are in different core, (you know, cities are usually in the core1, and maps like Yongbi are usually in the core2) because in that case it will show the one in a different cores as [Offline] (even if both members are online) in the party. If @Mali61 fix that, then one could already speak of a functional version without bugs.

Please wait weekend I'm busy

  • Like 3

Share this post


Link to post
Share on other sites
5 hours ago, zeimpekis9 said:

So, did you fixed it?

Yeah now party will create in all channels but still has some problem with online/offline problem.I don't have enough time but don't worry I will fix it.

  • Like 1

Share this post


Link to post
Share on other sites
15 hours ago, Mali61 said:

Yeah now party will create in all channels but still has some problem with online/offline problem.I don't have enough time but don't worry I will fix it.

I don't even know why you are taking orders from random people but nice work thanks for the relase.

Share this post


Link to post
Share on other sites
11 minutes ago, Fleon said:

I don't even know why you are taking orders from random people but nice work thanks for the relase.

 

11 minutes ago, Fleon said:

I don't even know why you are taking orders from random people but nice work thanks for the relase.

he is not taking orders. He released a system. We infrom him about the bugs of the system, and we just asked IF he can fix it. Why everyone here is so rude? I dont understand you. You should learn to help RANDOM people and to flame all the time. FFS.

Share this post


Link to post
Share on other sites
50 minutes ago, zeimpekis9 said:

 

he is not taking orders. He released a system. We infrom him about the bugs of the system, and we just asked IF he can fix it. Why everyone here is so rude? I dont understand you. You should learn to help RANDOM people and to flame all the time. FFS.

Lul. You are not informing him when you ask "So, did you fix it?" but instead it sounds like a request from somebody who should only be grateful, if you want to help then go for a pull request implementing the feature/bugfix on your own.

I've been helping random people way too much, that's why I understood that random people usually don't deserve anything :].

It's git tho, if you want to know if he updated the code then check the commits instead of asking here, you know.

  • Thanks 2

Share this post


Link to post
Share on other sites
2 hours ago, zeimpekis9 said:

 

he is not taking orders. He released a system. We infrom him about the bugs of the system, and we just asked IF he can fix it. Why everyone here is so rude? I dont understand you. You should learn to help RANDOM people and to flame all the time. FFS.

Ηelping random people is like feeding a snake .. :D

Share this post


Link to post
Share on other sites
2 hours ago, Fleon said:

Lul. You are not informing him when you ask "So, did you fix it?" but instead it sounds like a request from somebody who should only be grateful, if you want to help then go for a pull request implementing the feature/bugfix on your own.

I've been helping random people way too much, that's why I understood that random people usually don't deserve anything :].

It's git tho, if you want to know if he updated the code then check the commits instead of asking here, you know.

 

12 minutes ago, BeHappy4Ever said:

Ηelping random people is like feeding a snake .. :D

Whatever. You are so wrong and you dont understand. I will not explain to you anymore.

Share this post


Link to post
Share on other sites
3 minutes ago, zeimpekis9 said:

 

Whatever. You are so wrong and you dont understand. I will not explain to you anymore.

Okay man...

Tρεις και παρ'τα αρχιδια μου!XX

Share this post


Link to post
Share on other sites
6 minutes ago, BeHappy4Ever said:

Okay man...

Tρεις και παρ'τα αρχιδια μου!XX

Δεν αναφερόμουν σε σένα αλλά εντάξει.

Share this post


Link to post
Share on other sites
vor 1 Stunde schrieb BeHappy4Ever:

Okay man...

Tρεις και παρ'τα αρχιδια μου!XX

 

vor 1 Stunde schrieb zeimpekis9:

Δεν αναφερόμουν σε σένα αλλά εντάξει.

ENGLISH GUYS!!!!

Rules

§1 Language

(1.1) Language

The language in this board is english. If you want to post something in your own language always add an english translation. The only exception for this rule is this section: Private Servers

Read the rules guys -.-


Best regards
Raylee

Share this post


Link to post
Share on other sites
Am 12.5.2018 um 21:53 schrieb Mali61:

can you create a code methode for vs 2008? The src db part is just for 2011.

ClientManager.cpp: In member function 'void CClientManager::SendPartyOnSetup(CPeer*)':
ClientManager.cpp:424: error: a function-definition is not allowed here before ':' token
ClientManager.cpp:424: error: expected primary-expression before ')' token
ClientManager.cpp:424: error: expected `;' before ')' token
ClientManager.cpp:426: error: 'channels' was not declared in this scope
Spoiler

#ifdef BL_PARTY_UPDATE
	for (auto channels : {1,2,3,4,99})
	{
		TPartyMap & pm = m_map_pkChannelParty[channels];

		for (itertype(pm) it_party = pm.begin(); it_party != pm.end(); ++it_party)
		{
			sys_log(0, "PARTY SendPartyOnSetup Party [%u]", it_party->first);
			pkPeer->EncodeHeader(HEADER_DG_PARTY_CREATE, 0, sizeof(TPacketPartyCreate));
			pkPeer->Encode(&it_party->first, sizeof(DWORD));

			for (itertype(it_party->second) it_member = it_party->second.begin(); it_member != it_party->second.end(); ++it_member)
			{
				sys_log(0, "PARTY SendPartyOnSetup Party [%u] Member [%u]", it_party->first, it_member->first);
				pkPeer->EncodeHeader(HEADER_DG_PARTY_ADD, 0, sizeof(TPacketPartyAdd));
				pkPeer->Encode(&it_party->first, sizeof(DWORD));
				pkPeer->Encode(&it_member->first, sizeof(DWORD));
				pkPeer->Encode(&it_member->second.bRole, sizeof(BYTE));

				pkPeer->EncodeHeader(HEADER_DG_PARTY_SET_MEMBER_LEVEL, 0, sizeof(TPacketPartySetMemberLevel));
				pkPeer->Encode(&it_party->first, sizeof(DWORD));
				pkPeer->Encode(&it_member->first, sizeof(DWORD));
				pkPeer->Encode(&it_member->second.bLevel, sizeof(BYTE));
			}
		}
	}
#else

 

ClientManagerParty.cpp:8: error: function definition does not declare parameters
ClientManagerParty.cpp: In member function 'void CClientManager::QUERY_PARTY_CREATE(CPeer*, TPacketPartyCreate*)':
ClientManagerParty.cpp:13: error: a function-definition is not allowed here before ':' token
ClientManagerParty.cpp:239: error: expected primary-expression at end of input
ClientManagerParty.cpp:239: error: expected `;' at end of input
ClientManagerParty.cpp:239: error: expected primary-expression at end of input
ClientManagerParty.cpp:239: error: expected `)' at end of input
ClientManagerParty.cpp:239: error: expected statement at end of input
ClientManagerParty.cpp:239: error: expected `}' at end of input
Spoiler

#include "stdafx.h"
#include "ClientManager.h"
#include "Config.h"
#include "DBManager.h"
#include "QID.h"

#ifdef BL_PARTY_UPDATE
std::vector <DWORD> channel_info {1,2,3,4,99};
#endif
void CClientManager::QUERY_PARTY_CREATE(CPeer* peer, TPacketPartyCreate* p)
{
#ifdef BL_PARTY_UPDATE
	for (auto channels : channel_info) {
		TPartyMap & pm = m_map_pkChannelParty[channels];

		if (pm.find(p->dwLeaderPID) == pm.end())
		{
			pm.insert(make_pair(p->dwLeaderPID, TPartyMember()));
			ForwardPacket(HEADER_DG_PARTY_CREATE, p, sizeof(TPacketPartyCreate), channels, peer);
			sys_log(0, "PARTY Create [%lu]", p->dwLeaderPID);
		}
	}
#else
	TPartyMap & pm = m_map_pkChannelParty[peer->GetChannel()];

	if (pm.find(p->dwLeaderPID) == pm.end())
	{
		pm.insert(make_pair(p->dwLeaderPID, TPartyMember()));
		ForwardPacket(HEADER_DG_PARTY_CREATE, p, sizeof(TPacketPartyCreate), peer->GetChannel(), peer);
		sys_log(0, "PARTY Create [%lu]", p->dwLeaderPID);
	}
	else
	{
		sys_err("PARTY Create - Already exists [%lu]", p->dwLeaderPID);
	}
#endif
}

void CClientManager::QUERY_PARTY_DELETE(CPeer* peer, TPacketPartyDelete* p)
{
#ifdef BL_PARTY_UPDATE
	for (auto channels : channel_info) {
		TPartyMap& pm = m_map_pkChannelParty[channels];
		itertype(pm) it = pm.find(p->dwLeaderPID);

		if (it == pm.end())
			return;
		pm.erase(it);
		ForwardPacket(HEADER_DG_PARTY_DELETE, p, sizeof(TPacketPartyDelete), channels, peer);
	}
#else
	TPartyMap& pm = m_map_pkChannelParty[peer->GetChannel()];
	itertype(pm) it = pm.find(p->dwLeaderPID);

	if (it == pm.end())
	{
		sys_err("PARTY Delete - Non exists [%lu]", p->dwLeaderPID);
		return;
	}

	pm.erase(it);
	ForwardPacket(HEADER_DG_PARTY_DELETE, p, sizeof(TPacketPartyDelete), peer->GetChannel(), peer);
#endif
	sys_log(0, "PARTY Delete [%lu]", p->dwLeaderPID);
}

void CClientManager::QUERY_PARTY_ADD(CPeer* peer, TPacketPartyAdd* p)
{
#ifdef BL_PARTY_UPDATE
	for (auto channels : channel_info) {
		TPartyMap & pm = m_map_pkChannelParty[channels];
		itertype(pm) it = pm.find(p->dwLeaderPID);

		if (it == pm.end())
			return;

		if (it->second.find(p->dwPID) == it->second.end())
		{
			it->second.insert(std::make_pair(p->dwPID, TPartyInfo()));
			ForwardPacket(HEADER_DG_PARTY_ADD, p, sizeof(TPacketPartyAdd), channels, peer);
			sys_log(0, "PARTY Add [%lu] to [%lu]", p->dwPID, p->dwLeaderPID);
		}
	}
#else
	TPartyMap & pm = m_map_pkChannelParty[peer->GetChannel()];
	itertype(pm) it = pm.find(p->dwLeaderPID);

	if (it == pm.end())
	{
		sys_err("PARTY Add - Non exists [%lu]", p->dwLeaderPID);
		return;
	}

	if (it->second.find(p->dwPID) == it->second.end())
	{
		it->second.insert(std::make_pair(p->dwPID, TPartyInfo()));
		ForwardPacket(HEADER_DG_PARTY_ADD, p, sizeof(TPacketPartyAdd), peer->GetChannel(), peer);
		sys_log(0, "PARTY Add [%lu] to [%lu]", p->dwPID, p->dwLeaderPID);
	}
	else
		sys_err("PARTY Add - Already [%lu] in party [%lu]", p->dwPID, p->dwLeaderPID);
#endif
}

void CClientManager::QUERY_PARTY_REMOVE(CPeer* peer, TPacketPartyRemove* p)
{
#ifdef BL_PARTY_UPDATE
	for (auto channels : channel_info) {
		TPartyMap & pm = m_map_pkChannelParty[channels];
		itertype(pm) it = pm.find(p->dwLeaderPID);

		if (it == pm.end())
			return;

		itertype(it->second) pit = it->second.find(p->dwPID);

		if (pit != it->second.end())
		{
			it->second.erase(pit);
			ForwardPacket(HEADER_DG_PARTY_REMOVE, p, sizeof(TPacketPartyRemove), channels, peer);
			sys_log(0, "PARTY Remove [%lu] to [%lu]", p->dwPID, p->dwLeaderPID);
		}
	}
#else
	TPartyMap & pm = m_map_pkChannelParty[peer->GetChannel()];
	itertype(pm) it = pm.find(p->dwLeaderPID);

	if (it == pm.end())
	{
		sys_err("PARTY Remove - Non exists [%lu] cannot remove [%lu]",p->dwLeaderPID, p->dwPID);
		return;
	}

	itertype(it->second) pit = it->second.find(p->dwPID);

	if (pit != it->second.end())
	{
		it->second.erase(pit);
		ForwardPacket(HEADER_DG_PARTY_REMOVE, p, sizeof(TPacketPartyRemove), peer->GetChannel(), peer);
		sys_log(0, "PARTY Remove [%lu] to [%lu]", p->dwPID, p->dwLeaderPID);
	}
	else
		sys_err("PARTY Remove - Cannot find [%lu] in party [%lu]", p->dwPID, p->dwLeaderPID);
#endif
}

void CClientManager::QUERY_PARTY_STATE_CHANGE(CPeer* peer, TPacketPartyStateChange* p)
{
#ifdef BL_PARTY_UPDATE
	for (auto channels : channel_info) {
		TPartyMap & pm = m_map_pkChannelParty[channels];
		itertype(pm) it = pm.find(p->dwLeaderPID);

		if (it == pm.end())
			return;

		itertype(it->second) pit = it->second.find(p->dwPID);

		if (pit == it->second.end())
			return;

		if (p->bFlag)
			pit->second.bRole = p->bRole;
		else 
			pit->second.bRole = 0;

		ForwardPacket(HEADER_DG_PARTY_STATE_CHANGE, p, sizeof(TPacketPartyStateChange), channels, peer);
	}
#else
	TPartyMap & pm = m_map_pkChannelParty[peer->GetChannel()];
	itertype(pm) it = pm.find(p->dwLeaderPID);

	if (it == pm.end())
	{
		sys_err("PARTY StateChange - Non exists [%lu] cannot state change [%lu]",p->dwLeaderPID, p->dwPID);
		return;
	}

	itertype(it->second) pit = it->second.find(p->dwPID);

	if (pit == it->second.end())
	{
		sys_err("PARTY StateChange - Cannot find [%lu] in party [%lu]", p->dwPID, p->dwLeaderPID);
		return;
	}

	if (p->bFlag)
		pit->second.bRole = p->bRole;
	else 
		pit->second.bRole = 0;

	ForwardPacket(HEADER_DG_PARTY_STATE_CHANGE, p, sizeof(TPacketPartyStateChange), peer->GetChannel(), peer);
#endif
	sys_log(0, "PARTY StateChange [%lu] at [%lu] from %d %d",p->dwPID, p->dwLeaderPID, p->bRole, p->bFlag);
}

void CClientManager::QUERY_PARTY_SET_MEMBER_LEVEL(CPeer* peer, TPacketPartySetMemberLevel* p)
{
#ifdef BL_PARTY_UPDATE
	for (auto channels : channel_info) {	
		TPartyMap & pm = m_map_pkChannelParty[channels];
		itertype(pm) it = pm.find(p->dwLeaderPID);

		if (it == pm.end())
			return;

		itertype(it->second) pit = it->second.find(p->dwPID);

		if (pit == it->second.end())
			return;

		pit->second.bLevel = p->bLevel;

		ForwardPacket(HEADER_DG_PARTY_SET_MEMBER_LEVEL, p, sizeof(TPacketPartySetMemberLevel), channels);
	}
#else
	TPartyMap & pm = m_map_pkChannelParty[peer->GetChannel()];
	itertype(pm) it = pm.find(p->dwLeaderPID);

	if (it == pm.end())
	{
		sys_err("PARTY SetMemberLevel - Non exists [%lu] cannot level change [%lu]",p->dwLeaderPID, p->dwPID);
		return;
	}

	itertype(it->second) pit = it->second.find(p->dwPID);

	if (pit == it->second.end())
	{
		sys_err("PARTY SetMemberLevel - Cannot find [%lu] in party [%lu]", p->dwPID, p->dwLeaderPID);
		return;
	}

	pit->second.bLevel = p->bLevel;

	ForwardPacket(HEADER_DG_PARTY_SET_MEMBER_LEVEL, p, sizeof(TPacketPartySetMemberLevel), peer->GetChannel());
#endif
	sys_log(0, "PARTY SetMemberLevel pid [%lu] level %d",p->dwPID, p->bLevel);
}

 

 

Share this post


Link to post
Share on other sites
On 5/20/2018 at 10:22 PM, Mali61 said:

Yeah now party will create in all channels but still has some problem with online/offline problem.I don't have enough time but don't worry I will fix it.

:( 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×