Jump to content

Erase EventFlag Function


Recommended Posts

  • Bot

cmd.cpp

ACMD(do_erase_event_flag);
{ "eraseeventflag", do_erase_event_flag, 0, POS_DEAD, GM_HIGH_WIZARD },

cmd_gm.cpp

ACMD(do_erase_event_flag)
{
	char arg1[256];
	one_argument(argument, arg1, sizeof(arg1));
	if (!(*arg1)) return;
	quest::CQuestManager::instance().EraseEventFlag(arg1);
	ch->ChatPacket(CHAT_TYPE_INFO, "EraseEventFlag %s", arg1);
	sys_log(0, "EraseEventFlag %s", arg1);
}

questmanager.h

	void		EraseEventFlag(const string& name);

questmanager.cpp

#include "db.h"
	void CQuestManager::EraseEventFlag(const string& name)
	{
		itertype(m_mapEventFlag) it;
		for (it = m_mapEventFlag.begin(); it != m_mapEventFlag.end(); ++it)
		{
			const string& flagname = it->first;
			if (flagname.compare(name) == 0) {
				m_mapEventFlag.erase(it);
				char szName[160+1];
				//CAUSE KORAY DOESN'T UNDERSTAND NOTHING
				DBManager::instance().EscapeString(szName, sizeof(szName), name.c_str(), strlen(name.c_str()));
				char szQuery[1024+1];
				snprintf(szQuery, sizeof(szQuery), "DELETE FROM player.quest%s WHERE szName='%s';", get_table_postfix(), szName);
				DBManager::instance().DirectQuery(szQuery);
				break;
			}
		}
	}

questlua_game.cpp

	int game_erase_event_flag(lua_State* L)
	{
		CQuestManager& q = CQuestManager::instance();

		if (lua_isstring(L,1))
			q.EraseEventFlag(lua_tostring(L,1));

		return 0;
	}
{ "erase_event_flag",			game_erase_event_flag			},

 

KEEP A LOT OF EVENTS FLAG IS A BIG PROBLEM, A LOT OF SERVER CRASH DAILY FOR THIS PROBLEM!

THIS FUNCTION IS FREE FOR ALL!!! NOT AS MARTYSAMA THAT SELL THIS FOR 10€...

  • Metin2 Dev 1
  • Confused 1

english_banner.gif

Link to comment
Share on other sites

6 hours ago, M2BobFixed said:

KEEP A LOT OF EVENTS FLAG IS A BIG PROBLEM, A LOT OF SERVER CRASH DAILY FOR THIS PROBLEM!

THIS FUNCTION IS FREE FOR ALL!!!

Sorry but you are very dumb. :blink:
This doesn't help you with nothing, you dont know nothing about event flag and how it's working.

  • r4VtdW8hTrGVpQspCVZEyg.png

Who the hell want to delete them? Nobody.
If someone want to delete them just run this query before start the server. (there is no reason to do that)
This query will delete all event flag list, because difference between quest flag and event flag is the state empty.

DELETE FROM player.quest WHERE szState = '';

After execute the query, remaining only the guild_disband_delay & guild_withdraw_delay because is seted forced when core start by main::CQuestManager::Initialize(). 

  • iB00-djaRB_hoR_KJx4X8w.png
Quote

A LOT OF SERVER CRASH DAILY FOR THIS PROBLEM!

giphy.gif

We thank you again for killing C++ language.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • Bronze

Why would you do that? It's pointless and in this whole time of my experience I didn't even see a server to crash because of this. And trust I've seen a lot of junk servers and they had millions of event flags.

 

And why would you make this scandal for 10 euros ? You know martysama doesn't even speak with you for 10 euros.

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

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.