1
This commit is contained in:
parent
f55179f4b2
commit
c84825747d
@ -1826,7 +1826,7 @@ void Human::_UpdateMove(int speed)
|
||||
|
||||
void Human::ChangeToRace(RaceType_e race, int level)
|
||||
{
|
||||
if (race != kHumanRace ||
|
||||
if (race != kHumanRace &&
|
||||
race != kZombieRace) {
|
||||
abort();
|
||||
}
|
||||
|
@ -797,6 +797,19 @@ void Room::FillSMUiUpdate(cs::SMUiUpdate& msg)
|
||||
}
|
||||
}
|
||||
if (GetRoomMode() == kZombieMode) {
|
||||
#if 1
|
||||
{
|
||||
zombie_alive_count_ = 0;
|
||||
human_alive_count_ = 0;
|
||||
for (auto& pair : human_hash_) {
|
||||
if (pair.second->GetRace() == kHumanRace) {
|
||||
++human_alive_count_;
|
||||
} else if (pair.second->GetRace() == kZombieRace) {
|
||||
++zombie_alive_count_;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
msg.set_zombie_num(zombie_alive_count_);
|
||||
msg.set_human_num(human_alive_count_);
|
||||
}
|
||||
@ -937,9 +950,9 @@ void Room::UpdateGasInactive()
|
||||
if (human_hash_.size() < GetRoomMaxPlayerNum()) {
|
||||
CreateAndroid(GetRoomMaxPlayerNum() - human_hash_.size());
|
||||
}
|
||||
NotifyUiUpdate();
|
||||
CombineTeam();
|
||||
NotifyGameStart();
|
||||
NotifyUiUpdate();
|
||||
NotifyWxVoip();
|
||||
if (room_type_ != RT_NewBrid) {
|
||||
InitAirDrop();
|
||||
@ -2649,7 +2662,7 @@ void Room::NewBieRoomStart()
|
||||
|
||||
void Room::ZombieModeStart()
|
||||
{
|
||||
if (GetRoomMode() != kZombieMode) {
|
||||
if (GetRoomMode() == kZombieMode) {
|
||||
if (human_hash_.size() != GetRoomMaxPlayerNum()) {
|
||||
abort();
|
||||
}
|
||||
|
@ -127,6 +127,15 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
JoinErrorHandle(msg, 2, hdr.socket_handle);
|
||||
return;
|
||||
}
|
||||
#if 1
|
||||
{
|
||||
cs::CMJoin* mutable_msg = (cs::CMJoin*)&msg;
|
||||
if (mutable_msg->room_mode() != kChiJiMode &&
|
||||
mutable_msg->room_mode() != kZombieMode) {
|
||||
mutable_msg->set_room_mode(kChiJiMode);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
int game_times = 0;
|
||||
RoomType_e self_room_type = GetHumanRoomType(msg, game_times);
|
||||
time_t register_time = f8::ExtractRegisterTimeFromSessionId(msg.session_id());
|
||||
@ -397,6 +406,7 @@ Room* RoomMgr::CreateRoom(const cs::CMJoin& msg,
|
||||
init_info.room_idx = room_idx;
|
||||
init_info.room_uuid = App::Instance()->NewUuid();
|
||||
init_info.room_type = room_type;
|
||||
init_info.room_mode = (RoomMode_e)msg.room_mode();
|
||||
init_info.creator_game_times = game_times;
|
||||
init_info.creator_register_time = creator_register_time;
|
||||
init_info.force_entry_newbie_room = msg.force_entry_newbie_room();
|
||||
|
Loading…
x
Reference in New Issue
Block a user