mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[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:
+6
-6
@@ -124,7 +124,7 @@ int command_init(void)
|
||||
command_add("apply_shared_memory", "[shared_memory_name] - Tells every zone and world to apply a specific shared memory segment by name.", AccountStatus::GMImpossible, command_apply_shared_memory) ||
|
||||
command_add("attack", "[Entity Name] - Make your NPC target attack an entity by name", AccountStatus::GMLeadAdmin, command_attack) ||
|
||||
command_add("augmentitem", "Force augments an item. Must have the augment item window open.", AccountStatus::GMImpossible, command_augmentitem) ||
|
||||
command_add("ban", "[name] [reason]- Ban by character name", AccountStatus::GMLeadAdmin, command_ban) ||
|
||||
command_add("ban", "[Character Name] [Reason]- Ban by character name", AccountStatus::GMLeadAdmin, command_ban) ||
|
||||
command_add("bind", "- Sets your targets bind spot to their current location", AccountStatus::GMMgmt, command_bind) ||
|
||||
|
||||
#ifdef BOTS
|
||||
@@ -178,7 +178,7 @@ int command_init(void)
|
||||
command_add("findtask", "[search criteria] - Search for a task", AccountStatus::Guide, command_findtask) ||
|
||||
command_add("findzone", "[search criteria] - Search database zones", AccountStatus::GMAdmin, command_findzone) ||
|
||||
command_add("fixmob", "[race|gender|texture|helm|face|hair|haircolor|beard|beardcolor|heritage|tattoo|detail] [next|prev] - Manipulate appearance of your target", AccountStatus::QuestTroupe, command_fixmob) ||
|
||||
command_add("flag", "[status] [acctname] - Refresh your admin status, or set an account's admin status if arguments provided", AccountStatus::Player, command_flag) ||
|
||||
command_add("flag", "[Status] [Account Name] - Refresh your admin status, or set an account's Admin status if arguments provided", AccountStatus::Player, command_flag) ||
|
||||
command_add("flagedit", "- Edit zone flags on your target. Use #flagedit help for more info.", AccountStatus::GMAdmin, command_flagedit) ||
|
||||
command_add("flags", "- displays the Zone Flags of you or your target", AccountStatus::Player, command_flags) ||
|
||||
command_add("flymode", "[0/1/2/3/4/5] - Set your or your player target's flymode to ground/flying/levitate/water/floating/levitate_running", AccountStatus::Guide, command_flymode) ||
|
||||
@@ -216,11 +216,11 @@ int command_init(void)
|
||||
command_add("interrupt", "[message id] [color] - Interrupt your casting. Arguments are optional.", AccountStatus::Guide, command_interrupt) ||
|
||||
command_add("invsnapshot", "- Manipulates inventory snapshots for your current target", AccountStatus::QuestTroupe, command_invsnapshot) ||
|
||||
command_add("invul", "[On|Off]] - Turn player target's or your invulnerable flag on or off", AccountStatus::QuestTroupe, command_invul) ||
|
||||
command_add("ipban", "[IP address] - Ban IP by character name", AccountStatus::GMMgmt, command_ipban) ||
|
||||
command_add("ipban", "[IP] - Ban IP", AccountStatus::GMMgmt, command_ipban) ||
|
||||
command_add("iplookup", "[charname] - Look up IP address of charname", AccountStatus::GMMgmt, command_iplookup) ||
|
||||
command_add("iteminfo", "- Get information about the item on your cursor", AccountStatus::Steward, command_iteminfo) ||
|
||||
command_add("itemsearch", "[search criteria] - Search for an item", AccountStatus::Steward, command_itemsearch) ||
|
||||
command_add("kick", "[charname] - Disconnect charname", AccountStatus::GMLeadAdmin, command_kick) ||
|
||||
command_add("kick", "[Character Name] - Disconnect a player by name", AccountStatus::GMLeadAdmin, command_kick) ||
|
||||
command_add("kill", "- Kill your target", AccountStatus::GMAdmin, command_kill) ||
|
||||
command_add("killallnpcs", " [npc_name] Kills all npcs by search name, leave blank for all attackable NPC's", AccountStatus::GMMgmt, command_killallnpcs) ||
|
||||
command_add("lastname", "[Last Name] - Set you or your player target's lastname", AccountStatus::Guide, command_lastname) ||
|
||||
@@ -324,9 +324,9 @@ int command_init(void)
|
||||
command_add("setgraveyard", "[zone name] - Creates a graveyard for the specified zone based on your target's LOC.", AccountStatus::GMMgmt, command_setgraveyard) ||
|
||||
command_add("sethp", "[Health] - Set your or your target's Health", AccountStatus::GMAdmin, command_sethp) ||
|
||||
command_add("setlanguage", "[language ID] [value] - Set your target's language skillnum to value", AccountStatus::Guide, command_setlanguage) ||
|
||||
command_add("setlsinfo", "[email] [password] - Set login server email address and password (if supported by login server)", AccountStatus::Steward, command_setlsinfo) ||
|
||||
command_add("setlsinfo", "[Email] [Password] - Set loginserver email address and password (if supported by loginserver)", AccountStatus::Steward, command_setlsinfo) ||
|
||||
command_add("setmana", "[Mana] - Set your or your target's Mana", AccountStatus::GMAdmin, command_setmana) ||
|
||||
command_add("setpass", "[accountname] [password] - Set local password for accountname", AccountStatus::GMLeadAdmin, command_setpass) ||
|
||||
command_add("setpass", "[Account Name] [Password] - Set local password by account name", AccountStatus::GMLeadAdmin, command_setpass) ||
|
||||
command_add("setpvppoints", "[Amount] - Set your or your player target's PVP points", AccountStatus::GMAdmin, command_setpvppoints) ||
|
||||
command_add("setskill", "[skillnum] [value] - Set your target's skill skillnum to value", AccountStatus::Guide, command_setskill) ||
|
||||
command_add("setskillall", "[Skill Level] - Set all of your or your target's skills to the specified skill level", AccountStatus::Guide, command_setskillall) ||
|
||||
|
||||
+41
-38
@@ -5,67 +5,70 @@ extern WorldServer worldserver;
|
||||
|
||||
void command_ban(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] == 0 || sep->arg[2][0] == 0) {
|
||||
c->Message(Chat::White, "Usage: #ban <charname> <message>");
|
||||
int arguments = sep->argnum;
|
||||
if (arguments < 2) {
|
||||
c->Message(Chat::White, "Usage: #ban [Character Name] [Reason]");
|
||||
return;
|
||||
}
|
||||
|
||||
auto account_id = database.GetAccountIDByChar(sep->arg[1]);
|
||||
|
||||
std::string message;
|
||||
int i = 2;
|
||||
while (1) {
|
||||
if (sep->arg[i][0] == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (message.length() > 0) {
|
||||
message.push_back(' ');
|
||||
}
|
||||
|
||||
message += sep->arg[i];
|
||||
++i;
|
||||
}
|
||||
|
||||
if (message.length() == 0) {
|
||||
c->Message(Chat::White, "Usage: #ban <charname> <message>");
|
||||
std::string character_name = sep->arg[1];
|
||||
if (character_name.empty()) {
|
||||
c->Message(Chat::White, "Usage: #ban [Character Name] [Reason]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (account_id == 0) {
|
||||
c->Message(Chat::Red, "Character does not exist.");
|
||||
std::string reason = sep->argplus[2];
|
||||
if (reason.empty()) {
|
||||
c->Message(Chat::White, "Usage: #ban [Character Name] [Reason]");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string query = StringFormat(
|
||||
"UPDATE account SET status = -2, ban_reason = '%s' "
|
||||
"WHERE id = %i", EscapeString(message).c_str(), account_id
|
||||
auto account_id = database.GetAccountIDByChar(character_name.c_str());
|
||||
if (!account_id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Character {} does not exist."
|
||||
).c_str(),
|
||||
character_name
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
auto query = fmt::format(
|
||||
"UPDATE account SET status = -2, ban_reason = '{}' WHERE id = {}",
|
||||
EscapeString(reason),
|
||||
account_id
|
||||
);
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto results = database.QueryDatabase(query);
|
||||
|
||||
c->Message(
|
||||
Chat::Red,
|
||||
"Account number %i with the character %s has been banned with message: \"%s\"",
|
||||
account_id,
|
||||
sep->arg[1],
|
||||
message.c_str());
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Account ID {} with the character {} has been banned for the following reason: \"{}\"",
|
||||
account_id,
|
||||
character_name,
|
||||
reason
|
||||
).c_str()
|
||||
);
|
||||
|
||||
ServerPacket flagUpdatePack(ServerOP_FlagUpdate, 6);
|
||||
*((uint32 *) &flagUpdatePack.pBuffer[0]) = account_id;
|
||||
*((int16 *) &flagUpdatePack.pBuffer[4]) = -2;
|
||||
ServerPacket flagUpdatePack(ServerOP_FlagUpdate, sizeof(ServerFlagUpdate_Struct));
|
||||
ServerFlagUpdate_Struct *sfus = (ServerFlagUpdate_Struct *) flagUpdatePack.pBuffer;
|
||||
sfus->account_id = account_id;
|
||||
sfus->admin = -2;
|
||||
worldserver.SendPacket(&flagUpdatePack);
|
||||
|
||||
Client *client = nullptr;
|
||||
client = entity_list.GetClientByName(sep->arg[1]);
|
||||
client = entity_list.GetClientByName(character_name.c_str());
|
||||
if (client) {
|
||||
client->WorldKick();
|
||||
return;
|
||||
}
|
||||
|
||||
ServerPacket kickPlayerPack(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
|
||||
ServerPacket kickPlayerPack(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
|
||||
ServerKickPlayer_Struct *skp = (ServerKickPlayer_Struct *) kickPlayerPack.pBuffer;
|
||||
strcpy(skp->adminname, c->GetName());
|
||||
strcpy(skp->name, sep->arg[1]);
|
||||
strcpy(skp->name, character_name.c_str());
|
||||
skp->adminrank = c->Admin();
|
||||
worldserver.SendPacket(&kickPlayerPack);
|
||||
}
|
||||
|
||||
+62
-28
@@ -5,47 +5,81 @@ extern WorldServer worldserver;
|
||||
|
||||
void command_flag(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[2][0] == 0) {
|
||||
if (!c->GetTarget() || (c->GetTarget() && c->GetTarget() == c)) {
|
||||
c->UpdateAdmin();
|
||||
c->Message(Chat::White, "Refreshed your admin flag from DB.");
|
||||
}
|
||||
else if (c->GetTarget() && c->GetTarget() != c && c->GetTarget()->IsClient()) {
|
||||
c->GetTarget()->CastToClient()->UpdateAdmin();
|
||||
c->Message(Chat::White, "%s's admin flag has been refreshed.", c->GetTarget()->GetName());
|
||||
c->GetTarget()->Message(Chat::White, "%s refreshed your admin flag.", c->GetName());
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
auto target = c->GetTarget() && c->GetTarget()->IsClient() ? c->GetTarget()->CastToClient() : c;
|
||||
if (target != c) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Status level has been refreshed for {}.",
|
||||
target->GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
|
||||
target->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Your status level has been refreshed by {}.",
|
||||
c->GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
c->Message(Chat::White, "Your status level has been refreshed.");
|
||||
}
|
||||
target->UpdateAdmin();
|
||||
return;
|
||||
}
|
||||
else if (!sep->IsNumber(1) || atoi(sep->arg[1]) < -2 || atoi(sep->arg[1]) > 255 || strlen(sep->arg[2]) == 0) {
|
||||
c->Message(Chat::White, "Usage: #flag [status] [acctname]");
|
||||
|
||||
|
||||
if (
|
||||
!sep->IsNumber(1) ||
|
||||
strlen(sep->arg[2]) == 0
|
||||
) {
|
||||
c->Message(Chat::White, "Usage: #flag [Status] [Account Name]");
|
||||
return;
|
||||
}
|
||||
|
||||
else if (c->Admin() < commandChangeFlags) {
|
||||
//this check makes banning players by less than this level
|
||||
//impossible, but i'll leave it in anyways
|
||||
auto status = std::stoi(sep->arg[1]);
|
||||
if (status < -2 || status > 255) {
|
||||
c->Message(Chat::White, "The lowest a status level can go is -2 and the highest a status level can go is 255.");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string account_name = sep->argplus[2];
|
||||
auto account_id = database.GetAccountIDByChar(account_name.c_str());
|
||||
|
||||
if (c->Admin() < commandChangeFlags) { //this check makes banning players by less than this level impossible, but i'll leave it in anyways
|
||||
c->Message(Chat::White, "You may only refresh your own flag, doing so now.");
|
||||
c->UpdateAdmin();
|
||||
}
|
||||
else {
|
||||
if (atoi(sep->arg[1]) > c->Admin()) {
|
||||
c->Message(Chat::White, "You cannot set people's status to higher than your own");
|
||||
}
|
||||
else if (atoi(sep->arg[1]) < 0 && c->Admin() < commandBanPlayers) {
|
||||
c->Message(Chat::White, "You have too low of status to suspend/ban");
|
||||
}
|
||||
else if (!database.SetAccountStatus(sep->argplus[2], atoi(sep->arg[1]))) {
|
||||
c->Message(Chat::White, "Unable to set GM Flag.");
|
||||
} else {
|
||||
if (status > c->Admin()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You cannot set someone's status level to {} because your status level is only {}.",
|
||||
status,
|
||||
c->Admin()
|
||||
).c_str()
|
||||
);
|
||||
} else if (status < 0 && c->Admin() < commandBanPlayers) {
|
||||
c->Message(Chat::White, "Your status level is not high enough to ban or suspend.");
|
||||
} else if (!database.SetAccountStatus(account_name, status)) {
|
||||
c->Message(Chat::White, "Failed to set status level.");
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Set GM Flag on account.");
|
||||
|
||||
std::string user;
|
||||
std::string loginserver;
|
||||
ParseAccountString(sep->argplus[2], user, loginserver);
|
||||
ParseAccountString(account_name, user, loginserver);
|
||||
|
||||
ServerPacket pack(ServerOP_FlagUpdate, 6);
|
||||
*((uint32 *) pack.pBuffer) = database.GetAccountIDByName(user.c_str(), loginserver.c_str());
|
||||
*((int16 *) &pack.pBuffer[4]) = atoi(sep->arg[1]);
|
||||
account_id = database.GetAccountIDByName(account_name, loginserver);
|
||||
|
||||
ServerPacket pack(ServerOP_FlagUpdate, sizeof(ServerFlagUpdate_Struct));
|
||||
ServerFlagUpdate_Struct *sfus = (ServerFlagUpdate_Struct *) pack.pBuffer;
|
||||
sfus->account_id = account_id;
|
||||
sfus->admin = status;
|
||||
worldserver.SendPacket(&pack);
|
||||
}
|
||||
}
|
||||
|
||||
+25
-13
@@ -2,20 +2,32 @@
|
||||
|
||||
void command_ipban(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1] == 0) {
|
||||
c->Message(Chat::White, "Usage: #ipban [xxx.xxx.xxx.xxx]");
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #ipban [IP]");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (database.AddBannedIP(sep->arg[1], c->GetName())) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"%s has been successfully added to the banned_ips table by %s",
|
||||
sep->arg[1],
|
||||
c->GetName());
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "IPBan Failed (IP address is possibly already in the table?)");
|
||||
}
|
||||
|
||||
std::string ip = sep->arg[1];
|
||||
if (ip.empty()) {
|
||||
c->Message(Chat::White, "Usage: #ipban [IP]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (database.AddBannedIP(ip, c->GetName())) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"IP '{}' has been successfully banned.",
|
||||
ip
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"IP '{}' has failed to be banned, the IP address may already be in the table.",
|
||||
ip
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+29
-24
@@ -5,32 +5,37 @@ extern WorldServer worldserver;
|
||||
|
||||
void command_kick(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] == 0) {
|
||||
c->Message(Chat::White, "Usage: #kick [charname]");
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #kick [Character Name]");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
Client *client = entity_list.GetClientByName(sep->arg[1]);
|
||||
if (client != 0) {
|
||||
if (client->Admin() <= c->Admin()) {
|
||||
client->Message(Chat::White, "You have been kicked by %s", c->GetName());
|
||||
auto outapp = new EQApplicationPacket(OP_GMKick, 0);
|
||||
client->QueuePacket(outapp);
|
||||
client->Kick("Ordered kicked by command");
|
||||
c->Message(Chat::White, "Kick: local: kicking %s", sep->arg[1]);
|
||||
}
|
||||
}
|
||||
else if (!worldserver.Connected()) {
|
||||
c->Message(Chat::White, "Error: World server disconnected");
|
||||
}
|
||||
else {
|
||||
auto pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
|
||||
ServerKickPlayer_Struct *skp = (ServerKickPlayer_Struct *) pack->pBuffer;
|
||||
strcpy(skp->adminname, c->GetName());
|
||||
strcpy(skp->name, sep->arg[1]);
|
||||
skp->adminrank = c->Admin();
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
|
||||
std::string character_name = sep->arg[1];
|
||||
auto client = entity_list.GetClientByName(character_name.c_str());
|
||||
if (client) {
|
||||
if (client->Admin() <= c->Admin()) {
|
||||
auto outapp = new EQApplicationPacket(OP_GMKick, 0);
|
||||
client->QueuePacket(outapp);
|
||||
client->Kick("Ordered kicked by command");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} has been kicked from the server.",
|
||||
character_name
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
} else if (!worldserver.Connected()) {
|
||||
c->Message(Chat::White, "The world server is currently disconnected.");
|
||||
} else {
|
||||
auto pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
|
||||
ServerKickPlayer_Struct *skp = (ServerKickPlayer_Struct *) pack->pBuffer;
|
||||
strcpy(skp->adminname, c->GetName());
|
||||
strcpy(skp->name, character_name.c_str());
|
||||
skp->adminrank = c->Admin();
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
@@ -2,28 +2,50 @@
|
||||
|
||||
void command_setpass(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->argnum != 2) {
|
||||
c->Message(Chat::White, "Format: #setpass accountname password");
|
||||
int arguments = sep->argnum;
|
||||
if (arguments < 2) {
|
||||
c->Message(Chat::White, "Usage: #setpass [Account Name] [Password]");
|
||||
return;
|
||||
}
|
||||
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.");
|
||||
}
|
||||
std::string account_name;
|
||||
std::string loginserver;
|
||||
ParseAccountString(sep->arg[1], account_name, loginserver);
|
||||
int16 status = 0;
|
||||
auto account_id = database.GetAccountIDByName(account_name, loginserver, &status);
|
||||
if (!account_id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Account {} not found.",
|
||||
account_name
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (status > c->Admin()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You cannot change the password for Account {} as its status is higher than yours.",
|
||||
account_name
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Password {} changed for Account {}.",
|
||||
(
|
||||
database.SetLocalPassword(account_id, sep->arg[2]) ?
|
||||
"successfully" :
|
||||
"failed"
|
||||
),
|
||||
account_name
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2555,7 +2555,7 @@ void QuestManager::whisper(const char *message) {
|
||||
|
||||
std::string mob_name = owner->GetCleanName();
|
||||
std::string new_message = fmt::format("{} whispers, '{}'", mob_name, message);
|
||||
initiator->Message(315, new_message.c_str());
|
||||
initiator->Message(Chat::EchoChat1, new_message.c_str());
|
||||
}
|
||||
|
||||
int QuestManager::getlevel(uint8 type)
|
||||
|
||||
Reference in New Issue
Block a user