diff --git a/server/gameserver/matchpool.cc b/server/gameserver/matchpool.cc index 90738318..34154ba6 100644 --- a/server/gameserver/matchpool.cc +++ b/server/gameserver/matchpool.cc @@ -5,7 +5,7 @@ #include "cs_proto.pb.h" #include "matchpool.h" #include "GGListener.h" -#include "matchteam.h" +#include "matchteamnew.h" void MatchPool::Init() { @@ -20,13 +20,13 @@ void MatchPool::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg) { } -MatchTeam* MatchPool::GetTeam(const std::string& team_uuid) +MatchTeamNew* MatchPool::GetTeam(const std::string& team_uuid) { auto itr = team_hash_.find(team_uuid); return itr != team_hash_.end() ? itr->second : nullptr; } -void MatchPool::TraverseTeam(std::function func) +void MatchPool::TraverseTeam(std::function func) { if (!func) { return; @@ -42,7 +42,7 @@ void MatchPool::TraverseTeam(std::function func) } } -std::tuple* MatchPool::GetMatchInfo(int socket_handle) +std::tuple* MatchPool::GetMatchInfo(int socket_handle) { auto itr = socket_hash_.find(socket_handle); return itr != socket_hash_.end() ? &itr->second : nullptr; diff --git a/server/gameserver/matchpool.h b/server/gameserver/matchpool.h index 10a9190d..d9f923c1 100644 --- a/server/gameserver/matchpool.h +++ b/server/gameserver/matchpool.h @@ -5,7 +5,7 @@ namespace cs class CMJoin; } -class MatchTeam; +class MatchTeamNew; class MatchPool : public a8::Singleton { private: @@ -20,20 +20,20 @@ public: private: - void TraverseTeam(std::function func); + void TraverseTeam(std::function func); bool NeedMatch(const cs::CMJoin& msg); - MatchTeam* GetTeam(const std::string& team_uuid); - std::tuple* GetMatchInfo(int socket_handle); + MatchTeamNew* GetTeam(const std::string& team_uuid); + std::tuple* GetMatchInfo(int socket_handle); void RemoveTeam(const std::string& team_uuid); void RemoveSocket(int socket_handle); private: a8::TimerAttacher timer_attacher_; - std::map team_hash_; - std::map> socket_hash_; + std::map team_hash_; + std::map> socket_hash_; - std::vector matching_list_; - std::vector matchok_list_; + std::vector matching_list_; + std::vector matchok_list_; }; diff --git a/server/gameserver/matchteamnew.cc b/server/gameserver/matchteamnew.cc new file mode 100644 index 00000000..04361ced --- /dev/null +++ b/server/gameserver/matchteamnew.cc @@ -0,0 +1,3 @@ +#include "precompile.h" + +#include "matchteamnew.h" diff --git a/server/gameserver/matchteamnew.h b/server/gameserver/matchteamnew.h new file mode 100644 index 00000000..ea804542 --- /dev/null +++ b/server/gameserver/matchteamnew.h @@ -0,0 +1,12 @@ +#pragma once + +#include "cs_proto.pb.h" + +#include "battledatacontext.h" + +#include "matchteam.h" + +class MatchTeamNew +{ + +};