1
This commit is contained in:
parent
ca9b547686
commit
9bdd7b56dd
@ -2276,31 +2276,34 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
|
||||
new_team->SetInitTeamMemberNum(0);
|
||||
new_team->SetAutoFill(true);
|
||||
}
|
||||
cs::CMJoin join_msg = *msg;
|
||||
for (size_t i = 0; i < moba_teams.size(); ++i) {
|
||||
auto new_team = room_teams.at(i);
|
||||
new_team->SetInitTeamMemberNum(room_teams.at(i)->GetMemberNum());
|
||||
moba_teams.at(i)->TraverseMember
|
||||
(
|
||||
[ip_saddr, socket_handle, msg, p, new_team] (std::shared_ptr<MobaMember> m) -> bool
|
||||
[ip_saddr, socket_handle, join_msg, p, new_team] (std::shared_ptr<MobaMember> m) mutable -> bool
|
||||
{
|
||||
Player* hum = p->GetRoom()->NewPlayer();
|
||||
hum->room = p->GetRoom();
|
||||
hum->proto_version = msg->proto_version();
|
||||
hum->proto_version = join_msg.proto_version();
|
||||
#if 0
|
||||
hum->hero_uniid = a8::XValue(msg.hero_uniid());
|
||||
hum->hero_uniid = a8::XValue(join_msg->hero_uniid());
|
||||
#endif
|
||||
hum->battle_uuid = m->GetNetData()->battle_uuid;
|
||||
hum->is_valid_battle = m->GetNetData()->is_valid_battle;
|
||||
hum->payload = m->GetNetData()->payload;
|
||||
#if 1
|
||||
//msg.set_session_id(member->GetSessionId());
|
||||
//msg.set_team_uuid(team->GetTeamUuid());
|
||||
#endif
|
||||
PlayerMgr::Instance()->
|
||||
CreatePlayerByCMJoin(hum,
|
||||
0,
|
||||
0,
|
||||
*msg
|
||||
join_msg
|
||||
);
|
||||
hum->meta = mt::Hero::GetById(msg->hero_id());
|
||||
hum->meta = mt::Hero::GetById(join_msg.hero_id());
|
||||
if (!hum->meta) {
|
||||
hum->meta = mt::Param::s().human_meta;
|
||||
}
|
||||
@ -2317,8 +2320,8 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
|
||||
hum->ProcSkillList();
|
||||
hum->SetHP(hum->GetBattleContext()->GetMaxHP());
|
||||
hum->SetMaxHP(hum->GetHP());
|
||||
PlayerMgr::Instance()->IncAccountNum(msg->account_id());
|
||||
RoomMgr::Instance()->OnJoinRoomOk(*msg, hum);
|
||||
PlayerMgr::Instance()->IncAccountNum(join_msg.account_id());
|
||||
RoomMgr::Instance()->OnJoinRoomOk(join_msg, hum);
|
||||
new_team->AddMember(hum);
|
||||
return true;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user