diff options
| author | silinoron <none@none> | 2010-08-23 19:56:47 -0700 |
|---|---|---|
| committer | silinoron <none@none> | 2010-08-23 19:56:47 -0700 |
| commit | 8649bee17fdd477623465a0ef22abe4d80b74fc3 (patch) | |
| tree | f652ac8f180d88345cfd5ecdc779b4296d154189 /src/server/game/Server | |
| parent | b30800e9bcc38faf4bcbe443240a6d0797ad88e5 (diff) | |
Replace World::getConfig with World::getFloatConfig, World::getIntConfig, and World::getBoolConfig.
Also fix a warning from a previous commit.
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Server')
18 files changed, 83 insertions, 85 deletions
diff --git a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp index 172ec7aa9bd..01332852fc7 100644 --- a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp @@ -100,7 +100,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) return; } - if (player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S); return; @@ -117,7 +117,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow())) return; - if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam()) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam()) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); return; @@ -168,7 +168,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) return; } - if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(at->GetCaptain())) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(at->GetCaptain())) { // not let enemies sign petition SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_NOT_ALLIED); diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index 1dde93511fa..4d8b544b850 100644 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -56,9 +56,9 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) //this void causes that auction window is opened void WorldSession::SendAuctionHello(uint64 guid, Creature* unit) { - if (GetPlayer()->getLevel() < sWorld.getConfig(CONFIG_AUCTION_LEVEL_REQ)) + if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_AUCTION_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_AUCTION_REQ), sWorld.getConfig(CONFIG_AUCTION_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_AUCTION_REQ), sWorld.getIntConfig(CONFIG_AUCTION_LEVEL_REQ)); return; } @@ -204,7 +204,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) return; } - if (GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) + if (GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog.outCommand(GetAccountId(),"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", GetPlayerName(),GetAccountId(),it->GetProto()->Name1,it->GetEntry(),it->GetCount()); @@ -216,7 +216,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) AuctionEntry *AH = new AuctionEntry; AH->Id = sObjectMgr.GenerateAuctionID(); - if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) + if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) AH->auctioneer = 23442; else AH->auctioneer = GUID_LOPART(auctioneer); diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 0130623e0fa..5454268f87a 100644 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -84,7 +84,7 @@ bool LoginQueryHolder::Initialize() res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSOCIALLIST, "SELECT friend,flags,note FROM character_social WHERE guid = '%u' LIMIT 255", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADHOMEBIND, "SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLCOOLDOWNS, "SELECT spell,item,time FROM character_spell_cooldown WHERE guid = '%u'", GUID_LOPART(m_guid)); - if (sWorld.getConfig(CONFIG_DECLINED_NAMES_USED)) + if (sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED)) res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = '%u'",GUID_LOPART(m_guid)); // in other case still be dummy query res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGUILD, "SELECT guildid,rank FROM guild_member WHERE guid = '%u'", GUID_LOPART(m_guid)); @@ -132,7 +132,7 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/) /// get all the data necessary for loading all characters (along with their pets) on the account m_charEnumCallback = CharacterDatabase.AsyncPQuery( - !sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) ? + !sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) ? // ------- Query Without Declined Names -------- // 0 1 2 3 4 5 6 7 "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, " @@ -173,7 +173,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) if (GetSecurity() == SEC_PLAYER) { - if (uint32 mask = sWorld.getConfig(CONFIG_CHARACTERS_CREATING_DISABLED)) + if (uint32 mask = sWorld.getIntConfig(CONFIG_CHARACTERS_CREATING_DISABLED)) { bool disabled = false; @@ -260,7 +260,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) Field *fields=resultacct->Fetch(); uint32 acctcharcount = fields[0].GetUInt32(); - if (acctcharcount >= sWorld.getConfig(CONFIG_CHARACTERS_PER_ACCOUNT)) + if (acctcharcount >= sWorld.getIntConfig(CONFIG_CHARACTERS_PER_ACCOUNT)) { data << (uint8)CHAR_CREATE_ACCOUNT_LIMIT; SendPacket(&data); @@ -275,7 +275,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) Field *fields=result->Fetch(); charcount = fields[0].GetUInt8(); - if (charcount >= sWorld.getConfig(CONFIG_CHARACTERS_PER_REALM)) + if (charcount >= sWorld.getIntConfig(CONFIG_CHARACTERS_PER_REALM)) { data << (uint8)CHAR_CREATE_SERVER_LIMIT; SendPacket(&data); @@ -284,7 +284,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) } // speedup check for heroic class disabled case - uint32 heroic_free_slots = sWorld.getConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM); + uint32 heroic_free_slots = sWorld.getIntConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM); if (heroic_free_slots == 0 && GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT) { data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT; @@ -293,16 +293,16 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) } // speedup check for heroic class disabled case - uint32 req_level_for_heroic = sWorld.getConfig(CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING); - if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) + uint32 req_level_for_heroic = sWorld.getIntConfig(CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING); + if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT; SendPacket(&data); return; } - bool AllowTwoSideAccounts = !sWorld.IsPvPRealm() || sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER; - uint32 skipCinematics = sWorld.getConfig(CONFIG_SKIP_CINEMATICS); + bool AllowTwoSideAccounts = !sWorld.IsPvPRealm() || sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER; + uint32 skipCinematics = sWorld.getIntConfig(CONFIG_SKIP_CINEMATICS); bool have_same_race = false; @@ -615,7 +615,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) sLog.outStaticDebug("WORLD: Sent motd (SMSG_MOTD)"); // send server info - if (sWorld.getConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) + if (sWorld.getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) chH.PSendSysMessage(_FULLVERSION); sLog.outStaticDebug("WORLD: Sent server info"); @@ -765,7 +765,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) if (sWorld.IsShutdowning()) sWorld.ShutdownMsg(true,pCurrChar); - if (sWorld.getConfig(CONFIG_ALL_TAXI_PATHS)) + if (sWorld.getBoolConfig(CONFIG_ALL_TAXI_PATHS)) pCurrChar->SetTaxiCheater(true); if (pCurrChar->isGameMaster()) diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index c83c0f2df23..bacfa93916e 100644 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -46,15 +46,15 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg if (lang != LANG_ADDON) { // strip invisible characters for non-addon messages - if (sWorld.getConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING)) + if (sWorld.getBoolConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING)) stripLineInvisibleChars(msg); - if (sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && GetSecurity() < SEC_MODERATOR + if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && GetSecurity() < SEC_MODERATOR && !ChatHandler(this).isValidChatMessage(msg.c_str())) { sLog.outError("Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), msg.c_str()); - if (sWorld.getConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK)) + if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK)) KickPlayer(); return false; } @@ -108,7 +108,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (lang == LANG_ADDON) { - if (sWorld.getConfig(CONFIG_CHATLOG_ADDON)) + if (sWorld.getBoolConfig(CONFIG_CHATLOG_ADDON)) { std::string msg = ""; recv_data >> msg; @@ -123,7 +123,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) } // Disabled addon channel? - if (!sWorld.getConfig(CONFIG_ADDON_CHANNEL)) + if (!sWorld.getBoolConfig(CONFIG_ADDON_CHANNEL)) return; } // LANG_ADDON should not be changed nor be affected by flood control @@ -135,7 +135,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) else { // send in universal language in two side iteration allowed mode - if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)) + if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)) lang = LANG_UNIVERSAL; else { @@ -146,13 +146,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) case CHAT_MSG_RAID_LEADER: case CHAT_MSG_RAID_WARNING: // allow two side chat at group channel if two side group allowed - if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) + if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) lang = LANG_UNIVERSAL; break; case CHAT_MSG_GUILD: case CHAT_MSG_OFFICER: // allow two side chat at guild channel if two side guild allowed - if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) + if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) lang = LANG_UNIVERSAL; break; } @@ -199,9 +199,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (ChatHandler(this).ParseCommands(msg.c_str()) > 0) break; - if (_player->getLevel() < sWorld.getConfig(CONFIG_CHAT_SAY_LEVEL_REQ)) + if (_player->getLevel() < sWorld.getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld.getConfig(CONFIG_CHAT_SAY_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld.getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)); return; } @@ -225,9 +225,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) recv_data >> to; recv_data >> msg; - if (_player->getLevel() < sWorld.getConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ)) + if (_player->getLevel() < sWorld.getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld.getConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld.getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ)); return; } @@ -252,7 +252,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) return; } - if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER) { uint32 sidea = GetPlayer()->GetTeam(); uint32 sideb = player->GetTeam(); @@ -508,9 +508,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (!processChatmessageFurtherAfterSecurityChecks(msg, lang)) return; - if (_player->getLevel() < sWorld.getConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)) + if (_player->getLevel() < sWorld.getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld.getConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld.getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)); return; } @@ -671,9 +671,9 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) Trinity::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit); Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder > emote_do(emote_builder); - Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder > > emote_worker(GetPlayer(), (float)sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); + Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder > > emote_worker(GetPlayer(), sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder> >, WorldTypeMapContainer> message(emote_worker); - cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), (float)sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); + cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index 838ebb40f4f..6c7941d37ea 100644 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -82,11 +82,11 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) } // restrict invite to GMs - if (!sWorld.getConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster()) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster()) return; // can't group with - if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam()) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam()) { SendPartyResult(PARTY_OP_INVITE, membername, ERR_PLAYER_WRONG_FACTION); return; diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp index 6a3171b4823..0fd3c04b359 100644 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp @@ -95,7 +95,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) return; // not let enemies sign guild charter - if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam()) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam()) { SendGuildCommandResult(GUILD_INVITE_S, Invitedname, ERR_GUILD_NOT_ALLIED); return; @@ -198,7 +198,7 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) return; // not let enemies sign guild charter - if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(guild->GetLeader())) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(guild->GetLeader())) return; if (!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank())) @@ -894,7 +894,7 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data) GetPlayer()->SaveGoldToDB(trans); // logging money - if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) + if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog.outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)", _player->GetName(),_player->GetSession()->GetAccountId(),money,GuildId); diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index 5a0e2626e54..2fd25d4609a 100644 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -25,7 +25,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket &recv_data) { sLog.outDebug("CMSG_LFG_JOIN"); - if (!sWorld.getConfig(CONFIG_DUNGEON_FINDER_ENABLE)) + if (!sWorld.getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE)) { recv_data.rpos(recv_data.wpos()); return; diff --git a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp index f48533ebcb6..c67adcdde38 100644 --- a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp @@ -223,7 +223,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) Player* playerGroup = itr->getSource(); if (!playerGroup) continue; - if (player->IsWithinDistInMap(playerGroup,(float)sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (player->IsWithinDistInMap(playerGroup,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) playersNear.push_back(playerGroup); } diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index ea81e649c4d..7947ea9ce2c 100644 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -224,8 +224,8 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) uint32 team = _player->GetTeam(); uint32 security = GetSecurity(); - bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); - uint32 gmLevelInWhoList = sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); + bool allowTwoSideWhoList = sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); + uint32 gmLevelInWhoList = sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); WorldPacket data(SMSG_WHO, 50); // guess size data << uint32(clientcount); // clientcount place holder, listed count @@ -336,7 +336,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) // 49 is maximum player count sent to client - can be overridden // through config, but is unstable - if ((++clientcount) == sWorld.getConfig(CONFIG_MAX_WHO)) + if ((++clientcount) == sWorld.getIntConfig(CONFIG_MAX_WHO)) break; } @@ -376,7 +376,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in worldserver.conf if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() || - GetSecurity() >= AccountTypes(sWorld.getConfig(CONFIG_INSTANT_LOGOUT))) + GetSecurity() >= AccountTypes(sWorld.getIntConfig(CONFIG_INSTANT_LOGOUT))) { WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4); data << uint8(0); @@ -575,13 +575,13 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, std team = Player::TeamForRace((*result)[1].GetUInt8()); friendAcctid = (*result)[2].GetUInt32(); - if (GetSecurity() >= SEC_MODERATOR || sWorld.getConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr.GetSecurity(friendAcctid) < SEC_MODERATOR) + if (GetSecurity() >= SEC_MODERATOR || sWorld.getBoolConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr.GetSecurity(friendAcctid) < SEC_MODERATOR) { if (friendGuid) { if (friendGuid == GetPlayer()->GetGUID()) friendResult = FRIEND_SELF; - else if (GetPlayer()->GetTeam() != team && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && GetSecurity() < SEC_MODERATOR) + else if (GetPlayer()->GetTeam() != team && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && GetSecurity() < SEC_MODERATOR) friendResult = FRIEND_ENEMY; else if (GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid))) friendResult = FRIEND_ALREADY; @@ -1216,7 +1216,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) WorldPacket data(SMSG_INSPECT_TALENT, guid_size+4+talent_points); data.append(plr->GetPackGUID()); - if (sWorld.getConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster()) + if (sWorld.getBoolConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster()) { plr->BuildPlayerTalentsInfoData(&data); } diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index 354909a956e..85ef8826771 100644 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -159,12 +159,10 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid return; // Not let attack through obstructions - if (sWorld.getConfig(CONFIG_PET_LOS)) + if (sWorld.getBoolConfig(CONFIG_PET_LOS)) { - - if (!pet->IsWithinLOSInMap(TargetUnit)) - return; - + if (!pet->IsWithinLOSInMap(TargetUnit)) + return; } pet->clearUnitState(UNIT_STAT_FOLLOW); diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index 154af64e11a..da52ead96d0 100644 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -110,9 +110,9 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) else { // TODO: find correct opcode - if (_player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (_player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { - SendNotification(LANG_ARENA_ONE_TOOLOW, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)); + SendNotification(LANG_ARENA_ONE_TOOLOW, sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); return; } @@ -467,7 +467,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) return; // not let enemies sign guild charter - if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(ownerguid)) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(ownerguid)) { if (type != 9) SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); @@ -478,7 +478,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) if (type != 9) { - if (_player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (_player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", _player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S); return; @@ -611,7 +611,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) sLog.outDebug("OFFER PETITION: type %u, GUID1 %u, to player id: %u", type, GUID_LOPART(petitionguid), GUID_LOPART(plguid)); - if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != player->GetTeam()) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != player->GetTeam()) { if (type != 9) SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); @@ -622,7 +622,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) if (type != 9) { - if (player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { // player is too low level to join an arena team SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, player->GetName(), "", ERR_ARENA_TEAM_TARGET_TOO_LOW_S); @@ -755,9 +755,9 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) signs = 0; uint32 count; - //if (signs < sWorld.getConfig(CONFIG_MIN_PETITION_SIGNS)) + //if (signs < sWorld.getIntConfig(CONFIG_MIN_PETITION_SIGNS)) if (type == 9) - count = sWorld.getConfig(CONFIG_MIN_PETITION_SIGNS); + count = sWorld.getIntConfig(CONFIG_MIN_PETITION_SIGNS); else count = type-1; if (signs < count) diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index 0e1a58701bd..fa8b11d6429 100644 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -62,7 +62,7 @@ void WorldSession::SendNameQueryOpcodeFromDB(uint64 guid) { ACE_Future<QueryResult_AutoPtr> lFutureResult = CharacterDatabase.AsyncPQuery( - !sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) ? + !sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) ? // ------- Query Without Declined Names -------- // 0 1 2 3 4 "SELECT guid, name, race, gender, class " @@ -110,7 +110,7 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult_AutoPtr result) data << uint8(pClass); // class // if the first declined name field (5) is empty, the rest must be too - if (sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) && fields[5].GetCppString() != "") + if (sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) && fields[5].GetCppString() != "") { data << uint8(1); // is declined for (int i = 5; i < MAX_DECLINED_NAME_CASES+5; ++i) diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index 4d66e9b7f29..2b2f5c661a2 100644 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -632,7 +632,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 { if (pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->getQuestStatusMap()[quest_id].m_rewarded)) result2 = DIALOG_STATUS_REWARD_REP; - else if (pPlayer->getLevel() <= ((pPlayer->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) + else if (pPlayer->getLevel() <= ((pPlayer->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld.getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) { if (pQuest->HasFlag(QUEST_FLAGS_DAILY) || pQuest->HasFlag(QUEST_FLAGS_WEEKLY)) result2 = DIALOG_STATUS_AVAILABLE_REP; diff --git a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp b/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp index 53ffcc359e3..7ddf3ca6c91 100644 --- a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp @@ -27,9 +27,9 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) { - if (GetPlayer()->getLevel() < sWorld.getConfig(CONFIG_TICKET_LEVEL_REQ)) + if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_TICKET_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_TICKET_REQ), sWorld.getConfig(CONFIG_TICKET_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_TICKET_REQ), sWorld.getIntConfig(CONFIG_TICKET_LEVEL_REQ)); return; } diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp index 80aee40785e..9c9f71064e6 100644 --- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp @@ -154,7 +154,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) { // logging sLog.outDebug("partner storing: %u",myItems[i]->GetGUIDLow()); - if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) + if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog.outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", _player->GetName(), _player->GetSession()->GetAccountId(), @@ -169,7 +169,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) { // logging sLog.outDebug("player storing: %u",hisItems[i]->GetGUIDLow()); - if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) + if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog.outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", trader->GetName(), trader->GetSession()->GetAccountId(), @@ -442,7 +442,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) moveItems(myItems, hisItems); // logging money - if (sWorld.getConfig(CONFIG_GM_LOG_TRADE)) + if (sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) { if (_player->GetSession()->GetSecurity() > SEC_PLAYER && my_trade->GetMoney() > 0) { @@ -559,9 +559,9 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (GetPlayer()->getLevel() < sWorld.getConfig(CONFIG_TRADE_LEVEL_REQ)) + if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld.getConfig(CONFIG_TRADE_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ)); return; } @@ -611,7 +611,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) && pOther->GetTeam() !=_player->GetTeam()) + if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) && pOther->GetTeam() !=_player->GetTeam()) { SendTradeStatus(TRADE_STATUS_WRONG_FACTION); return; @@ -623,9 +623,9 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (pOther->getLevel() < sWorld.getConfig(CONFIG_TRADE_LEVEL_REQ)) + if (pOther->getLevel() < sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld.getConfig(CONFIG_TRADE_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ)); return; } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 7535ae0c0dd..da9037bc331 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -295,7 +295,7 @@ class WorldSession } void ResetTimeOutTime() { - m_timeOutTime = sWorld.getConfig(CONFIG_SOCKET_TIMEOUTTIME); + m_timeOutTime = sWorld.getIntConfig(CONFIG_SOCKET_TIMEOUTTIME); } bool IsConnectionIdle() const { diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 6754955b3a1..6eb5dff67f9 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -843,10 +843,10 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) Field* fields = result->Fetch(); uint8 expansion = fields[6].GetUInt8(); - uint32 world_expansion = sWorld.getConfig(CONFIG_EXPANSION); + uint32 world_expansion = sWorld.getIntConfig(CONFIG_EXPANSION); if (expansion > world_expansion) expansion = world_expansion; - //expansion = ((sWorld.getConfig(CONFIG_EXPANSION) > fields[6].GetUInt8()) ? fields[6].GetUInt8() : sWorld.getConfig(CONFIG_EXPANSION)); + //expansion = ((sWorld.getIntConfig(CONFIG_EXPANSION) > fields[6].GetUInt8()) ? fields[6].GetUInt8() : sWorld.getIntConfig(CONFIG_EXPANSION)); N.SetHexStr ("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"); g.SetDword (7); @@ -994,7 +994,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) m_Session->ReadAddonsInfo(recvPacket); // Sleep this Network thread for - uint32 sleepTime = sWorld.getConfig(CONFIG_SESSION_ADD_DELAY); + uint32 sleepTime = sWorld.getIntConfig(CONFIG_SESSION_ADD_DELAY); ACE_OS::sleep (ACE_Time_Value (0, sleepTime)); sWorld.AddSession (m_Session); @@ -1024,7 +1024,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) { ++m_OverSpeedPings; - uint32 max_count = sWorld.getConfig (CONFIG_MAX_OVERSPEED_PINGS); + uint32 max_count = sWorld.getIntConfig (CONFIG_MAX_OVERSPEED_PINGS); if (max_count && m_OverSpeedPings > max_count) { diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index d948c65be2f..728c55b4e8f 100644 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -159,13 +159,13 @@ class ReactorRunnable : protected ACE_Task_Base sLog.outStaticDebug ("Network Thread Starting"); bool needInit = true; - if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA)) + if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA)) { LoginDatabase.Init_MySQL_Connection(); needInit = false; } - if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA)) + if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA)) { CharacterDatabase.Init_MySQL_Connection(); needInit = false; @@ -210,9 +210,9 @@ class ReactorRunnable : protected ACE_Task_Base } ///- Free MySQL thread resources and deallocate lingering connections - if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA)) + if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA)) LoginDatabase.End_MySQL_Connection(); - if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA)) + if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA)) CharacterDatabase.End_MySQL_Connection(); if (needInit) |
