diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.cpp | 31 | ||||
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.h | 16 | ||||
-rw-r--r-- | src/server/game/DungeonFinding/LFGPlayerData.cpp | 13 | ||||
-rw-r--r-- | src/server/game/DungeonFinding/LFGPlayerData.h | 3 | ||||
-rw-r--r-- | src/server/game/Handlers/LFGHandler.cpp | 17 | ||||
-rw-r--r-- | src/server/game/Server/Protocol/Opcodes.cpp | 7 | ||||
-rw-r--r-- | src/server/game/Server/WorldSession.h | 1 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_lfg.cpp | 2 |
8 files changed, 20 insertions, 70 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 0b00269ad33..5b63f36dfbf 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -360,10 +360,10 @@ void LFGMgr::Update(uint32 diff) if (!gguid.IsEmpty()) { SetState(gguid, LFG_STATE_PROPOSAL); - SendLfgUpdateStatus(guid, LfgUpdateData(LFG_UPDATETYPE_PROPOSAL_BEGIN, GetSelectedDungeons(guid), GetComment(guid)), true); + SendLfgUpdateStatus(guid, LfgUpdateData(LFG_UPDATETYPE_PROPOSAL_BEGIN, GetSelectedDungeons(guid)), true); } else - SendLfgUpdateStatus(guid, LfgUpdateData(LFG_UPDATETYPE_PROPOSAL_BEGIN, GetSelectedDungeons(guid), GetComment(guid)), false); + SendLfgUpdateStatus(guid, LfgUpdateData(LFG_UPDATETYPE_PROPOSAL_BEGIN, GetSelectedDungeons(guid)), false); SendLfgUpdateProposal(guid, proposal); } @@ -391,9 +391,8 @@ void LFGMgr::Update(uint32 diff) @param[in] player Player trying to join (or leader of group trying to join) @param[in] roles Player selected roles @param[in] dungeons Dungeons the player/group is applying for - @param[in] comment Player selected comment */ -void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const std::string& comment) +void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons) { if (!player || !player->GetSession() || dungeons.empty()) return; @@ -526,8 +525,6 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const return; } - SetComment(guid, comment); - if (isRaid) { TC_LOG_DEBUG("lfg.join", "%s trying to join raid browser and it's disabled.", guid.ToString().c_str()); @@ -553,7 +550,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const SetState(gguid, LFG_STATE_ROLECHECK); // Send update to player - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE, dungeons, comment); + LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE, dungeons); for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) { if (Player* plrg = itr->GetSource()) @@ -590,7 +587,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const } // Send update to player player->GetSession()->SendLfgJoinResult(joinData); - player->GetSession()->SendLfgUpdateStatus(LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE, dungeons, comment), false); + player->GetSession()->SendLfgUpdateStatus(LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE, dungeons), false); SetState(gguid, LFG_STATE_QUEUED); SetRoles(guid, roles); debugNames.append(player->GetName()); @@ -740,7 +737,7 @@ void LFGMgr::UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid /* = ObjectGuid:: case LFG_ROLECHECK_FINISHED: SetState(pguid, LFG_STATE_QUEUED); SetRoles(pguid, it->second); - SendLfgUpdateStatus(pguid, LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, dungeons, GetComment(pguid)), true); + SendLfgUpdateStatus(pguid, LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, dungeons), true); break; default: if (roleCheck.leader == pguid) @@ -1147,10 +1144,10 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate if (gguid != guid) { SetState(gguid, LFG_STATE_QUEUED); - SendLfgUpdateStatus(guid, LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, GetSelectedDungeons(guid), GetComment(guid)), true); + SendLfgUpdateStatus(guid, LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, GetSelectedDungeons(guid)), true); } else - SendLfgUpdateStatus(guid, LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, GetSelectedDungeons(guid), GetComment(guid)), false); + SendLfgUpdateStatus(guid, LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, GetSelectedDungeons(guid)), false); } } @@ -1585,12 +1582,6 @@ uint8 LFGMgr::GetRoles(ObjectGuid guid) return roles; } -const std::string& LFGMgr::GetComment(ObjectGuid guid) -{ - TC_LOG_TRACE("lfg.data.player.comment.get", "Player: %s, Comment: %s", guid.ToString().c_str(), PlayersStore[guid].GetComment().c_str()); - return PlayersStore[guid].GetComment(); -} - LfgDungeonSet const& LFGMgr::GetSelectedDungeons(ObjectGuid guid) { TC_LOG_TRACE("lfg.data.player.dungeons.selected.get", "Player: %s, Selected Dungeons: %s", guid.ToString().c_str(), ConcatenateDungeons(PlayersStore[guid].GetSelectedDungeons()).c_str()); @@ -1741,12 +1732,6 @@ void LFGMgr::SetRoles(ObjectGuid guid, uint8 roles) PlayersStore[guid].SetRoles(roles); } -void LFGMgr::SetComment(ObjectGuid guid, std::string const& comment) -{ - TC_LOG_TRACE("lfg.data.player.comment.set", "Player: %s, Comment: %s", guid.ToString().c_str(), comment.c_str()); - PlayersStore[guid].SetComment(comment); -} - void LFGMgr::SetSelectedDungeons(ObjectGuid guid, LfgDungeonSet const& dungeons) { TC_LOG_TRACE("lfg.data.player.dungeon.selected.set", "Player: %s, Dungeons: %s", guid.ToString().c_str(), ConcatenateDungeons(dungeons).c_str()); diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 9c0d5c91960..a8834046760 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -163,11 +163,11 @@ struct LfgJoinResultData // Data needed by SMSG_LFG_UPDATE_STATUS struct LfgUpdateData { - LfgUpdateData(LfgUpdateType _type = LFG_UPDATETYPE_DEFAULT): updateType(_type), state(LFG_STATE_NONE), comment("") { } - LfgUpdateData(LfgUpdateType _type, LfgDungeonSet const& _dungeons, std::string const& _comment): - updateType(_type), state(LFG_STATE_NONE), dungeons(_dungeons), comment(_comment) { } - LfgUpdateData(LfgUpdateType _type, LfgState _state, LfgDungeonSet const& _dungeons, std::string const& _comment = ""): - updateType(_type), state(_state), dungeons(_dungeons), comment(_comment) { } + LfgUpdateData(LfgUpdateType _type = LFG_UPDATETYPE_DEFAULT): updateType(_type), state(LFG_STATE_NONE) { } + LfgUpdateData(LfgUpdateType _type, LfgDungeonSet const& _dungeons): + updateType(_type), state(LFG_STATE_NONE), dungeons(_dungeons) { } + LfgUpdateData(LfgUpdateType _type, LfgState _state, LfgDungeonSet const& _dungeons): + updateType(_type), state(_state), dungeons(_dungeons) { } LfgUpdateType updateType; LfgState state; @@ -337,8 +337,6 @@ class TC_GAME_API LFGMgr // cs_lfg /// Get current player roles uint8 GetRoles(ObjectGuid guid); - /// Get current player comment (used for LFR) - std::string const& GetComment(ObjectGuid gguid); /// Gets current lfg options uint32 GetOptions(); /// Sets new lfg options @@ -391,10 +389,8 @@ class TC_GAME_API LFGMgr void UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid = ObjectGuid::Empty, uint8 roles = PLAYER_ROLE_NONE); /// Sets player lfg roles void SetRoles(ObjectGuid guid, uint8 roles); - /// Sets player lfr comment - void SetComment(ObjectGuid guid, std::string const& comment); /// Join Lfg with selected roles, dungeons and comment - void JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, std::string const& comment); + void JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons); /// Leaves lfg void LeaveLfg(ObjectGuid guid, bool disconnected = false); diff --git a/src/server/game/DungeonFinding/LFGPlayerData.cpp b/src/server/game/DungeonFinding/LFGPlayerData.cpp index f55315ef5a3..db0168dfd7e 100644 --- a/src/server/game/DungeonFinding/LFGPlayerData.cpp +++ b/src/server/game/DungeonFinding/LFGPlayerData.cpp @@ -21,7 +21,7 @@ namespace lfg { LfgPlayerData::LfgPlayerData(): m_State(LFG_STATE_NONE), m_OldState(LFG_STATE_NONE), - m_Team(0), m_Group(), m_Roles(0), m_Comment("") + m_Team(0), m_Group(), m_Roles(0) { } LfgPlayerData::~LfgPlayerData() { } @@ -34,7 +34,6 @@ void LfgPlayerData::SetState(LfgState state) case LFG_STATE_FINISHED_DUNGEON: m_Roles = 0; m_SelectedDungeons.clear(); - m_Comment.clear(); // No break on purpose case LFG_STATE_DUNGEON: m_OldState = state; @@ -69,11 +68,6 @@ void LfgPlayerData::SetRoles(uint8 roles) m_Roles = roles; } -void LfgPlayerData::SetComment(std::string const& comment) -{ - m_Comment = comment; -} - void LfgPlayerData::SetSelectedDungeons(LfgDungeonSet const& dungeons) { m_SelectedDungeons = dungeons; @@ -104,11 +98,6 @@ uint8 LfgPlayerData::GetRoles() const return m_Roles; } -std::string const& LfgPlayerData::GetComment() const -{ - return m_Comment; -} - LfgDungeonSet const& LfgPlayerData::GetSelectedDungeons() const { return m_SelectedDungeons; diff --git a/src/server/game/DungeonFinding/LFGPlayerData.h b/src/server/game/DungeonFinding/LFGPlayerData.h index 356a0bb3152..ba6a78619a3 100644 --- a/src/server/game/DungeonFinding/LFGPlayerData.h +++ b/src/server/game/DungeonFinding/LFGPlayerData.h @@ -40,7 +40,6 @@ class TC_GAME_API LfgPlayerData // Queue void SetRoles(uint8 roles); - void SetComment(std::string const& comment); void SetSelectedDungeons(const LfgDungeonSet& dungeons); // General @@ -51,7 +50,6 @@ class TC_GAME_API LfgPlayerData // Queue uint8 GetRoles() const; - std::string const& GetComment() const; LfgDungeonSet const& GetSelectedDungeons() const; private: @@ -64,7 +62,6 @@ class TC_GAME_API LfgPlayerData // Queue uint8 m_Roles; ///< Roles the player selected when joined LFG - std::string m_Comment; ///< Player comment used when joined LFG LfgDungeonSet m_SelectedDungeons; ///< Selected Dungeons when joined LFG }; diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 6669fac7291..2bd6f6fc0a1 100644 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -125,7 +125,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData) TC_LOG_DEBUG("lfg", "CMSG_DF_JOIN %s roles: %u, Dungeons: %u, Comment: %s", GetPlayerInfo().c_str(), roles, uint8(newDungeons.size()), comment.c_str()); - sLFGMgr->JoinLfg(GetPlayer(), uint8(roles), newDungeons, comment); + sLFGMgr->JoinLfg(GetPlayer(), uint8(roles), newDungeons); } void WorldSession::HandleLfgLeaveOpcode(WorldPacket& recvData) @@ -239,17 +239,6 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData) sLFGMgr->UpdateRoleCheck(gguid, guid, roles); } -void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData) -{ - uint32 length = recvData.ReadBits(9); - std::string comment = recvData.ReadString(length); - - TC_LOG_DEBUG("lfg", "CMSG_LFG_SET_COMMENT %s comment: %s", - GetPlayerInfo().c_str(), comment.c_str()); - - sLFGMgr->SetComment(GetPlayer()->GetGUID(), comment); -} - void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recvData) { bool agree; // Agree to kick player @@ -461,13 +450,12 @@ void WorldSession::SendLfgUpdateStatus(lfg::LfgUpdateData const& updateData, boo TC_LOG_DEBUG("lfg", "SMSG_LFG_UPDATE_STATUS %s updatetype: %u, party %s", GetPlayerInfo().c_str(), updateData.updateType, party ? "true" : "false"); - WorldPacket data(SMSG_LFG_UPDATE_STATUS, 1 + 8 + 3 + 2 + 1 + updateData.comment.length() + 4 + 4 + 1 + 1 + 1 + 4 + size); + WorldPacket data(SMSG_LFG_UPDATE_STATUS, 1 + 8 + 3 + 2 + 1 + 4 + 4 + 1 + 1 + 1 + 4 + size); data.WriteBit(guid[1] != 0); data.WriteBit(party); data.WriteBits(size, 24); data.WriteBit(guid[6] != 0); data.WriteBit(size > 0); // Extra info - data.WriteBits(updateData.comment.length(), 9); data.WriteBit(guid[4] != 0); data.WriteBit(guid[7] != 0); data.WriteBit(guid[2] != 0); @@ -478,7 +466,6 @@ void WorldSession::SendLfgUpdateStatus(lfg::LfgUpdateData const& updateData, boo data.WriteBit(queued); // Join the queue data << uint8(updateData.updateType); // Lfg Update type - data.WriteString(updateData.comment); data << uint32(queueId); // Queue Id data << uint32(joinTime); // Join date data.WriteByteSeq(guid[6]); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d004a5fe2a3..2d22d52c736 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -355,13 +355,10 @@ void OpcodeTable::Initialize() DEFINE_HANDLER(CMSG_DF_BOOT_PLAYER_VOTE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode); DEFINE_HANDLER(CMSG_DF_GET_JOIN_STATUS, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleDFGetJoinStatus); DEFINE_HANDLER(CMSG_DF_GET_SYSTEM_INFO, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleDFGetSystemInfo); - DEFINE_HANDLER(CMSG_DF_JOIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::HandleLfgJoinOpcode); - DEFINE_HANDLER(CMSG_DF_LEAVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::HandleLfgLeaveOpcode); + DEFINE_HANDLER(CMSG_DF_JOIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode); + DEFINE_HANDLER(CMSG_DF_LEAVE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode); DEFINE_HANDLER(CMSG_DF_PROPOSAL_RESPONSE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode); DEFINE_HANDLER(CMSG_DF_READY_CHECK_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL); - //DEFINE_HANDLER(CMSG_DF_SEARCH_JOIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL); - //DEFINE_HANDLER(CMSG_DF_SEARCH_LEAVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL); - //DEFINE_HANDLER(CMSG_DF_SET_COMMENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::HandleLfgSetCommentOpcode); DEFINE_HANDLER(CMSG_DF_SET_ROLES, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode); DEFINE_HANDLER(CMSG_DF_TELEPORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode); DEFINE_HANDLER(CMSG_DISCARDED_TIME_SYNC_ACKS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index beb8945ebe9..3d65f518e8b 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -1527,7 +1527,6 @@ class TC_GAME_API WorldSession void HandleInstanceLockResponse(WorldPackets::Instance::InstanceLockResponse& packet); // Looking for Dungeon/Raid - void HandleLfgSetCommentOpcode(WorldPacket& recvData); void HandleDFGetSystemInfo(WorldPacket& recvData); void SendLfgPlayerLockInfo(); void SendLfgPartyLockInfo(); diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp index 478be31fd6a..88cd64e0680 100644 --- a/src/server/scripts/Commands/cs_lfg.cpp +++ b/src/server/scripts/Commands/cs_lfg.cpp @@ -38,7 +38,7 @@ void GetPlayerInfo(ChatHandler* handler, Player* player) std::string const& state = lfg::GetStateString(sLFGMgr->GetState(guid)); handler->PSendSysMessage(LANG_LFG_PLAYER_INFO, player->GetName().c_str(), state.c_str(), uint8(dungeons.size()), lfg::ConcatenateDungeons(dungeons).c_str(), - lfg::GetRolesString(sLFGMgr->GetRoles(guid)).c_str(), sLFGMgr->GetComment(guid).c_str()); + lfg::GetRolesString(sLFGMgr->GetRoles(guid)).c_str()); } class lfg_commandscript : public CommandScript |