From 312c3645b8076ee6706d9e299d3d559a5687ecc1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 19 Sep 2019 13:26:35 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 11 +++++++++++ server/gameserver/room.h | 1 + 2 files changed, 12 insertions(+) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index b8bd169..0e132b4 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -629,6 +629,17 @@ void Human::SyncAroundPlayers(const char* file, int line, const char* func) for (Human* hum : cell->human_list) { hum->AddToNewObjects(this); assert(hum->part_objects.find(this) != hum->part_objects.end()); + if (hum->part_objects.find(this) == hum->part_objects.end()) { + if (a8::XGetTickCount() - room->last_debugout_tick > 1000 * 10) { + room->last_debugout_tick = a8::XGetTickCount(); + a8::UdpLog::Instance()->Warning("SyncAroundPlayers error file:%s line:%d func:%s", + { + file, + line, + func + }); + } + } } } } diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 13a674a..a15b3d8 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -47,6 +47,7 @@ public: MapService map_service; long long battle_start_frameno_ = 0; long long pending_request = 0; + long long last_debugout_tick = 0; ~Room(); void Init();