Merge pull request #36 from Salanto/EmptyName

Prevent empty OOC name
This commit is contained in:
scatterflower 2021-03-15 13:46:15 -05:00 committed by GitHub
commit e477b9d01c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -52,7 +52,6 @@ class Server : public QObject {
void broadcast(AOPacket packet, int area_index);
void broadcast(AOPacket packet);
QString getServerName();
QString getMOTD();
int getDiceValue(QString value_type);
int getCharID(QString char_name);

View File

@ -173,8 +173,7 @@ void AOClient::pktIcChat(AreaData* area, int argc, QStringList argv, AOPacket pa
void AOClient::pktOocChat(AreaData* area, int argc, QStringList argv, AOPacket packet)
{
ooc_name = dezalgo(argv[0]).replace(QRegExp("\\[|\\]|\\{|\\}|\\#|\\$|\\%|\\&"), ""); // no fucky wucky shit here
if (ooc_name == server->getServerName()) // impersonation prevention
if (ooc_name.isEmpty() || ooc_name == server->getServerName()) // impersonation & empty name protection
return;
QString message = dezalgo(argv[1]);