diff --git a/server/gameserver/mapmgr.cc b/server/gameserver/mapmgr.cc index 3642d04..8a1b5b9 100644 --- a/server/gameserver/mapmgr.cc +++ b/server/gameserver/mapmgr.cc @@ -54,6 +54,24 @@ void MapMgr::AttachRoom(Room* room) room->loots = &loots_; room->buildings = &buildings_; room->map_meta = map_meta_; + #ifdef DEBUG + { + room->xtimer.AddRepeatTimer + ( + SERVER_FRAME_RATE, + a8::XParams() + .SetSender(room), + [] (const a8::XParams& param) + { + Room* room = (Room*)param.sender.GetUserData(); + a8::UdpLog::Instance()->Debug("room_idx:%d real_alive_count:%d", + { + room->room_idx, + room->RealAliveCount() + }); + }); + } + #endif } void MapMgr::CreateThings() diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index cb59b88..16ccd4c 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -19,7 +19,7 @@ #include "framework/cpp/utils.h" const int ROOM_NUM_UP_LIMIT = 900; -const int HUM_NUM_DOWN_LIMIT = 1000; +const int HUM_NUM_DOWN_LIMIT = 1200; static RoomType_e GetHumanRoomType(const cs::CMJoin& msg) { @@ -69,30 +69,13 @@ void RoomMgr::UnInit() void RoomMgr::Update(int delta_time) { - #ifdef DEBUG - static long long last_tick = 0; - #endif long long real_alive_count = 0; for (auto& pair : room_hash_) { Room* room = pair.second; room->Update(delta_time); real_alive_count += room->RealAliveCount(); - #ifdef DEBUG - if (a8::XGetTickCount() - last_tick > 1000 * 1) { - a8::UdpLog::Instance()->Debug("room_idx:%d real_alive_count:%d", - { - room->room_idx, - room->RealAliveCount() - }); - } - #endif } App::Instance()->perf.real_alive_count = real_alive_count; -#ifdef DEBUG - if (a8::XGetTickCount() - last_tick > 1000 * 1) { - last_tick = a8::XGetTickCount(); - } -#endif } void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)