diff options
| author | Spp <none@none> | 2010-08-23 07:51:19 +0200 |
|---|---|---|
| committer | Spp <none@none> | 2010-08-23 07:51:19 +0200 |
| commit | 16d95d3115b27536e7a1c99e795a5f90c238eb16 (patch) | |
| tree | c439bd1f062af3643285ebfe5cbb12d2916180dd /src/server/game/Chat/Commands | |
| parent | ccc2a83510c2dcdcaba1c9c1f1778b8f171e0c4c (diff) | |
Core: Fix some warnings
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Chat/Commands')
| -rw-r--r-- | src/server/game/Chat/Commands/Level0.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Chat/Commands/Level2.cpp | 10 | ||||
| -rw-r--r-- | src/server/game/Chat/Commands/Level3.cpp | 34 |
3 files changed, 29 insertions, 21 deletions
diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp index 6e4e969e017..aef769723e3 100644 --- a/src/server/game/Chat/Commands/Level0.cpp +++ b/src/server/game/Chat/Commands/Level0.cpp @@ -147,7 +147,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/) // save if the player has last been saved over 20 seconds ago uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE); - if ((save_interval == 0 || save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS)) + if (save_interval == 0 || (save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS)) player->SaveToDB(); return true; @@ -162,7 +162,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/) for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { AccountTypes itr_sec = itr->second->GetSession()->GetSecurity(); - if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST))) && + if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= AccountTypes(sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) && (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer()))) { if (first) @@ -252,7 +252,7 @@ bool ChatHandler::HandleAccountAddonCommand(const char* args) uint32 account_id = m_session->GetAccountId(); int expansion = atoi(szExp); //get int anyway (0 if error) - if (expansion < 0 || expansion > sWorld.getConfig(CONFIG_EXPANSION)) + if (expansion < 0 || uint8(expansion) > sWorld.getConfig(CONFIG_EXPANSION)) { SendSysMessage(LANG_IMPROPER_VALUE); SetSentErrorMessage(true); diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 99006a9cc0c..548271a6266 100644 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -2258,7 +2258,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) if (email.empty()) email = "-"; - if (!m_session || m_session->GetSecurity() >= security) + if (!m_session || m_session->GetSecurity() >= AccountTypes(security)) { last_ip = fields[3].GetCppString(); last_login = fields[4].GetCppString(); @@ -3073,7 +3073,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args) return false; } - sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u"); + sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point); // set "wpguid" column to the visual waypoint WorldDatabase.PExecute("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point); @@ -3544,7 +3544,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args) GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); - if (event_id < 1 || event_id >=events.size()) + if (event_id < 1 || uint32(event_id) >= events.size()) { SendSysMessage(LANG_EVENT_NOT_EXIST); SetSentErrorMessage(true); @@ -3585,7 +3585,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args) GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); - if (event_id < 1 || event_id >=events.size()) + if (event_id < 1 || uint32(event_id) >= events.size()) { SendSysMessage(LANG_EVENT_NOT_EXIST); SetSentErrorMessage(true); @@ -4236,7 +4236,7 @@ bool ChatHandler::HandleNpcSetLinkCommand(const char* args) if (!pCreature->GetDBTableGUIDLow()) { - PSendSysMessage("Selected creature isn't in creature table", pCreature->GetGUIDLow()); + PSendSysMessage("Selected creature %u isn't in creature table", pCreature->GetGUIDLow()); SetSentErrorMessage(true); return false; } diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 118d03f0edd..0f993befb7e 100644 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1171,7 +1171,11 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char *args) // m_session == NULL only for console targetAccountId = (isAccountNameGiven) ? sAccountMgr.GetId(targetAccountName) : getSelectedPlayer()->GetSession()->GetAccountId(); int32 gmRealmID = (isAccountNameGiven) ? atoi(arg3) : atoi(arg2); - uint32 plSecurity = m_session ? sAccountMgr.GetSecurity(m_session->GetAccountId(), gmRealmID) : SEC_CONSOLE; + uint32 plSecurity; + if (m_session) + plSecurity = sAccountMgr.GetSecurity(m_session->GetAccountId(), gmRealmID); + else + plSecurity = SEC_CONSOLE; // can set security level only for target with less security and to less security that we have // This is also reject self apply in fact @@ -2943,12 +2947,13 @@ bool ChatHandler::HandleLookupItemCommand(const char *args) int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { + uint8 uloc_idx = uint8(loc_idx); ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId); if (il) { - if (il->Name.size() > loc_idx && !il->Name[loc_idx].empty()) + if (il->Name.size() > uloc_idx && !il->Name[uloc_idx].empty()) { - std::string name = il->Name[loc_idx]; + std::string name = il->Name[uloc_idx]; if (Utf8FitTo(name, wnamepart)) { @@ -3257,12 +3262,13 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args) int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { + uint8 uloc_idx = uint8(loc_idx); QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId()); if (il) { - if (il->Title.size() > loc_idx && !il->Title[loc_idx].empty()) + if (il->Title.size() > uloc_idx && !il->Title[uloc_idx].empty()) { - std::string title = il->Title[loc_idx]; + std::string title = il->Title[uloc_idx]; if (Utf8FitTo(title, wnamepart)) { @@ -3361,12 +3367,13 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { + uint8 uloc_idx = uint8(uloc_idx); CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id); if (cl) { - if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty ()) + if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty ()) { - std::string name = cl->Name[loc_idx]; + std::string name = cl->Name[uloc_idx]; if (Utf8FitTo (name, wnamepart)) { @@ -3431,12 +3438,13 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args) int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { + uint8 uloc_idx = uint8(uloc_idx); GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id); if (gl) { - if (gl->Name.size() > loc_idx && !gl->Name[loc_idx].empty()) + if (gl->Name.size() > uloc_idx && !gl->Name[uloc_idx].empty()) { - std::string name = gl->Name[loc_idx]; + std::string name = gl->Name[uloc_idx]; if (Utf8FitTo(name, wnamepart)) { @@ -5149,7 +5157,7 @@ bool ChatHandler::HandleServerRestartCommand(const char *args) int32 time = atoi (time_str); ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0') || time < 0)) + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) return false; if (exitcode_str) @@ -5184,7 +5192,7 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char *args) int32 time = atoi (time_str); ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0') || time < 0)) + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) return false; if (exitcode_str) @@ -5219,7 +5227,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char *args) int32 time = atoi (time_str); ///- Prevent interpret wrong arg value as 0 secs shutdown time - if (time == 0 && (time_str[0] != '0' || time_str[1] != '\0') || time < 0) + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) return false; if (exitcode_str) @@ -6719,7 +6727,7 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char *args) return false; int expansion = atoi(szExp); //get int anyway (0 if error) - if (expansion < 0 || expansion > sWorld.getConfig(CONFIG_EXPANSION)) + if (expansion < 0 || uint8(expansion) > sWorld.getConfig(CONFIG_EXPANSION)) return false; // No SQL injection |
