1
This commit is contained in:
parent
6d435c5f7a
commit
c83a969a84
@ -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;
|
||||
}
|
||||
|
@ -88,6 +88,7 @@ class MatchTeam
|
||||
void UpdateTeamState();
|
||||
void CheckChoose();
|
||||
void CheckPrepare();
|
||||
int GetValidSocketNum();
|
||||
|
||||
private:
|
||||
long long phase_start_tick_ = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user