trizzy Posted June 18, 2015 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 92 Reputation: 2 Joined: 01/04/15 Last Seen: April 27, 2021 Share Posted June 18, 2015 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 }; Quote Link to comment Share on other sites More sharing options...
Question
trizzy
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?
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.