1
This commit is contained in:
parent
9e2352260c
commit
4029b36c59
@ -188,15 +188,6 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
hum->SetHP(hum->GetBattleContext()->GetMaxHP());
|
||||
hum->SetMaxHP(hum->GetHP());
|
||||
PlayerMgr::Instance()->IncAccountNum(msg.account_id());
|
||||
if (JsonDataMgr::Instance()->channel != 0 &&
|
||||
JsonDataMgr::Instance()->channel != channel) {
|
||||
f8::UdpLog::Instance()->Warning
|
||||
("join room channel not match channel:%d account_id:%s",
|
||||
{
|
||||
JsonDataMgr::Instance()->channel,
|
||||
msg.account_id()
|
||||
});
|
||||
}
|
||||
RoomMgr::Instance()->OnJoinRoomOk(msg, hum);
|
||||
};
|
||||
SendGetBattleData(0, join_msgs, cb);
|
||||
@ -864,6 +855,7 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
auto cb =
|
||||
[join_msg, socket_handle] (int errcode, const std::string errmsg, std::shared_ptr<CustomBattle> p)
|
||||
{
|
||||
auto& msg = *join_msg;
|
||||
if (!errcode) {
|
||||
RoomMgr::Instance()->JoinErrorHandle(*join_msg, 2, socket_handle);
|
||||
return;
|
||||
@ -887,6 +879,46 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
0, //msg.mapid());
|
||||
p);
|
||||
}
|
||||
Player* hum = p->GetRoom()->NewPlayer();
|
||||
hum->proto_version = msg.proto_version();
|
||||
#if 0
|
||||
hum->hero_uniid = a8::XValue(msg.hero_uniid());
|
||||
#endif
|
||||
#if 0
|
||||
hum->battle_uuid = results.at(0)->battle_uuid;
|
||||
#endif
|
||||
#if 0
|
||||
hum->is_valid_battle = results.at(0)->is_valid_battle;
|
||||
hum->payload = results.at(0)->payload;
|
||||
#endif
|
||||
PlayerMgr::Instance()->
|
||||
CreatePlayerByCMJoin(hum,
|
||||
0, //ip_saddr,
|
||||
socket_handle,
|
||||
msg
|
||||
);
|
||||
hum->meta = mt::Hero::GetById(msg.hero_id());
|
||||
if (!hum->meta) {
|
||||
hum->meta = mt::Param::s().human_meta;
|
||||
}
|
||||
hum->room = p->GetRoom();
|
||||
#if 0
|
||||
hum->SetBattleContext(results.at(0));
|
||||
#endif
|
||||
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());
|
||||
PlayerMgr::Instance()->IncAccountNum(msg.account_id());
|
||||
RoomMgr::Instance()->OnJoinRoomOk(msg, hum);
|
||||
};
|
||||
SendGetCustomBattleData(join_msg, cb);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user