mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-26 15:37:16 +00:00
correct name checking to match players
This commit is contained in:
+6
-12
@@ -1621,33 +1621,27 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas
|
|||||||
bot_owner->Message(
|
bot_owner->Message(
|
||||||
Chat::Yellow,
|
Chat::Yellow,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"'{}' is an invalid name. You may only use characters 'A-Z' or 'a-z' and it must be between 4 and 15 characters. Mixed case {} allowed.",
|
"'{}' is an invalid name. You may only use characters 'A-Z' or 'a-z' and it must be between 4 and 15 characters with no spaces. Mixed case {} allowed.",
|
||||||
bot_name, RuleB(Bots, AllowCamelCaseNames) ? "is" : "is not"
|
bot_name, RuleB(Bots, AllowCamelCaseNames) ? "is" : "is not"
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
return bot_id;
|
return bot_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool available_flag = false;
|
bool available_flag = false;
|
||||||
if (!database.botdb.QueryNameAvailablity(bot_name, available_flag)) {
|
|
||||||
bot_owner->Message(
|
!database.botdb.QueryNameAvailablity(bot_name, available_flag);
|
||||||
Chat::Yellow,
|
|
||||||
fmt::format(
|
|
||||||
"'{}' is already in use or an invalid name.",
|
|
||||||
bot_name
|
|
||||||
).c_str()
|
|
||||||
);
|
|
||||||
return bot_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!available_flag) {
|
if (!available_flag) {
|
||||||
bot_owner->Message(
|
bot_owner->Message(
|
||||||
Chat::Yellow,
|
Chat::Yellow,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"The name '{}' is already being used. Please choose a different name",
|
"The name '{}' is already being used or prohibited. Please choose a different name",
|
||||||
bot_name
|
bot_name
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
return bot_id;
|
return bot_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,35 +121,29 @@ void bot_command_clone(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
if (!Bot::IsValidName(bot_name)) {
|
if (!Bot::IsValidName(bot_name)) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::Yellow,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"'{}' is an invalid name. You may only use characters 'A-Z', 'a-z' and '_'.",
|
"'{}' is an invalid name. You may only use characters 'A-Z' or 'a-z' and it must be between 4 and 15 characters. Mixed case {} allowed.",
|
||||||
bot_name
|
bot_name, RuleB(Bots, AllowCamelCaseNames) ? "is" : "is not"
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool available_flag = false;
|
bool available_flag = false;
|
||||||
if (!database.botdb.QueryNameAvailablity(bot_name, available_flag)) {
|
|
||||||
c->Message(
|
!database.botdb.QueryNameAvailablity(bot_name, available_flag);
|
||||||
Chat::White,
|
|
||||||
fmt::format(
|
|
||||||
"Failed to query name availability for '{}'.",
|
|
||||||
bot_name
|
|
||||||
).c_str()
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!available_flag) {
|
if (!available_flag) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::Yellow,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"The name '{}' is already being used. Please choose a different name.",
|
"The name '{}' is already being used or prohibited. Please choose a different name",
|
||||||
bot_name
|
bot_name
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user