Jump to content

[TMP4 FILES] PM Disconect Bug


Go to solution Solved by CORKY,

Recommended Posts

Hello everybody,
I use the TMP4 reference files and found a bug:
When I send a message to any player or even a player that doesn't exist, if I send the message several times in a row, I am disconnected from the game.

I would like to know if anyone else had the same problem (if you have done the test).

does anyone knows could be the problem? 

.gif

Link to comment
https://metin2.dev/topic/31939-tmp4-files-pm-disconect-bug/
Share on other sites

What do you call a bug, it's actually a feature.

It's spam detection + auto kick, like the chat one.

I've added it too in my files. You just need to config it so it allows a couple more messages before kick.

 

https://metin2.download/video/EIyihjL0B032Dc802I775Nw9976DqoXv/.mp4

 

So, go to input_main.cpp and search:

 

int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)

 

Now find something with:

 

Quote

if (ch->IncreaseChatCounter() > numberhere

numberhere = Adjust it to your preferences.

Edited by HFWhite
Core X - External 2 Internal
  • Good 1
25 minutes ago, HFWhite said:

What do you call a bug, it's actually a feature.

It's spam detection + auto kick, like the chat one.

I've added it too in my files. You just need to config it so it allows a couple more messages before kick.

 

https://metin2.download/video/EIyihjL0B032Dc802I775Nw9976DqoXv/.mp4

 

So, go to input_main.cpp and search:

 

int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)

 

Now find something with:

 

numberhere = Adjust it to your preferences.

 

Hi, @ HFWhite, Thanks for your answer, but... Looks like it is configured for 10 messages, i get disconected after 3 or 4 messages (sometimes 2 are enough), and I got disconected instantly.

my code:

 

	if (ch->IncreaseChatCounter() >= 10)
	{
		if (ch->GetChatCounter() == 10)
		{
			sys_log(0, "CHAT_HACK: %s", ch->GetName());
			ch->GetDesc()->DelayedDisconnect(5);
		}

		return iExtraLen;
	}

 

 

  • Premium
  • Solution

input_main.cpp

 

	if (ch->GetLastPMPulse() < thecore_pulse())
		ch->ClearPMCounter();
		
	if (ch->GetPMCounter() > 3 && ch->GetLastPMPulse() > thecore_pulse())
	{
		ch->GetDesc()->SetPhase(PHASE_CLOSE);
		return -1;
	}


Modify the "3" with your desired limiter, or just remove it if you don't want any kind of limitation.

  • Scream 1
2 hours ago, Ballads said:

Hi, @ HFWhite, Thanks for your answer, but... Looks like it is configured for 10 messages, i get disconected after 3 or 4 messages (sometimes 2 are enough), and I got disconected instantly.

Well maybe you have another check for spam somewhere else in the code.

Do what @ CORKY said.

:default_tongue:

I think its best to remove the code anyway, especially if you said you already have if (ch->IncreaseChatCounter() >= 10)

 

(make sure it is in the whisper function! because you have one in the chat function as well)

Edited by HFWhite
  • Good 1
44 minutes ago, CORKY said:

input_main.cpp

 

	if (ch->GetLastPMPulse() < thecore_pulse())
		ch->ClearPMCounter();
		
	if (ch->GetPMCounter() > 3 && ch->GetLastPMPulse() > thecore_pulse())
	{
		ch->GetDesc()->SetPhase(PHASE_CLOSE);
		return -1;
	}


Modify the "3" with your desired limiter, or just remove it if you don't want any kind of limitation.

Thank you, i really appreciate your help

  • Good 1

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.