mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 04:37:02 +00:00
* [2008_10_21_01_mangos_mangos_string.sql,2008_10_21_02_mangos_command.sql] Merge CLI command proccessing to chat command proccessing.
Now console/RA uas same commads as used in chat if selected command marked as safe for console. Some commands accessable only at console and have security level 4. See sql update for new command names. Not all commands that safe (or can be modified to safe) for console allowed currently for use in console input, this will be fixed later.
This commit is contained in:
parent
c9026395fc
commit
26dc8c07ab
19 changed files with 1216 additions and 1549 deletions
|
|
@ -52,7 +52,7 @@ bool ChatHandler::HandleCommandsCommand(const char* args)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleAcctCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleAccountCommand(const char* /*args*/)
|
||||
{
|
||||
uint32 gmlevel = m_session->GetSecurity();
|
||||
PSendSysMessage(LANG_ACCOUNT_LEVEL, gmlevel);
|
||||
|
|
@ -139,7 +139,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGMListCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleGMListOnlineCommand(const char* /*args*/)
|
||||
{
|
||||
bool first = true;
|
||||
|
||||
|
|
@ -147,8 +147,9 @@ bool ChatHandler::HandleGMListCommand(const char* /*args*/)
|
|||
HashMapHolder<Player>::MapType::iterator itr = m.begin();
|
||||
for(; itr != m.end(); ++itr)
|
||||
{
|
||||
if( itr->second->GetSession()->GetSecurity() && (itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST) ) &&
|
||||
itr->second->IsVisibleGloballyFor(m_session->GetPlayer()) )
|
||||
if (itr->second->GetSession()->GetSecurity() &&
|
||||
(itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST)) &&
|
||||
(!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())) )
|
||||
{
|
||||
if(first)
|
||||
{
|
||||
|
|
@ -175,17 +176,24 @@ bool ChatHandler::HandlePasswordCommand(const char* args)
|
|||
char *new_pass = strtok (NULL, " ");
|
||||
char *new_pass_c = strtok (NULL, " ");
|
||||
|
||||
if( !old_pass || !new_pass || !new_pass_c )
|
||||
if (!old_pass || !new_pass || !new_pass_c)
|
||||
return false;
|
||||
|
||||
std::string password_old = old_pass;
|
||||
std::string password_new = new_pass;
|
||||
std::string password_new_c = new_pass_c;
|
||||
|
||||
if(!accmgr.CheckPassword(m_session->GetAccountId(), password_old) || password_new != password_new_c)
|
||||
if (password_new != password_new_c)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD);
|
||||
SetSentErrorMessage(true);
|
||||
SendSysMessage (LANG_NEW_PASSWORDS_NOT_MATCH);
|
||||
SetSentErrorMessage (true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!accmgr.CheckPassword (m_session->GetAccountId(), password_old))
|
||||
{
|
||||
SendSysMessage (LANG_COMMAND_WRONGOLDPASSWORD);
|
||||
SetSentErrorMessage (true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -196,6 +204,11 @@ bool ChatHandler::HandlePasswordCommand(const char* args)
|
|||
case AOR_OK:
|
||||
SendSysMessage(LANG_COMMAND_PASSWORD);
|
||||
break;
|
||||
case AOR_PASS_TOO_LONG:
|
||||
SendSysMessage(LANG_PASSWORD_TOO_LONG);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
case AOR_NAME_NOT_EXIST: // not possible case, don't want get account name for output
|
||||
default:
|
||||
SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD);
|
||||
SetSentErrorMessage(true);
|
||||
|
|
@ -231,3 +244,10 @@ bool ChatHandler::HandleLockAccountCommand(const char* args)
|
|||
SendSysMessage(LANG_USE_BOL);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Display the 'Message of the day' for the realm
|
||||
bool ChatHandler::HandleServerMotdCommand(const char* /*args*/)
|
||||
{
|
||||
PSendSysMessage(LANG_MOTD_CURRENT, sWorld.GetMotd());
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue