Aller au contenu
Top-Metin2.org - Vous êtes à la recherche d'un serveur Metin 2 ? ×
×
×
  • Créer...

(English) All Server Fix


Metin2 Dev

Messages recommandés

  • Robot

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;

 

 

5 - 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 messen?ger_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.

french_banner.gif

Lien vers le commentaire
Partager sur d’autres sites

  • Réponses 0
  • Créé
  • Dernière réponse

Meilleurs contributeurs dans ce sujet

Jours populaires

Meilleurs contributeurs dans ce sujet



Information importante

Conditions d’utilisation / Politique de confidentialité / Règles / Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.