1
This commit is contained in:
parent
6d435c5f7a
commit
c83a969a84
@ -440,6 +440,16 @@ bool MatchTeam::CanCombine(MatchTeam* b)
|
|||||||
#endif
|
#endif
|
||||||
return false;
|
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)) {
|
if (HasSameCurrMember(b)) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
a8::XPrintf("CanCombine 11\n", {});
|
a8::XPrintf("CanCombine 11\n", {});
|
||||||
@ -513,19 +523,9 @@ void MatchTeam::ShuaRobot()
|
|||||||
|
|
||||||
void MatchTeam::StartGame()
|
void MatchTeam::StartGame()
|
||||||
{
|
{
|
||||||
{
|
if (GetValidSocketNum() > 0) {
|
||||||
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);
|
RoomMgr::Instance()->JoinTeam(this);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
for (auto& member : curr_member_hash_) {
|
for (auto& member : curr_member_hash_) {
|
||||||
if (member->socket_handle != 0) {
|
if (member->socket_handle != 0) {
|
||||||
MatchMgr::Instance()->RemoveSocket(member->socket_handle);
|
MatchMgr::Instance()->RemoveSocket(member->socket_handle);
|
||||||
@ -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 UpdateTeamState();
|
||||||
void CheckChoose();
|
void CheckChoose();
|
||||||
void CheckPrepare();
|
void CheckPrepare();
|
||||||
|
int GetValidSocketNum();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
long long phase_start_tick_ = 0;
|
long long phase_start_tick_ = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user