So, i’ve done some research for gmOut, maybe that would work :
In accountMgr.h :
modify the UpdateAccountAccess prototype to get a new argument and create a new prototype for the timestamp :
void UpdateAccountAccess(rbac::RBACData* rbac, uint32 accountId, uint8 securityLevel, int32 realmId, std::string gmOut);
std::string GetGmOut(char* arg4);
In accountMgr.cpp :
Modify the function UpdateAccountAccess and create the function GetGmOut :
void AccountMgr::UpdateAccountAccess(rbac::RBACData* rbac, uint32 accountId, uint8 securityLevel, int32 realmId, std::string gmOut)
{
if (rbac && securityLevel == rbac->GetSecurityLevel())
rbac->SetSecurityLevel(securityLevel);
// Delete old security level from DB
if (realmId == -1)
{
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS);
stmt->setUInt32(0, accountId);
LoginDatabase.Execute(stmt);
}
else
{
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM);
stmt->setUInt32(0, accountId);
stmt->setUInt32(1, realmId);
LoginDatabase.Execute(stmt);
}
// Add new security level
if (securityLevel)
{
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS);
stmt->setUInt32(0, accountId);
stmt->setUInt8(1, securityLevel);
stmt->setInt32(2, realmId);
stmt->setString(4, gmOut);
LoginDatabase.Execute(stmt);
}
}
std::string AccountMgr::GetGmOut(char* arg4)
{
//Transforming the days in second
*arg4 = *arg4 * 86400;
time_t t = time(NULL);
//Adding second to the actual timestamp
t += *arg4;
struct tm *tm = localtime(&t);
char date[32];
//Getting the correct form
strftime(date, sizeof(date), “%Y-%m-%d %H:%M:%S”, tm);
//Transforming the char* date into a string
std::string gmOut = std::string(date);
return(gmOut);
}
And in cs_account.cpp :
add a new argument for the command, and create the gmOut variable :
char* arg1 = strtok((char*)args, " ");
char* arg2 = strtok(NULL, " ");
char* arg3 = strtok(NULL, " ");
char* arg4 = strtok(NULL, " ");
bool isAccountNameGiven = true;
std::string gmOut;
Call the function getGmOut and modify the command :
sAccountMgr->GetGmOut(arg4);
rbac::RBACData* rbac = isAccountNameGiven ? NULL : handler->getSelectedPlayer()->GetSession()->GetRBACData();
sAccountMgr->UpdateAccountAccess(rbac, targetAccountId, uint8(gm), gmRealmID, gmOut);
handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm, gmOut);
return true;
Ps : I don’t have experience in c++, so maybe that it’s false.
There isn’t any errors on building, but i dont have try to run wordlserver or test the command.