From 19a2d692ca9213bc496c67f4cc7b32ce9147fe91 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 20 May 2020 17:34:08 +0800 Subject: [PATCH] 1 --- server/gameserver/room.cc | 32 ++++++++++++++++---------------- server/gameserver/room.h | 8 ++++---- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 86530d4..f728e2c 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -47,7 +47,7 @@ void Room::Init() } xtimer.Init(RoomXGetTickCount, this, 100, 100); - xtimer_attacher.xtimer = &xtimer; + xtimer_attacher_.xtimer = &xtimer; CreateSpawnPoints(); CreateLoots(); @@ -63,7 +63,7 @@ void Room::UnInit() a8::Timer::Instance()->DeleteTimer(game_over_timer); game_over_timer = nullptr; } - xtimer_attacher.ClearTimerList(); + xtimer_attacher_.ClearTimerList(); for (auto& pair : accountid_hash_) { PlayerMgr::Instance()->RemovePlayerBySocket(pair.second->socket_handle); } @@ -184,10 +184,10 @@ void Room::AddPlayer(Player* hum) int Room::AllocUniid() { - while (GetEntityByUniId(++current_uniid) || - later_add_hash_.find(current_uniid) != later_add_hash_.end() || - current_uniid == 0) {} - return current_uniid; + while (GetEntityByUniId(++current_uniid_) || + later_add_hash_.find(current_uniid_) != later_add_hash_.end() || + current_uniid_ == 0) {} + return current_uniid_; } void Room::ShuaAndroid() @@ -211,7 +211,7 @@ void Room::ShuaAndroid() Room* room = (Room*)param.sender.GetUserData(); room->ShuaAndroid(); }, - &xtimer_attacher.timer_list_); + &xtimer_attacher_.timer_list_); NotifyUiUpdate(); } } @@ -705,9 +705,9 @@ std::set* Room::GetAliveTeam() int Room::NewTeam() { - ++current_teamid; - team_hash_[current_teamid] = std::set(); - return current_teamid; + ++current_teamid_; + team_hash_[current_teamid_] = std::set(); + return current_teamid_; } void Room::TouchPlayerList(a8::XParams param, @@ -1094,7 +1094,7 @@ void Room::InitAirDrop() room->AirDrop(param.param1, param.param2); } }, - &xtimer_attacher.timer_list_); + &xtimer_attacher_.timer_list_); } } @@ -1155,7 +1155,7 @@ void Room::AirDrop(int appear_time, int box_id) param.param3.GetDouble()); } }, - &xtimer_attacher.timer_list_); + &xtimer_attacher_.timer_list_); } } @@ -1258,7 +1258,7 @@ void Room::NotifyUiUpdate() hum->SendUIUpdate(); }); }, - &xtimer_attacher.timer_list_); + &xtimer_attacher_.timer_list_); } void Room::UpdateCarObject(int old_uniid, int new_uniid, a8::Vec2 pos) @@ -1333,7 +1333,7 @@ void Room::NotifyWxVoip() hum->SendWxVoip(); }); }, - &xtimer_attacher.timer_list_); + &xtimer_attacher_.timer_list_); } BornPoint* Room::AllocBornPoint(Human* hum) @@ -1530,7 +1530,7 @@ void Room::NotifyGameStart() Room* room = (Room*)param.sender.GetUserData(); room->SecondRandPoint(); }, - &xtimer_attacher.timer_list_); + &xtimer_attacher_.timer_list_); waiting_start = true; xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * 2, a8::XParams() @@ -1540,7 +1540,7 @@ void Room::NotifyGameStart() Room* room = (Room*)param.sender.GetUserData(); room->waiting_start = false; }, - &xtimer_attacher.timer_list_); + &xtimer_attacher_.timer_list_); } void Room::InitObstacleDatas() diff --git a/server/gameserver/room.h b/server/gameserver/room.h index f817275..68f1696 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -151,17 +151,17 @@ private: int elapsed_time_ = 0; int alive_count_ = 0; MetaData::AirLine* airline_ = nullptr; - a8::XTimerAttacher xtimer_attacher; + a8::XTimerAttacher xtimer_attacher_; - int current_teamid = 0; - int current_uniid = FIXED_OBJECT_MAXID; + int current_teamid_ = 0; + int current_uniid_ = FIXED_OBJECT_MAXID; std::set refreshed_robot_set_; std::map> team_hash_; std::map accountid_hash_; std::map moveable_hash_; std::map uniid_hash_; - std::map later_add_hash_; + std::map later_add_hash_; std::map human_hash_; std::map born_point_hash_;