1
This commit is contained in:
parent
72b2a382e6
commit
71c9703cff
@ -43,6 +43,7 @@
|
||||
#include "batchsync.h"
|
||||
#include "trigger.h"
|
||||
#include "custom_battle.h"
|
||||
#include "custom_team.h"
|
||||
#include "custom_member.h"
|
||||
|
||||
#include "mt/Param.h"
|
||||
@ -3545,10 +3546,51 @@ void Room::FillCustomBattleHuman()
|
||||
{
|
||||
custom_battle_->TraverseMemberList
|
||||
(
|
||||
[] (CustomMember* member) -> bool
|
||||
[this] (CustomMember* member) -> bool
|
||||
{
|
||||
if (!member->IsJoined()) {
|
||||
auto p = custom_battle_;
|
||||
cs::CMJoin msg;
|
||||
CustomTeam *team;
|
||||
int socket_handle = 0;
|
||||
int ip_saddr = 0;
|
||||
|
||||
Player* hum = NewPlayer();
|
||||
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->room = p->GetRoom();
|
||||
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());
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user