mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 02:38:45 +00:00
[GM Commands] Split GM Commands Into Separate Files (#1766)
* Split GM commands into their own files * Code cleanup
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_setpass(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->argnum != 2) {
|
||||
c->Message(Chat::White, "Format: #setpass accountname password");
|
||||
}
|
||||
else {
|
||||
std::string user;
|
||||
std::string loginserver;
|
||||
ParseAccountString(sep->arg[1], user, loginserver);
|
||||
|
||||
int16 tmpstatus = 0;
|
||||
uint32 tmpid = database.GetAccountIDByName(user.c_str(), loginserver.c_str(), &tmpstatus);
|
||||
if (!tmpid) {
|
||||
c->Message(Chat::White, "Error: Account not found");
|
||||
}
|
||||
else if (tmpstatus > c->Admin()) {
|
||||
c->Message(Chat::White, "Cannot change password: Account's status is higher than yours");
|
||||
}
|
||||
else if (database.SetLocalPassword(tmpid, sep->arg[2])) {
|
||||
c->Message(Chat::White, "Password changed.");
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Error changing password.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user