300 std::string targetName;
304 char const* newNameStr = strtok(
NULL,
" ");
308 std::string playerOldName;
309 std::string newName = newNameStr;
317 playerOldName = target->GetName();
369 target->SetName(newName);
372 session->KickPlayer();
382 sWorld->UpdateCharacterInfo(targetGuid, newName);
388 if (
Player* player = session->GetPlayer())
389 sLog->outCommand(session->GetAccountId(),
"GM %s (Account: %u) forced rename %s to player %s (Account: %u)", player->GetName().c_str(), session->GetAccountId(), newName.c_str(), playerOldName.c_str(),
ObjectMgr::GetPlayerAccountIdByGUID(targetGuid));
392 sLog->outCommand(0,
"CONSOLE forced rename '%s' to '%s' (%s)", playerOldName.c_str(), newName.c_str(), targetGuid.
ToString().c_str());
403 target->SetAtLoginFlag(AT_LOGIN_RENAME);
411 std::string oldNameLink = handler->
playerLink(targetName);
static ResponseCodes CheckPlayerName(std::string const &name, LocaleConstant locale, bool create=false)
Definition: ObjectMgr.cpp:7580
Definition: Language.h:198
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
Definition: Language.h:282
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
Definition: CharacterDatabase.h:429
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
arena_t NULL
Definition: jemalloc_internal.h:624
#define sLog
Definition: Log.h:154
Definition: SharedDefines.h:4505
#define sWorld
Definition: World.h:887
bool extractPlayerTarget(char *args, Player **player, ObjectGuid *player_guid=NULL, std::string *player_name=NULL)
Definition: Chat.cpp:945
#define sObjectMgr
Definition: ObjectMgr.h:1567
uint16_t uint16
Definition: g3dmath.h:166
Definition: PreparedStatement.h:74
Definition: CharacterDatabase.h:322
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
bool normalizePlayerName(std::string &name)
Definition: ObjectMgr.cpp:133
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: CharacterDatabase.h:37
void setUInt16(const uint8 index, const uint16 value)
Definition: PreparedStatement.cpp:106
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
Definition: Language.h:139
static bool GetPlayerNameByGUID(ObjectGuid const &guid, std::string &name)
Definition: ObjectMgr.cpp:2258
Definition: CharacterDatabase.h:155
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
WorldSession * GetSession()
Definition: Chat.h:59
static uint32 GetPlayerAccountIdByGUID(ObjectGuid const &guid)
Definition: ObjectMgr.cpp:2302
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
Definition: Language.h:283
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
Player session in the World.
Definition: WorldSession.h:882
Definition: ObjectGuid.h:189
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
Definition: Language.h:121
std::string ToString() const
Definition: ObjectGuid.cpp:99
std::string playerLink(std::string const &name) const
Definition: Chat.h:132
Definition: Language.h:120
LowType GetCounter() const
Definition: ObjectGuid.h:221