This commit is contained in:
aozhiwei 2023-12-29 10:42:18 +08:00
parent b5fc67b67c
commit 0719cb89c7
2 changed files with 24 additions and 0 deletions

View File

@ -2346,6 +2346,8 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
[ip_saddr, socket_handle, join_msg, p, new_team] (std::shared_ptr<MobaMember> m) mutable -> bool
{
Player* hum = p->GetRoom()->NewPlayer();
//hum->ip_saddr = ip_saddr;
//hum->socket_handle = socket_handle;
hum->room = p->GetRoom();
hum->proto_version = join_msg.proto_version();
#if 0
@ -2389,6 +2391,14 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
PlayerMgr::Instance()->IncAccountNum(join_msg.account_id());
RoomMgr::Instance()->OnJoinRoomOk(join_msg, hum);
new_team->AddMember(hum);
#ifdef MYDEBUG
a8::XPrintf("moba init1 uniid:%d team_id:%d side:%d\n",
{
hum->GetUniId(),
hum->GetTeam()->GetTeamId(),
hum->side
});
#endif
return true;
});
};
@ -2405,6 +2415,15 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
hum->side = side;
hum->born_point->wo_meta = std::get<0>(GetMapMeta()->moba_born_points.at(side - 1));
hum->InitMobaRoad();
#ifdef MYDEBUG
a8::XPrintf("moba init uniid:%d team_id:%d side:%d\n",
{
hum->GetUniId(),
hum->GetTeam()->GetTeamId(),
hum->side
});
#endif
return true;
});
if (side == 1) {
side = 2;
@ -2412,12 +2431,14 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
side = 1;
}
}
#if 1
{
auto hum = GetPlayerByAccountId(msg->account_id());
if (hum) {
hum->ReJoin(ip_saddr, socket_handle, msg, p);
}
}
#endif
#ifdef MYDEBUG
a8::XPrintf("InitWithMobaBattle\n", {});
#endif

View File

@ -419,6 +419,9 @@ void Room::ShuaAndroid()
if (GetGasData().GetGasMode() != GasInactive) {
return;
}
if (IsMobaModeRoom()) {
return;
}
int robot_num = a8::RandEx(map_meta_->refresh_robot_min_num,
map_meta_->refresh_robot_max_num);
int refresh_time = a8::RandEx(map_meta_->refresh_robot_min_time,