This commit is contained in:
aozhiwei 2020-06-01 20:13:10 +08:00
parent b878c5ab41
commit e1b05b6dee
3 changed files with 24 additions and 14 deletions

View File

@ -18,15 +18,12 @@ cs::SMUpdate* FrameMaker::MakeUpdateMsg(const Human* hum)
} }
#endif #endif
for (auto& itr : hum->new_objects) { for (auto& itr : hum->new_objects) {
#if 0 #ifdef DEBUG
if (itr != hum && if (hum->del_objects.find(itr->GetEntityUniId()) != hum->del_objects.end()) {
itr->entity_type == ET_Player && abort();
a8::HasBitFlag(((Human*)
) {
continue;
} }
#endif #endif
itr->FillMFObjectFull(room, msg->add_full_objects()); itr->FillMFObjectFull(room, msg->add_full_objects());
} }
for (auto& itr : hum->part_objects) { for (auto& itr : hum->part_objects) {
Entity* entity = itr; Entity* entity = itr;

View File

@ -667,8 +667,9 @@ void Human::SyncAroundPlayers(const char* file, int line, const char* func)
} }
#ifdef DEBUG #ifdef DEBUG
room->CheckPartObjects(); room->CheckPartObjects();
a8::UdpLog::Instance()->Debug("syncaround begin %s %d %s", a8::UdpLog::Instance()->Debug("room_idx:%d syncaround begin %s %d %s",
{ {
room->GetRoomIdx(),
file, file,
line, line,
func func
@ -702,12 +703,14 @@ void Human::SyncAroundPlayers(const char* file, int line, const char* func)
static long long last_debugout_tick = 0; static long long last_debugout_tick = 0;
if (a8::XGetTickCount() - last_debugout_tick > 1000 * 10) { if (a8::XGetTickCount() - last_debugout_tick > 1000 * 10) {
last_debugout_tick = a8::XGetTickCount(); last_debugout_tick = a8::XGetTickCount();
a8::UdpLog::Instance()->Warning("SyncAroundPlayers error file:%s line:%d func:%s", a8::UdpLog::Instance()->Warning
{ ("SyncAroundPlayers error room_idx:%d, file:%s line:%d func:%s",
file, {
line, room->GetRoomIdx(),
func file,
}); line,
func
});
} }
} }
}); });

View File

@ -483,6 +483,16 @@ void Room::RemoveObjectLater(RoomEntity* entity)
break; break;
} }
entity->room->RemoveFromEntityHash(entity); entity->room->RemoveFromEntityHash(entity);
#ifdef DEBUG
a8::UdpLog::Instance()->Debug
(
"remove object pointer:%d uniid:%d",
{
(long long)entity,
entity->GetEntityUniId()
}
);
#endif
delete entity; delete entity;
}; };
xtimer.AddDeadLineTimerAndAttach(0, xtimer.AddDeadLineTimerAndAttach(0,