Jump to content
  • 0

Help Please..?


trizzy

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

Hi i just found this somewhere.

How can i add message on screen?

example: Your character is spamming packets too fast? then in 3 seconds character will be disconnected?

but is much better if it's like announce for all map

like announce ""+ strcharinfo(0) +" is spamming packets too fast. , bc_all, 0x00FFFF;

anyone?

====================Index: src/common/socket.c=========================
uint32 max_packet_spam = 20;

	{
		if( !session[fd]->flag.server && session[fd]->packet_counter > max_packet_spam)
		{
			ShowWarning("Client %s is spamming packets too fast!\n", ip2str(session[fd]->client_addr, NULL));
			//set_eof(fd); //
		}

		session[fd]->packet_counter = 0;
		session[fd]->last_reset = last_tick;
	}
	session[fd]->packet_counter++;

 	return 0;
 }
 

=================Index: src/common/socket.h=========================
 	SendFunc func_send;
 	ParseFunc func_parse;
 
	// packet flood detection
	uint32 packet_counter; // counts received packets per iteration
	time_t last_reset; // time when the counter was last reset

 	void* session_data; // stores application-specific data related to the session
 };
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...