[Commands] Cleanup #ban, #ipban, #flag, #kick, #setlsinfo, and #setpass Commands. (#2104)

* [Commands] Cleanup #ban, #ipban, #flag, and #kick Commands.
- Cleanup messages and logic.
- Add ServerFlagUpdate_Struct for flag updates.

* Add #setlsinfo and #setpass to cleanup.

* Update setlsinfo.cpp

* Update database.cpp

* Update database.cpp

* Update command.cpp
This commit is contained in:
Kinglykrab
2022-05-07 23:28:45 -04:00
committed by GitHub
parent 07b46ed445
commit d9c41526e8
13 changed files with 312 additions and 227 deletions
+13 -14
View File
@@ -5,20 +5,19 @@ extern WorldServer worldserver;
void command_setlsinfo(Client *c, const Seperator *sep)
{
if (sep->argnum != 2) {
c->Message(Chat::White, "Format: #setlsinfo email password");
}
else {
auto pack = new ServerPacket(
ServerOP_LSAccountUpdate,
sizeof(ServerLSAccountUpdate_Struct));
ServerLSAccountUpdate_Struct *s = (ServerLSAccountUpdate_Struct *) pack->pBuffer;
s->useraccountid = c->LSAccountID();
strn0cpy(s->useraccount, c->AccountName(), 30);
strn0cpy(s->user_email, sep->arg[1], 100);
strn0cpy(s->userpassword, sep->arg[2], 50);
worldserver.SendPacket(pack);
c->Message(Chat::White, "Login Server update packet sent.");
int arguments = sep->argnum;
if (arguments < 2) {
c->Message(Chat::White, "Usage: #setlsinfo [Email] [Password]");
return;
}
auto pack = new ServerPacket(ServerOP_LSAccountUpdate, sizeof(ServerLSAccountUpdate_Struct));
auto s = (ServerLSAccountUpdate_Struct *) pack->pBuffer;
s->useraccountid = c->LSAccountID();
strn0cpy(s->useraccount, c->AccountName(), 30);
strn0cpy(s->user_email, sep->arg[1], 100);
strn0cpy(s->userpassword, sep->arg[2], 50);
worldserver.SendPacket(pack);
c->Message(Chat::White, "Your email and local loginserver password have been set.");
}