This commit is contained in:
aozhiwei 2021-09-30 07:35:02 +00:00
parent 9bc5b16112
commit 6d435c5f7a

View File

@ -219,7 +219,6 @@ void MatchTeam::Update()
} else {
UpdateSlave();
}
master_team_->SyncMatchInfo();
if (phase_ == kMatchStartGame && IsMasterTeam()) {
StartGame();
}
@ -321,6 +320,7 @@ void MatchTeam::UpdateMaster()
}
break;
}
master_team_->SyncMatchInfo();
}
void MatchTeam::UpdateSlave()
@ -513,7 +513,19 @@ void MatchTeam::ShuaRobot()
void MatchTeam::StartGame()
{
RoomMgr::Instance()->JoinTeam(this);
{
int valid_socket_num = 0;
for (auto& member : curr_member_hash_) {
if (member->socket_handle != 0) {
if (MatchMgr::Instance()->GetMatchInfo(member->socket_handle)) {
++valid_socket_num;
}
}
}
if (valid_socket_num > 0) {
RoomMgr::Instance()->JoinTeam(this);
}
}
for (auto& member : curr_member_hash_) {
if (member->socket_handle != 0) {
MatchMgr::Instance()->RemoveSocket(member->socket_handle);