1
This commit is contained in:
parent
2ae6a19c74
commit
fc558fafe5
@ -2313,6 +2313,12 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
for (size_t i = 0; i < 2; ++i) {
|
||||||
|
auto team = room_teams.at(i);
|
||||||
|
for (size_t ii = team->GetMemberNum(); ii < MAX_TEAM_NUM; ++ii) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ void Room::ShowAndroid(Human* target, int num)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Room::CreateAndroid(int robot_num)
|
void Room::CreateAndroid(int robot_num, std::shared_ptr<Team> team)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < robot_num; ++i) {
|
for (int i = 0; i < robot_num; ++i) {
|
||||||
if (human_hash_.size() >= GetRoomMaxPlayerNum()) {
|
if (human_hash_.size() >= GetRoomMaxPlayerNum()) {
|
||||||
@ -499,7 +499,11 @@ void Room::CreateAndroid(int robot_num)
|
|||||||
hum->Initialize();
|
hum->Initialize();
|
||||||
AddToEntityHash(hum);
|
AddToEntityHash(hum);
|
||||||
AddToHumanHash(hum);
|
AddToHumanHash(hum);
|
||||||
MatchTeam(hum);
|
if (team) {
|
||||||
|
team->AddMember(hum);
|
||||||
|
} else {
|
||||||
|
MatchTeam(hum);
|
||||||
|
}
|
||||||
++alive_count_;
|
++alive_count_;
|
||||||
alive_count_chged_frameno_ = GetFrameNo();
|
alive_count_chged_frameno_ = GetFrameNo();
|
||||||
++PerfMonitor::Instance()->alive_count;
|
++PerfMonitor::Instance()->alive_count;
|
||||||
|
@ -283,11 +283,11 @@ public:
|
|||||||
int GenShotUniid() { return ++current_shot_uniid_; }
|
int GenShotUniid() { return ++current_shot_uniid_; }
|
||||||
int InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg,
|
int InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg,
|
||||||
std::shared_ptr<MobaBattle> p);
|
std::shared_ptr<MobaBattle> p);
|
||||||
|
void CreateAndroid(int android_num, std::shared_ptr<Team> team = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ShuaAndroid();
|
void ShuaAndroid();
|
||||||
void ShowAndroid(Human* target, int num);
|
void ShowAndroid(Human* target, int num);
|
||||||
void CreateAndroid(int android_num);
|
|
||||||
void UpdateGas();
|
void UpdateGas();
|
||||||
void UpdateGasInactive();
|
void UpdateGasInactive();
|
||||||
void UpdateGasInactivePvp();
|
void UpdateGasInactivePvp();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user