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
Share on other sites

  • Active+ Member

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

spacer.png

Link to comment
Share on other sites

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;
	}

 

 

Link to comment
Share on other sites

  • 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
Link to comment
Share on other sites

  • Active+ Member
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

spacer.png

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      ImperiaWorld2 - SpeedServer - Opening 03/05/2024 - NewSchool - New Graphics M2 1.0.4b Terrain depth - International

    2. 2

      Very strange bug, when creating new char

    3. 6

      Voooxy aka m2core.tech scammer

    4. 117

      Ulthar SF V2 (TMP4 Base)

    5. 0

      UI types and attributes

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.