#pragma once #include #include namespace cs { class CMJoin; } class MatchTeamNew; class TeamGroup; class MatchPool : public a8::Singleton { private: MatchPool() {}; friend class a8::Singleton; public: void Init(); void UnInit(); void _CMJoin(f8::MsgHdr* hdr, const cs::CMJoin& msg); private: void TraverseTeam(std::function&, bool&)> func); bool NeedMatch(const cs::CMJoin& msg); std::shared_ptr GetTeam(const std::string& team_uuid); void RemoveTeam(const std::string& team_uuid); void RemoveSocket(int socket_handle); void Update(); private: f8::Attacher timer_attacher_; std::map> team_hash_; std::map>> socket_hash_; std::map> group_hash_; std::map> matching_list_; std::map> matchok_list_; };