Jump to content
×
×
  • Create New...

(SUITE SUPP CAT INT) (en attente verif asikoo) [C++] All Server Fix


Funky Emulation

Recommended Posts

  • Bot

Hello

 

I will create this topic to show you how to put many fix on your server.

 

1 - Fix - Party Dungeon

 

Révélation

 

Search this in : char.cpp

	//if (m_pkDungeon && IsPC())
	//SetDungeon(NULL);

Replace with this :

    if (m_pkDungeon && IsPC() && !pkParty)
        SetDungeon(NULL);

 

 

2 - Fix - Header 100

 

Révélation

 

Search this in : input_login.cpp

		case HEADER_CG_SYMBOL_CRC:
		GuildSymbolCRC(d, c_pData);
			break;

Add this after : 

		case HEADER_CG_MARK_LOGIN:
			break;

 


3 - Fix - Command /war

 

Révélation

 

Search this in : cmd_general.ccp

if (*arg2)
    {
        str_to_number(type, arg2);

        if (type >= GUILD_WAR_TYPE_MAX_NUM)
            type = GUILD_WAR_TYPE_FIELD;
    }

Replace with this : 

    if (*arg2)
    {
        str_to_number(type, arg2);

        if (type >= GUILD_WAR_TYPE_MAX_NUM)
            type = GUILD_WAR_TYPE_FIELD;
            
        if(type < 0) //war crash fix
            return;
    } 

 


4 - Fix - Guild

 

Révélation

 

Search this in : char_change_empire.cpp

if (msg->Get()->uiAffectedRows > 0)

Replace with this :

		if (msg->Get()->uiAffectedRows > 0)
		{
			SetChangeEmpireCount();
			SetEmpire(empire);
                        UpdatePacket();
			return 999;
		}

After we gonna search in : input_main.cpp

if (!ch->IsPC())
    return SubPacketLen;

Replace with this : 

if (!newmember->IsPC())
    return SubPacketLen;

 

 

7 - Fix - Ban Messenger

 

Révélation

 

Search this in messenger_manager.cpp

void MessengerManager::RemoveFromList(MessengerManager::keyA account, MessengerManager::keyA companion)

Replace with this : 

void MessengerManager::RemoveFromList(MessengerManager::keyA account, MessengerManager::keyA companion)
{
	if (companion.empty())
		return;

	// Second fix
	if (m_Relation[account].find(companion) == m_Relation[account].end() || m_InverseRelation[companion].find(account) == 			m_InverseRelation[companion].end())
	{
		LPCHARACTER ch = CHARACTER_MANAGER::Instance().FindPC(account.c_str());
		if (ch)
		{
			sys_err("MessengerManager::RemoveFromList: %s tries to use messenger sql injection", ch->GetName());

			if (ch->GetDesc())
				ch->GetDesc()->DelayedDisconnect(3);
		}
		else
			sys_err("MessengerManager::RemoveFromList: Omg! The ghost tried to use this function!");
		return;
	}

	sys_log(1, "MessengerManager::RemoveFromList: Remove %s %s", account.c_str(), companion.c_str());
	DBManager::instance().Query("DELETE FROM messenger_list%s WHERE account='%s' AND companion = '%s'", get_table_postfix(), account.c_str(), companion.c_str());
	__RemoveFromList(account, companion);
	TPacketGGMessenger p2ppck;
	p2ppck.bHeader = HEADER_GG_MESSENGER_REMOVE;
	strlcpy(p2ppck.szAccount, account.c_str(), sizeof(p2ppck.szAccount));
	strlcpy(p2ppck.szCompanion, companion.c_str(), sizeof(p2ppck.szCompanion));;
	P2P_MANAGER::instance().Send(&p2ppck, sizeof(TPacketGGMessenger));
}

If you want to ban who tries to use this SQL injection : 

void MessengerManager::RemoveFromList(MessengerManager::keyA account, MessengerManager::keyA companion)
{
	if (companion.empty())
		return;

	// Second fix
	if (m_Relation[account].find(companion) == m_Relation[account].end() || m_InverseRelation[companion].find(account) == m_InverseRelation[companion].end())
	{
		LPCHARACTER ch = CHARACTER_MANAGER::Instance().FindPC(account.c_str());
		if (ch)
		{
			sys_err("MessengerManager::RemoveFromList: %s tries to use messenger sql injection", ch->GetName());
			DBManager::Instance().DirectQuery("UPDATE account.account SET status = 'BLOCK' WHERE id = %u", ch->GetAID());
			if (ch->GetDesc())
				ch->GetDesc()->DelayedDisconnect(3);
		}
		else
			sys_err("MessengerManager::RemoveFromList: Omg! The ghost tried to use this function!");
		return;
	}

	sys_log(1, "MessengerManager::RemoveFromList: Remove %s %s", account.c_str(), companion.c_str());
	DBManager::instance().Query("DELETE FROM messenger_list%s WHERE account='%s' AND companion = '%s'", get_table_postfix(), account.c_str(), companion.c_str());
	__RemoveFromList(account, companion);
	TPacketGGMessenger p2ppck;
	p2ppck.bHeader = HEADER_GG_MESSENGER_REMOVE;
	strlcpy(p2ppck.szAccount, account.c_str(), sizeof(p2ppck.szAccount));
	strlcpy(p2ppck.szCompanion, companion.c_str(), sizeof(p2ppck.szCompanion));;
	P2P_MANAGER::instance().Send(&p2ppck, sizeof(TPacketGGMessenger));
}

 

 

6 - Fix - Accumulation of stones

 

Révélation

 

Search this in : char_item.cpp

case USE_DETACHMENT:

 

Under this function : 

if (item2->IsExchanging() == true)
	return false;

Add this : 

if (item2->IsEquipped())
{
	ChatPacket(CHAT_TYPE_INFO, "Can't not remove stones from an equipped object.");
	return false;
}

 

 

7 - Fix - Aura of the Sword

 

Révélation

 

Search this in : char_skill.cpp

bool CHARACTER::UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaster)

Add this after  : 

if ((dwVnum == SKILL_GEOMKYUNG || dwVnum == SKILL_GWIGEOM) && !GetWear(WEAR_WEAPON))
return false;

Like this : 

114006IiEbzKv.png

 

 

If you have any problem with this topic, I invite you to create a help request in the support section.

This topic can be edited at any time.

090100logo.png 090149logo-4-bis.png

Link to comment
  • 1 year later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.