mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
* initial work, need to clean up gm commands still * cleaned up command, works without kicking char select now * remove thj-specific methods * add script hooks * actually clear flag * rework questmgr::rename * remove unnecessary logging * revert * added missing binding to perl api and updated some text * don't return a value * Fix some bad argument types. * adjust case * alpha order * refactor some old string stuff * don't quote integers, bob --------- Co-authored-by: Zimp <zimp@zenryo.xyz> Co-authored-by: Chris Miles <akkadius1@gmail.com>
40 lines
805 B
C++
Executable File
40 lines
805 B
C++
Executable File
#include "../../client.h"
|
|
|
|
void SetName(Client *c, const Seperator *sep)
|
|
{
|
|
const auto arguments = sep->argnum;
|
|
if (arguments < 2) {
|
|
c->Message(Chat::White, "Usage: #set name [Name]");
|
|
return;
|
|
}
|
|
|
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
|
auto t = c->GetTarget()->CastToClient();
|
|
|
|
std::string new_name = sep->arg[2];
|
|
std::string old_name = t->GetCleanName();
|
|
|
|
if (t->ChangeFirstName(new_name, c->GetCleanName())) {
|
|
c->Message(
|
|
Chat::White,
|
|
fmt::format(
|
|
"Successfully renamed {} to {}",
|
|
old_name,
|
|
new_name
|
|
).c_str()
|
|
);
|
|
|
|
return;
|
|
}
|
|
|
|
c->Message(
|
|
Chat::White,
|
|
fmt::format(
|
|
"Unable to rename {}. Check that the new name '{}' isn't already taken (Including Pet Names), or isn't invalid",
|
|
old_name,
|
|
new_name
|
|
).c_str()
|
|
);
|
|
}
|
|
}
|