add perf.alive_count

This commit is contained in:
aozhiwei 2019-08-31 16:34:58 +08:00
parent e728ab7442
commit 7241eb96a2
3 changed files with 6 additions and 1 deletions

View File

@ -169,6 +169,7 @@ void Room::AddPlayer(Player* hum)
accountid_hash_[hum->account_id] = hum;
human_hash_[hum->entity_uniid] = hum;
++alive_count_;
++App::Instance()->perf.alive_count,
grid_service.AddHuman(hum);
hum->FindLocation();
hum->RefreshView();
@ -263,6 +264,7 @@ void Room::CreateAndroid(int robot_num)
moveable_hash_[hum->entity_uniid] = hum;
human_hash_[hum->entity_uniid] = hum;
++alive_count_;
++App::Instance()->perf.alive_count
grid_service.AddHuman(hum);
hum->FindLocation();
hum->RefreshView();
@ -628,6 +630,7 @@ void Room::OnHumanDie(Human* hum)
frame_event.AddExplosionEx(hum, 0, hum->pos, 1);
}
--alive_count_;
--App::Instance()->perf.alive_count;
NotifyUiUpdate();
}
@ -1384,6 +1387,7 @@ void Room::RandRemoveAndroid()
human_hash_.erase(hum->entity_uniid);
removed_robot_hash_[hum->entity_uniid] = hum;
--alive_count_;
--App::Instance()->perf.alive_count;
for (auto& pair : human_hash_) {
pair.second->RemovePartObjects(hum);
}

View File

@ -16,7 +16,7 @@
#include "framework/cpp/httpclientpool.h"
const int ROOM_NUM_LIMIT = 20;
const int ROOM_NUM_LIMIT = 0;
void RoomMgr::Init()
{

View File

@ -12,6 +12,7 @@ struct PerfMonitor
long long test_times = 0;
long long ray_times = 0;
long long ray_time = 0;
long long alive_count = 0;
std::array<long long, 30> params = {};
std::array<int, 30> entity_num = {};
};