This commit is contained in:
aozhiwei 2022-10-13 17:01:45 +08:00
parent afd51a7366
commit f650112a52

View File

@ -54,6 +54,9 @@ void MatchMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
a8::XPrintf("newteam %s\n", {msg.team_uuid()}); a8::XPrintf("newteam %s\n", {msg.team_uuid()});
#endif #endif
} else { } else {
if (!team->IsValidMember(msg)) {
return;
}
if (team->IsRawMember(msg.account_id())) { if (team->IsRawMember(msg.account_id())) {
return; return;
} }
@ -117,13 +120,15 @@ bool MatchMgr::NeedMatch(const cs::CMJoin& msg)
msg.team_mode() == 1 && msg.team_mode() == 1 &&
msg.auto_fill() && msg.auto_fill() &&
msg.team_slot_num() > 1 && msg.team_slot_num() > 1 &&
msg.team_slot_num() == 3 &&
msg.team_slot_num() < MAX_TEAM_NUM && msg.team_slot_num() < MAX_TEAM_NUM &&
msg.team_members().size() == msg.team_slot_num(); msg.team_members().size() <= msg.team_slot_num();
if (need) { if (need) {
bool found = false; bool found = false;
for (int i = 0; i < msg.team_members().size(); ++i) { for (int i = 0; i < msg.team_members().size(); ++i) {
if (msg.account_id() == msg.team_members(i).account_id()) { if (msg.account_id() == msg.team_members(i).account_id()) {
found = true; found = true;
break;
} }
} }
if (found) { if (found) {