1
This commit is contained in:
parent
b3c0362a3e
commit
60d1291e43
@ -324,7 +324,7 @@ void CustomBattle::OnEnter(std::shared_ptr<cs::CMJoin> join_msg, long ip_saddr,
|
||||
NotifyState();
|
||||
auto hum = GetRoom()->GetPlayerByAccountId(join_msg->account_id());
|
||||
if (hum) {
|
||||
hum->ReJoin(ip_saddr, socket_handle, join_msg);
|
||||
hum->ReJoin(ip_saddr, socket_handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ class Human : public Creature
|
||||
void ObstacleInteraction(Obstacle* entity);
|
||||
void SendMobaTeamNotify();
|
||||
void PushJoinRoomMsg();
|
||||
void ReJoin(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg);
|
||||
void ReJoin(long ip_saddr, int socket_handle);
|
||||
const std::shared_ptr<BornPoint> GetBornPoint() { return born_point_; }
|
||||
void SetBornPoint(std::shared_ptr<BornPoint> born_point);
|
||||
void SendViewerUiNotify();
|
||||
|
@ -2247,7 +2247,7 @@ void Human::PushJoinRoomMsg()
|
||||
}
|
||||
}
|
||||
|
||||
void Human::ReJoin(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg1)
|
||||
void Human::ReJoin(long ip_saddr, int socket_handle)
|
||||
{
|
||||
if (!IsPlayer()) {
|
||||
abort();
|
||||
@ -2829,11 +2829,11 @@ int Room::InitWithCustomBattle(long ip_saddr, int socket_handle, std::shared_ptr
|
||||
{
|
||||
auto hum = GetPlayerByAccountId(msg->account_id());
|
||||
if (hum) {
|
||||
hum->ReJoin(ip_saddr, socket_handle, msg);
|
||||
hum->ReJoin(ip_saddr, socket_handle);
|
||||
} else {
|
||||
auto hum = p->GetRoom()->GetRoomOb()->GetByAccountId(msg->account_id());
|
||||
if (hum) {
|
||||
hum->ReJoin(ip_saddr, socket_handle, msg);
|
||||
hum->ReJoin(ip_saddr, socket_handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2865,6 +2865,27 @@ int Room::JoinWithCustomBattle(std::shared_ptr<CustomBattle> p)
|
||||
}
|
||||
|
||||
{
|
||||
if (IsMobaModeRoom()) {
|
||||
|
||||
} else {
|
||||
for (size_t i = 0; i < net_teams.size(); ++i) {
|
||||
auto net_team = net_teams.at(i);
|
||||
auto room_team = room_teams.at(i);
|
||||
room_team->SetInitTeamMemberNum(net_team->GetMemberNum());
|
||||
net_team->TraverseMember
|
||||
(
|
||||
[this, p, room_team] (std::shared_ptr<CustomMember> m) mutable -> bool
|
||||
{
|
||||
if (!m->IsAndroid()) {
|
||||
Player* hum = InternalCreatePlayer(p, m, room_team);
|
||||
} else {
|
||||
Human* hum = CreateAndroidWithCustomMember(m, room_team);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
p->TraverseObList
|
||||
(
|
||||
[this, p] (std::shared_ptr<CustomMember> m) mutable -> bool
|
||||
@ -2892,7 +2913,7 @@ int Room::JoinWithCustomBattle(std::shared_ptr<CustomBattle> p)
|
||||
if (!m->IsAndroid()) {
|
||||
auto hum = GetPlayerByAccountId(m->GetAccountId());
|
||||
if (hum) {
|
||||
hum->ReJoin(m->GetIpSaddr(), m->GetSocketHandle(), nullptr);
|
||||
hum->ReJoin(m->GetIpSaddr(), m->GetSocketHandle());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -2906,7 +2927,7 @@ int Room::JoinWithCustomBattle(std::shared_ptr<CustomBattle> p)
|
||||
if (!m->IsAndroid()) {
|
||||
auto hum = GetRoomOb()->GetByAccountId(m->GetAccountId());
|
||||
if (hum) {
|
||||
hum->ReJoin(m->GetIpSaddr(), m->GetSocketHandle(), nullptr);
|
||||
hum->ReJoin(m->GetIpSaddr(), m->GetSocketHandle());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -533,6 +533,12 @@ void Room::CreateAndroid(int robot_num, std::shared_ptr<Team> team)
|
||||
NotifyUiUpdate();
|
||||
}
|
||||
|
||||
Human* Room::CreateAndroidWithCustomMember(std::shared_ptr<CustomMember> custom_member,
|
||||
std::shared_ptr<Team> team)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Room::FillSMJoinedNotify(Human* self_hum, cs::SMJoinedNotify& msg)
|
||||
{
|
||||
msg.set_team_mode(msg.team_mode());
|
||||
|
@ -42,6 +42,7 @@ struct FrameEventData;
|
||||
class SandTable;
|
||||
class BatchSync;
|
||||
class CustomBattle;
|
||||
class CustomMember;
|
||||
class RoomAgent;
|
||||
class RoomOb;
|
||||
|
||||
@ -285,6 +286,8 @@ public:
|
||||
std::shared_ptr<CustomBattle> p);
|
||||
int JoinWithCustomBattle(std::shared_ptr<CustomBattle> p);
|
||||
void CreateAndroid(int android_num, std::shared_ptr<Team> team = nullptr);
|
||||
Human* CreateAndroidWithCustomMember(std::shared_ptr<CustomMember> custom_member,
|
||||
std::shared_ptr<Team> team = nullptr);
|
||||
int GetFullLevelIdx() { return ++curr_full_level_idx_;}
|
||||
std::shared_ptr<RoomOb> GetRoomOb();
|
||||
void SendSMTeamFull(Human* hum);
|
||||
|
@ -542,7 +542,7 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu
|
||||
}
|
||||
auto hum = p->GetRoom()->GetPlayerByAccountId(join_msg->account_id());
|
||||
if (hum) {
|
||||
hum->ReJoin(ip_saddr, socket_handle, join_msg);
|
||||
hum->ReJoin(ip_saddr, socket_handle);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user