Jump to content

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
https://metin2.dev/topic/17214-erase-eventflag-function/
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
https://metin2.dev/topic/17214-erase-eventflag-function/#findComment-94455
Share on other sites

  • Active Member

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
https://metin2.dev/topic/17214-erase-eventflag-function/#findComment-94457
Share on other sites

  • Bot
4 hours ago, Koray said:

dat sql injection

this code can be executed only by Staff... Why a gm have to sql inject the server?

Just use this for take care:

 

	char text[160+1];
	DBManager::instance().EscapeString(text, sizeof(text), "KORAY NOOB", strlen("KORAY NOOB"));

 

english_banner.gif

Link to comment
https://metin2.dev/topic/17214-erase-eventflag-function/#findComment-94486
Share on other sites

  • Active Member
13 hours ago, M2BobFixed said:

 A LOT OF SERVER CRASH DAILY FOR THIS PROBLEM!

oJhS-WXWRCOjghG8plzlJQ.png

Server online from 06.2015, sometimes without restart game for 2 months and never crashed cause eventflags.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/17214-erase-eventflag-function/#findComment-94487
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.