aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level2.cpp
diff options
context:
space:
mode:
authorAnubisss <none@none>2009-07-05 00:37:05 +0200
committerAnubisss <none@none>2009-07-05 00:37:05 +0200
commitd78c917effceb3a5624ce5410a6b396511efb444 (patch)
tree0d5b3dee7c633453fddec2f069adeab9822fdd0e /src/game/Level2.cpp
parent07e441fe577b2e82662db83d94912ba20046ec98 (diff)
*Print the account's email in command pinfo. Based on Charlie's patch.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Level2.cpp')
-rw-r--r--src/game/Level2.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 75bd8357200..73bfb7bd96b 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -2282,21 +2282,26 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
}
std::string username = GetTrinityString(LANG_ERROR);
+ std::string email = GetTrinityString(LANG_ERROR);
std::string last_ip = GetTrinityString(LANG_ERROR);
uint32 security = 0;
std::string last_login = GetTrinityString(LANG_ERROR);
- QueryResult* result = LoginDatabase.PQuery("SELECT username,gmlevel,last_ip,last_login FROM account WHERE id = '%u'",accId);
+ QueryResult* result = LoginDatabase.PQuery("SELECT username,gmlevel,email,last_ip,last_login FROM account WHERE id = '%u'",accId);
if(result)
{
Field* fields = result->Fetch();
username = fields[0].GetCppString();
security = fields[1].GetUInt32();
+ email = fields[2].GetCppString();
+
+ if(email.empty())
+ email = "-";
if(!m_session || m_session->GetSecurity() >= security)
{
- last_ip = fields[2].GetCppString();
- last_login = fields[3].GetCppString();
+ last_ip = fields[3].GetCppString();
+ last_login = fields[4].GetCppString();
}
else
{
@@ -2309,7 +2314,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
std::string nameLink = playerLink(target_name);
- PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetMangosString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(target_guid), username.c_str(), accId, security, last_ip.c_str(), last_login.c_str(), latency);
+ PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetTrinityString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(target_guid), username.c_str(), accId, email.c_str(), security, last_ip.c_str(), last_login.c_str(), latency);
std::string timeStr = secsToTimeString(total_player_time,true,true);
uint32 gold = money /GOLD;