Fix toon names being allowed with lower case starting char

This commit is contained in:
Michael Cook (mackal)
2014-09-20 02:46:04 -04:00
parent 9b70b73759
commit 7621882b4e
2 changed files with 11 additions and 16 deletions
+1
View File
@@ -3,6 +3,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50)
== 09/19/2014 ==
demonstar55: Added Client::Tell_StringID (used in tell queue messages)
demonstar55: Tell queues (and offline) messages now show correctly
demonstar55: Fix starting with capital check
== 09/18/2014==
demonstar55: Implement tell queues
+8 -14
View File
@@ -471,8 +471,8 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
return true;
}
bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) {
bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app)
{
if (GetAccountID() == 0) {
clog(WORLD__CLIENT_ERR,"Name approval request with no logged in account");
return false;
@@ -490,27 +490,21 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) {
outapp->pBuffer = new uchar[1];
outapp->size = 1;
bool valid;
if(!database.CheckNameFilter(char_name)) {
bool valid = false;
if (!database.CheckNameFilter(char_name))
valid = false;
}
else if(char_name[0] < 'A' && char_name[0] > 'Z') {
else if (islower(char_name[0]))
//name must begin with an upper-case letter.
valid = false;
}
else if (database.ReserveName(GetAccountID(), char_name)) {
else if (database.ReserveName(GetAccountID(), char_name))
valid = true;
}
else {
valid = false;
}
outapp->pBuffer[0] = valid ? 1 : 0;
QueuePacket(outapp);
safe_delete(outapp);
if(!valid) {
if (!valid)
memset(char_name, 0, sizeof(char_name));
}
return true;
}