1
This commit is contained in:
parent
dbf6da43b6
commit
1289519ba1
@ -1191,11 +1191,45 @@ void RoomMgr::_CMJoinMoba(f8::MsgHdr* hdr, const cs::CMJoin& msg)
|
|||||||
p->SetRoom(room.get());
|
p->SetRoom(room.get());
|
||||||
p->TraverseMemberList
|
p->TraverseMemberList
|
||||||
(
|
(
|
||||||
[p, msg] (MobaMember* m) -> bool
|
[p, msg, ip_saddr, socket_handle] (MobaMember* m) -> bool
|
||||||
{
|
{
|
||||||
Player* hum = p->GetRoom()->NewPlayer();
|
Player* hum = p->GetRoom()->NewPlayer();
|
||||||
hum->room = p->GetRoom();
|
hum->room = p->GetRoom();
|
||||||
hum->proto_version = msg.proto_version();
|
hum->proto_version = msg.proto_version();
|
||||||
|
#if 0
|
||||||
|
hum->hero_uniid = a8::XValue(msg.hero_uniid());
|
||||||
|
#endif
|
||||||
|
//hum->battle_uuid = member->GetNetData()->battle_uuid;
|
||||||
|
//hum->is_valid_battle = member->GetNetData()->is_valid_battle;
|
||||||
|
//hum->payload = member->GetNetData()->payload;
|
||||||
|
//msg.set_session_id(member->GetSessionId());
|
||||||
|
//msg.set_team_uuid(team->GetTeamUuid());
|
||||||
|
PlayerMgr::Instance()->
|
||||||
|
CreatePlayerByCMJoin(hum,
|
||||||
|
ip_saddr,
|
||||||
|
socket_handle,
|
||||||
|
msg
|
||||||
|
);
|
||||||
|
hum->meta = mt::Hero::GetById(msg.hero_id());
|
||||||
|
if (!hum->meta) {
|
||||||
|
hum->meta = mt::Param::s().human_meta;
|
||||||
|
}
|
||||||
|
//hum->SetBattleContext(member->GetNetData());
|
||||||
|
hum->GetBattleContext()->Init(hum);
|
||||||
|
{
|
||||||
|
long long hero_uniid = 0;
|
||||||
|
int hero_lv = 1;
|
||||||
|
int quality = 1;
|
||||||
|
hum->GetBattleContext()->GetHeroLvQuality(hero_uniid, hero_lv, quality);
|
||||||
|
hum->hero_uniid = hero_uniid;
|
||||||
|
}
|
||||||
|
p->GetRoom()->AddPlayer(hum);
|
||||||
|
hum->ProcSkillList();
|
||||||
|
hum->SetHP(hum->GetBattleContext()->GetMaxHP());
|
||||||
|
hum->SetMaxHP(hum->GetHP());
|
||||||
|
//member->Join(hum);
|
||||||
|
PlayerMgr::Instance()->IncAccountNum(msg.account_id());
|
||||||
|
RoomMgr::Instance()->OnJoinRoomOk(msg, hum);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user