This commit is contained in:
aozhiwei 2021-09-30 07:44:44 +00:00
parent 6d435c5f7a
commit c83a969a84
2 changed files with 26 additions and 12 deletions

View File

@ -440,6 +440,16 @@ bool MatchTeam::CanCombine(MatchTeam* b)
#endif
return false;
}
if (GetValidSocketNum() <= 0) {
#ifdef DEBUG
a8::XPrintf("CanCombine 21\n", {});
#endif
}
if (b->GetValidSocketNum() <= 0) {
#ifdef DEBUG
a8::XPrintf("CanCombine 22\n", {});
#endif
}
if (HasSameCurrMember(b)) {
#ifdef DEBUG
a8::XPrintf("CanCombine 11\n", {});
@ -513,18 +523,8 @@ void MatchTeam::ShuaRobot()
void MatchTeam::StartGame()
{
{
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);
}
if (GetValidSocketNum() > 0) {
RoomMgr::Instance()->JoinTeam(this);
}
for (auto& member : curr_member_hash_) {
if (member->socket_handle != 0) {
@ -657,3 +657,16 @@ void MatchTeam::AutoPrepare()
}
}
}
int MatchTeam::GetValidSocketNum()
{
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;
}
}
}
return valid_socket_num;
}

View File

@ -88,6 +88,7 @@ class MatchTeam
void UpdateTeamState();
void CheckChoose();
void CheckPrepare();
int GetValidSocketNum();
private:
long long phase_start_tick_ = 0;