Jump to content

Reimplementation of Events


Recommended Posts

  • Bronze

M2 Download Center

This is the hidden content, please
( Internal )

Hello,

 

Working on some new stuff I found out that current implementation of event looks a bit tricky.

Due to this fact I basically deciced to re-implement it in C++11 providing up to date tech.

Don`t forget to take a look at this topic before you start:

https://metin2dev.org/board/index.php?/topic/305-src-compile-with-gcc48-c11-and-optimized-flags/

So lets begin.

Add include into the main.cpp:

#ifdef __NEW_EVENT_HANDLER__
	#include "EventFunctionHandler.h"
#endif

And add this into main function before:

while (idle());
	#ifdef __NEW_EVENT_HANDLER__
		CEventFunctionHandler EventFunctionHandler;
	#endif

Now add this at the end of idle:

	#ifdef __NEW_EVENT_HANDLER__
		CEventFunctionHandler::instance().Process();
	#endif

Now search for:

sys_log(0, "<shutdown> Destroying CArenaManager...");

And add before:

	#ifdef __NEW_EVENT_HANDLER__
		sys_log(0, "<shutdown> Destroying CEventFunctionHandler...");
		CEventFunctionHandler::instance().Destroy();
	#endif

Now open service.h and add this define:

#define __NEW_EVENT_HANDLER__

That`s all.

Now just download attachment and add included files to your source.

  • Metin2 Dev 41
  • Sad 1
  • Confused 2
  • Good 12
  • Love 63
Link to comment
Share on other sites

	#ifdef __NEW_EVENT_HANDLER__
		CEventFunctionHandler EventFunctionHandler;
	#endif

That doesn't need to exist, but if someone really want to use:

Search for:

  • CEventFunctionHandler::instance().Process();

Replace with:

  • EventFunctionHandler.Process();

Thanks for release, i like that structure, keep up the good work.

Link to comment
Share on other sites

  • Bronze
2 godziny temu, Tasho napisał:

	#ifdef __NEW_EVENT_HANDLER__
		CEventFunctionHandler EventFunctionHandler;
	#endif

That doesn't need to exist, but if someone really want to use:

Search for:

  • CEventFunctionHandler::instance().Process();

Replace with:

  • EventFunctionHandler.Process();

Thanks for release, i like that structure, keep up the good work.

Indeed. It is just singleton initial call.

Link to comment
Share on other sites

  • 1 year later...
  • 6 months later...
  • 10 months later...
  • Honorable Member
40 minutes ago, Mafuyu said:

REUPLOAD AMK

Why are you cursing for no reason?

Link is at the top of the topic. You might want to go for an eye checkup.

Edited by Mali61
  • Lmao 1

 

Link to comment
Share on other sites

  • Honorable Member
2 minutes ago, Mafuyu said:

160b238cf4.gif

 

big brain i wouldnt cry if it would be that simple my guuuuy

The link is broken = I have to swear

😕

iTtUw4Y.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 1

 

Link to comment
Share on other sites

  • Management
4 minutes ago, Mafuyu said:

160b238cf4.gif

 

big brain i wouldnt cry if it would be that simple my guuuuy

What browser are you using?

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

  • Management
2 minutes ago, Mafuyu said:

Im using opera gx

I do not understand, are you using a VPN? Proxy?

Link to comment
Share on other sites

  • Management
1 minute ago, Mafuyu said:

no, website is getting blocked by malwarebytes because of trojan detection. I turned it off then it worked^^

Hm.. Okay

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.