diff options
| author | Subv <s.v.h21@hotmail.com> | 2012-10-04 19:39:09 -0500 |
|---|---|---|
| committer | Subv <s.v.h21@hotmail.com> | 2012-10-04 19:39:09 -0500 |
| commit | f7d3600e7e7ffaba971b77e4371a705e55593cfd (patch) | |
| tree | 2d4e898bb4e09ede5dba97918741597da6fd2d2e /src/server/game/Handlers | |
| parent | d2437407f4f7ad1af3baeb351626b41bd700065c (diff) | |
| parent | 74707a08d3d63dc66e7b6943431c91f50258b0f9 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps
Conflicts:
src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
Diffstat (limited to 'src/server/game/Handlers')
| -rwxr-xr-x | src/server/game/Handlers/BattleGroundHandler.cpp | 23 | ||||
| -rw-r--r-- | src/server/game/Handlers/CharacterHandler.cpp | 40 | ||||
| -rwxr-xr-x | src/server/game/Handlers/MiscHandler.cpp | 4 |
3 files changed, 34 insertions, 33 deletions
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 5c8860cc900..25c8cd3cc2a 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -148,7 +148,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (_player->GetBattlegroundQueueIndex(bgQueueTypeIdRandom) < PLAYER_MAX_BATTLEGROUND_QUEUES) { - //player is already in random queue + // player is already in random queue WorldPacket data; sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_IN_RANDOM_BG); _player->GetSession()->SendPacket(&data); @@ -157,7 +157,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (_player->InBattlegroundQueue() && bgTypeId == BATTLEGROUND_RB) { - //player is already in queue, can't start random queue + // player is already in queue, can't start random queue WorldPacket data; sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_IN_NON_RANDOM_BG); _player->GetSession()->SendPacket(&data); @@ -166,7 +166,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) // check if already in queue if (_player->GetBattlegroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES) - //player is already in this queue + // player is already in this queue return; // check if has free queue slots @@ -178,7 +178,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) return; } - BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0); uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); @@ -189,7 +189,8 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); SendPacket(&data); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", + bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); } else { @@ -202,7 +203,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0); isPremade = (grp->GetMembersCount() >= bg->GetMinPlayersPerTeam()); - BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); GroupQueueInfo* ginfo = NULL; uint32 avgTime = 0; @@ -256,14 +257,14 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recv_d Player* allianceFlagCarrier = NULL; Player* hordeFlagCarrier = NULL; - if (uint64 guid = bg->GetFlagPickerGUID(BG_TEAM_ALLIANCE)) + if (uint64 guid = bg->GetFlagPickerGUID(TEAM_ALLIANCE)) { allianceFlagCarrier = ObjectAccessor::FindPlayer(guid); if (allianceFlagCarrier) ++flagCarrierCount; } - if (uint64 guid = bg->GetFlagPickerGUID(BG_TEAM_HORDE)) + if (uint64 guid = bg->GetFlagPickerGUID(TEAM_HORDE)) { hordeFlagCarrier = ObjectAccessor::FindPlayer(guid); if (hordeFlagCarrier) @@ -366,7 +367,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) //get GroupQueueInfo from BattlegroundQueue BattlegroundTypeId bgTypeId = BattlegroundTypeId(bgTypeId_); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, type); - BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); //we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattlegroundQueue::RemovePlayer() function GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo)) @@ -540,7 +541,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) } //we are sending update to player about queue - he can be invited there! //get GroupQueueInfo for queue status - BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo)) continue; @@ -680,7 +681,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) arenaRating = 1; } - BattlegroundQueue &bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); if (asGroup) { uint32 avgTime = 0; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 8f98135aafb..5c603e46086 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1730,7 +1730,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) sWorld->UpdateCharacterNameData(GUID_LOPART(guid), newname, gender, race); - BattlegroundTeamId team = BG_TEAM_ALLIANCE; + TeamId team = TEAM_ALLIANCE; // Search each faction is targeted switch (race) @@ -1740,7 +1740,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) case RACE_UNDEAD_PLAYER: case RACE_TROLL: case RACE_BLOODELF: - team = BG_TEAM_HORDE; + team = TEAM_HORDE; break; default: break; @@ -1757,7 +1757,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) stmt->setUInt32(0, lowGuid); // Faction specific languages - if (team == BG_TEAM_HORDE) + if (team == TEAM_HORDE) stmt->setUInt16(1, 109); else stmt->setUInt16(1, 98); @@ -1816,7 +1816,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) uint32 numFullTaximasks = level / 7; if (numFullTaximasks > 11) numFullTaximasks = 11; - if (team == BG_TEAM_ALLIANCE) + if (team == TEAM_ALLIANCE) { if (playerClass != CLASS_DEATH_KNIGHT) { @@ -1868,7 +1868,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { Quest *qinfo = iter->second; uint32 requiredRaces = qinfo->GetRequiredRaces(); - if (team == BG_TEAM_ALLIANCE) + if (team == TEAM_ALLIANCE) { if (requiredRaces & RACEMASK_ALLIANCE) { @@ -1876,7 +1876,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) quests << ','; } } - else // if (team == BG_TEAM_HORDE) + else // if (team == TEAM_HORDE) { if (requiredRaces & RACEMASK_HORDE) { @@ -1929,7 +1929,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND); stmt->setUInt32(0, lowGuid); - if (team == BG_TEAM_ALLIANCE) + if (team == TEAM_ALLIANCE) { stmt->setUInt16(1, 0); stmt->setUInt16(2, 1519); @@ -1956,13 +1956,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) uint32 achiev_horde = it->second; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT); - stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); + stmt->setUInt16(0, uint16(team == TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); stmt->setUInt32(1, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ACHIEVEMENT); - stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); - stmt->setUInt16(1, uint16(team == BG_TEAM_ALLIANCE ? achiev_horde : achiev_alliance)); + stmt->setUInt16(0, uint16(team == TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); + stmt->setUInt16(1, uint16(team == TEAM_ALLIANCE ? achiev_horde : achiev_alliance)); stmt->setUInt32(2, lowGuid); trans->Append(stmt); } @@ -1974,8 +1974,8 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) uint32 item_horde = it->second; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE); - stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? item_alliance : item_horde)); - stmt->setUInt32(1, (team == BG_TEAM_ALLIANCE ? item_horde : item_alliance)); + stmt->setUInt32(0, (team == TEAM_ALLIANCE ? item_alliance : item_horde)); + stmt->setUInt32(1, (team == TEAM_ALLIANCE ? item_horde : item_alliance)); stmt->setUInt32(2, guid); trans->Append(stmt); } @@ -1987,13 +1987,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) uint32 spell_horde = it->second; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); - stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde)); + stmt->setUInt32(0, (team == TEAM_ALLIANCE ? spell_alliance : spell_horde)); stmt->setUInt32(1, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE); - stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde)); - stmt->setUInt32(1, (team == BG_TEAM_ALLIANCE ? spell_horde : spell_alliance)); + stmt->setUInt32(0, (team == TEAM_ALLIANCE ? spell_alliance : spell_horde)); + stmt->setUInt32(1, (team == TEAM_ALLIANCE ? spell_horde : spell_alliance)); stmt->setUInt32(2, lowGuid); trans->Append(stmt); } @@ -2005,13 +2005,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) uint32 reputation_horde = it->second; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REP_BY_FACTION); - stmt->setUInt32(0, uint16(team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); + stmt->setUInt32(0, uint16(team == TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); stmt->setUInt32(1, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_REP_FACTION_CHANGE); - stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); - stmt->setUInt16(1, uint16(team == BG_TEAM_ALLIANCE ? reputation_horde : reputation_alliance)); + stmt->setUInt16(0, uint16(team == TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); + stmt->setUInt16(1, uint16(team == TEAM_ALLIANCE ? reputation_horde : reputation_alliance)); stmt->setUInt32(2, lowGuid); trans->Append(stmt); } @@ -2021,7 +2021,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { const uint32 ktcount = KNOWN_TITLES_SIZE * 2; uint32 knownTitles[ktcount]; - Tokens tokens(knownTitlesStr, ' ', ktcount); + Tokenizer tokens(knownTitlesStr, ' ', ktcount); if (tokens.size() != ktcount) return; @@ -2037,7 +2037,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) CharTitlesEntry const* atitleInfo = sCharTitlesStore.LookupEntry(title_alliance); CharTitlesEntry const* htitleInfo = sCharTitlesStore.LookupEntry(title_horde); // new team - if (team == BG_TEAM_ALLIANCE) + if (team == TEAM_ALLIANCE) { uint32 bitIndex = htitleInfo->bit_index; uint32 index = bitIndex / 32; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 1da44882ea9..e6e32e81e51 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -862,8 +862,8 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) // 2PI = 360°, keep in mind that ingame orientation is counter-clockwise double rotation = 2 * M_PI - atEntry->box_orientation; - double sinVal = sin(rotation); - double cosVal = cos(rotation); + double sinVal = std::sin(rotation); + double cosVal = std::cos(rotation); float playerBoxDistX = player->GetPositionX() - atEntry->x; float playerBoxDistY = player->GetPositionY() - atEntry->y; |
