diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 599ac35..082abdd 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -44,20 +44,6 @@ void Room::Init() map_service.Init(MAP_WIDTH / MAP_GRID_WIDTH, MAP_HEIGHT / MAP_GRID_WIDTH, MAP_GRID_WIDTH); CreateThings(); - #if 0 - stats_timer_ = a8::Timer::Instance()->AddRepeatTimer( - 1000 * 5, - a8::XParams() - .SetSender(this), - [] (const a8::XParams& param) - { - Room* room = (Room*)param.sender.GetUserData(); - if (!room->game_over) { - room->OutputDebugLog(); - } - } - ); - #endif if (App::Instance()->HasFlag(1)) { xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * 3, a8::XParams() @@ -80,10 +66,6 @@ void Room::UnInit() game_over_timer = nullptr; } xtimer_attacher.ClearTimerList(); - if (stats_timer_) { - a8::Timer::Instance()->DeleteTimer(stats_timer_); - stats_timer_ = nullptr; - } for (auto& pair : accountid_hash_) { PlayerMgr::Instance()->RemovePlayerBySocket(pair.second->socket_handle); } @@ -138,9 +120,6 @@ void Room::Update(int delta_time) elapsed_time_ -= 50; } long long end_tick = a8::XGetTickCount(); - if (end_tick - begin_tick > profile.max_rundelay) { - profile.max_rundelay = end_tick - begin_tick; - } } int Room::GetPlayerNum() @@ -996,44 +975,6 @@ bool Room::GenSmallCircle(a8::Vec2 big_circle_pos, float big_circle_rad, float s return true; } -void Room::OutputDebugLog() -{ - a8::UdpLog::Instance()->Debug("roomid:%d max_rundelay:%d frame_no:%d game_over:%d game_over_frameno:%d " - "elapsed_time:%d alive_count:%d current_uniid:%d " - "state:%d accountid_hash.size:%d moveable_hash_.size:%d " - "uniid_hash.size:%d human_hash.size:%d ", - { - room_uuid, - profile.max_rundelay, - frame_no, - game_over ? 1 : 0, - game_over_frameno, - elapsed_time_, - alive_count_, - current_uniid, - (int)gas_data.gas_mode, - accountid_hash_.size(), - moveable_hash_.size(), - uniid_hash_.size(), - human_hash_.size(), - }); - { - int entity_num_arr[ET_MAX] = {0}; - a8::MutableXObject* logobj = a8::MutableXObject::NewObject(); - for (auto& pair : uniid_hash_) { - if (pair.second->entity_type >= 0 && pair.second->entity_type < ET_MAX) { - ++(entity_num_arr[pair.second->entity_type]); - } - } - for (int i = 0; i < ET_MAX; ++i) { - logobj->SetVal(a8::XValue(i).GetString(), entity_num_arr[i]); - } - a8::UdpLog::Instance()->Debug("roomid:%d %s", {room_uuid, logobj->ToJsonStr()}); - delete logobj; - } - profile.max_rundelay = 0; -} - void Room::AutoMatchTeam() { #if 0 diff --git a/server/gameserver/room.h b/server/gameserver/room.h index dd83210..56c72d4 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -16,11 +16,6 @@ namespace MetaData struct AirLine; } -struct RoomProfile -{ - long long max_rundelay = 0; -}; - struct timer_list; struct xtimer_list; class Entity; @@ -44,7 +39,6 @@ public: long long game_over_frameno = 0; long long game_over_tick = 0; timer_list* game_over_timer = nullptr; - RoomProfile profile; a8::XTimer xtimer; Plane plane; GridService grid_service; @@ -101,7 +95,6 @@ private: void UpdateGas(); bool GenSmallCircle(a8::Vec2 big_circle_pos, float big_circle_rad, float small_circle_rad, a8::Vec2& out_pos); - void OutputDebugLog(); void AutoMatchTeam(); void MatchTeam(Human* hum); void InitAirDrop(); @@ -120,7 +113,6 @@ private: void NotifyWxVoip(); private: - timer_list* stats_timer_ = nullptr; int elapsed_time_ = 0; int alive_count_ = 0; MetaData::AirLine* airline_ = nullptr;