mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 06:40:26 +00:00
[Bug Fix] Update bot naming check and add more explanation (#3491)
* Refactor my original PR Block all puncation,numbers, and _ * Add error message
This commit is contained in:
+5
-2
@@ -1273,8 +1273,11 @@ bool Bot::IsValidName(std::string& name)
|
||||
if (!isupper(name[0]))
|
||||
return false;
|
||||
|
||||
for (int i = 1; i < name.length(); ++i) {
|
||||
if ((!RuleB(Bots, AllowCamelCaseNames) && !islower(name[i])) && name[i] != '_') {
|
||||
for (char c : name.substr(1)) {
|
||||
if (!RuleB(Bots, AllowCamelCaseNames) && !islower(c)) {
|
||||
return false;
|
||||
}
|
||||
if (isdigit(c) || ispunct(c)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user