Show
Ignore:
Timestamp:
11/19/08 13:37:14 (17 years ago)
Author:
yumileroy
Message:

[svn] * Merge CLI Commands with regular commands and give them level4 access. sec_console. Source mangos - thanks to ogeraisi for the amalgamated patch.
* Redid/Fixed/Added some lang strings.
* As usual remember this is a trunk rev so stability only guaranteed on northern countries of Mars and western parts of Pluto. No warranties outside the solar system, sorry :( . Check with your local government or dictator on regulations regarding export.

Original author: KingPin?
Date: 2008-10-26 13:32:42-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Level0.cpp

    r102 r112  
    3636bool ChatHandler::HandleHelpCommand(const char* args) 
    3737{ 
    38     if(!*args) 
    39         return false; 
    40  
    41     char* cmd = strtok((char*)args, " "); 
     38        char* cmd = strtok((char*)args, " "); 
    4239    if(!cmd) 
    43         return false; 
    44  
    45     if(!ShowHelpForCommand(getCommandTable(), cmd)) 
    46         SendSysMessage(LANG_NO_HELP_CMD); 
     40        { 
     41                ShowHelpForCommand(getCommandTable(), "help"); 
     42                ShowHelpForCommand(getCommandTable(), ""); 
     43        } 
     44        else 
     45        { 
     46                if(!ShowHelpForCommand(getCommandTable(), cmd)) 
     47                        SendSysMessage(LANG_NO_HELP_CMD); 
     48        } 
    4749 
    4850    return true; 
     
    5557} 
    5658 
    57 bool ChatHandler::HandleAcctCommand(const char* /*args*/) 
     59bool ChatHandler::HandleAccountCommand(const char* /*args*/) 
    5860{ 
    5961    uint32 gmlevel = m_session->GetSecurity(); 
     
    142144} 
    143145 
    144 bool ChatHandler::HandleGMListCommand(const char* /*args*/) 
     146bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/) 
    145147{ 
    146148    bool first = true; 
     
    150152    for(; itr != m.end(); ++itr) 
    151153    { 
    152         if( itr->second->GetSession()->GetSecurity() && (itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST) ) && 
    153             itr->second->IsVisibleGloballyFor(m_session->GetPlayer()) ) 
     154        if (itr->second->GetSession()->GetSecurity() && 
     155                        (itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST)) && 
     156                        (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())) ) 
    154157        { 
    155158            if(first) 
     
    178181    char *new_pass_c  = strtok (NULL, " "); 
    179182 
    180     if( !old_pass || !new_pass || !new_pass_c ) 
     183    if (!old_pass || !new_pass || !new_pass_c) 
    181184        return false; 
    182185 
     
    185188    std::string password_new_c = new_pass_c; 
    186189 
    187     if(!accmgr.CheckPassword(m_session->GetAccountId(), password_old) || password_new != password_new_c) 
    188     { 
    189         SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD); 
    190         SetSentErrorMessage(true); 
     190    if (password_new != password_new_c) 
     191    { 
     192        SendSysMessage (LANG_NEW_PASSWORDS_NOT_MATCH); 
     193                SetSentErrorMessage (true); 
     194                return false; 
     195        } 
     196 
     197        if (!accmgr.CheckPassword (m_session->GetAccountId(), password_old)) 
     198        { 
     199                SendSysMessage (LANG_COMMAND_WRONGOLDPASSWORD); 
     200                SetSentErrorMessage (true); 
    191201        return false; 
    192202    } 
     
    199209            SendSysMessage(LANG_COMMAND_PASSWORD); 
    200210            break; 
     211                case AOR_PASS_TOO_LONG: 
     212                        SendSysMessage(LANG_PASSWORD_TOO_LONG); 
     213                        SetSentErrorMessage(true); 
     214                        return false; 
     215                case AOR_NAME_NOT_EXIST:                            // not possible case, don't want get account name for output 
    201216        default: 
    202217            SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD); 
     
    234249    return true; 
    235250} 
     251 
     252/// Display the 'Message of the day' for the realm 
     253bool ChatHandler::HandleServerMotdCommand(const char* /*args*/) 
     254{ 
     255        PSendSysMessage(LANG_MOTD_CURRENT, sWorld.GetMotd()); 
     256        return true; 
     257}