Changeset 112 for trunk/src/game/Level0.cpp
- Timestamp:
- 11/19/08 13:37:14 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Level0.cpp
r102 r112 36 36 bool ChatHandler::HandleHelpCommand(const char* args) 37 37 { 38 if(!*args) 39 return false; 40 41 char* cmd = strtok((char*)args, " "); 38 char* cmd = strtok((char*)args, " "); 42 39 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 } 47 49 48 50 return true; … … 55 57 } 56 58 57 bool ChatHandler::HandleAcc tCommand(const char* /*args*/)59 bool ChatHandler::HandleAccountCommand(const char* /*args*/) 58 60 { 59 61 uint32 gmlevel = m_session->GetSecurity(); … … 142 144 } 143 145 144 bool ChatHandler::HandleGMList Command(const char* /*args*/)146 bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/) 145 147 { 146 148 bool first = true; … … 150 152 for(; itr != m.end(); ++itr) 151 153 { 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())) ) 154 157 { 155 158 if(first) … … 178 181 char *new_pass_c = strtok (NULL, " "); 179 182 180 if ( !old_pass || !new_pass || !new_pass_c)183 if (!old_pass || !new_pass || !new_pass_c) 181 184 return false; 182 185 … … 185 188 std::string password_new_c = new_pass_c; 186 189 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); 191 201 return false; 192 202 } … … 199 209 SendSysMessage(LANG_COMMAND_PASSWORD); 200 210 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 201 216 default: 202 217 SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD); … … 234 249 return true; 235 250 } 251 252 /// Display the 'Message of the day' for the realm 253 bool ChatHandler::HandleServerMotdCommand(const char* /*args*/) 254 { 255 PSendSysMessage(LANG_MOTD_CURRENT, sWorld.GetMotd()); 256 return true; 257 }