From 74f9e4faafe24699597e4be5bfda83bf255ba72e Mon Sep 17 00:00:00 2001
From: Shakar <shakar86@gmail.com>
Date: Fri, 23 Mar 2012 01:02:31 +0100
Subject: [PATCH] fix against command flooding

---
 pvpgn/src/bnetd/command.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pvpgn/src/bnetd/command.cpp b/pvpgn/src/bnetd/command.cpp
index ceae376..bbcf924 100644
--- a/pvpgn/src/bnetd/command.cpp
+++ b/pvpgn/src/bnetd/command.cpp
@@ -487,6 +487,12 @@ extern int handle_command(t_connection * c,  char const * text)
 {
   t_command_table_row const *p;
 
+  if ((text[0]!='\0') && (conn_quota_exceeded(c,text)))
+  {
+	message_send_text(c,message_type_error,c,"You are sending commands to Battle.net too quickly and risk being disconnected for flooding. Please slow down.");
+	return 0;
+  }   
+
   for (p = standard_command_table; p->command_string != NULL; p++)
     {
       if (strstart(text, p->command_string)==0)