This commit is contained in:
aozhiwei 2022-11-11 13:04:50 +08:00
parent 9507f2ef28
commit c236dcdf0b
2 changed files with 34 additions and 0 deletions

View File

@ -7,6 +7,8 @@
#include "GGListener.h"
#include "matchteam.h"
#include "framework/cpp/utils.h"
void MatchMgr::Init()
{
a8::Timer::Instance()->AddRepeatTimerAndAttach
@ -31,6 +33,12 @@ void MatchMgr::UnInit()
void MatchMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
{
#ifdef DEBUG
{
std::string data = f8::PbToJson(&msg);
a8::XPrintf("CMJoin socket_handle:%d members_size:%d %s\n", {hdr.socket_handle, msg.team_members().size(), data});
}
#endif
if (!NeedMatch(msg)) {
return;
}
@ -89,7 +97,16 @@ bool MatchMgr::NeedMatch(const cs::CMJoin& msg)
need = false;
}
}
#ifdef DEBUG1
a8::XPrintf("needMatch found:%d\n", {found});
#endif
}
#ifdef DEBUG1
{
std::string data = f8::PbToJson(&msg);
a8::XPrintf("CMJoin need:%d members_size:%d %s\n", {need, msg.team_members().size(), data});
}
#endif
return need;
}

View File

@ -8,6 +8,8 @@
#include "metamgr.h"
#include "roommgr.h"
#include "framework/cpp/utils.h"
RawTeamMember::RawTeamMember()
{
msg = std::make_shared<cs::CMJoin>();
@ -274,8 +276,23 @@ void MatchTeam::SyncMatchInfo()
for (auto& member : curr_member_hash_) {
if (member->socket_handle != 0) {
GGListener::Instance()->SendToClient(member->socket_handle, 0, notifymsg);
#ifdef DEBUG
{
a8::XPrintf("SyncMatchInfo sokcet_handle:%d account_id:%s\n",
{
member->socket_handle,
member->msg->account_id()
});
}
#endif
}
}
#ifdef DEBUG
{
std::string data = f8::PbToJson(&notifymsg);
a8::XPrintf("SMUpdateMatchInfo %s\n", {data});
}
#endif
}
void MatchTeam::TryCombineTeam()