Last active
November 4, 2015 20:54
-
-
Save cyberium/3275f8a531129b6b1d14 to your computer and use it in GitHub Desktop.
ignore /script from chat messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp | |
index 3bda8d9..c8715c9 100644 | |
--- a/src/game/ChatHandler.cpp | |
+++ b/src/game/ChatHandler.cpp | |
@@ -53,6 +53,22 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg | |
KickPlayer(); | |
return false; | |
} | |
+ | |
+ // check if the message start with /script wish is not permitted in any case | |
+ const std::string script = "/SCRIPT"; | |
+ bool found = true; | |
+ for (uint32 i = 0; i < script.length(); ++i) | |
+ { | |
+ char c = toupper(msg[i]); | |
+ if (c != script[i]) | |
+ { | |
+ found = false; | |
+ break; | |
+ } | |
+ } | |
+ | |
+ if (found) | |
+ return false; | |
} | |
return true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment