This commit is contained in:
aozhiwei 2020-07-15 10:59:24 +08:00
parent a5364ad0ad
commit d782d47a53
3 changed files with 18 additions and 1 deletions

View File

@ -692,6 +692,7 @@ void Human::SyncAroundPlayers(const char* file, int line, const char* func)
return;
}
#ifdef DEBUG
#if 0
room->CheckPartObjects();
a8::UdpLog::Instance()->Debug("room_idx:%d syncaround begin %s %d %s",
{
@ -701,12 +702,14 @@ void Human::SyncAroundPlayers(const char* file, int line, const char* func)
func
});
#endif
#endif
TouchAllLayerHumanList
(
[this, file, line, func] (Human* hum, bool& stop)
{
hum->AddToNewObjects(this);
#ifdef DEBUG
#if 0
{
std::string objs_str;
for (auto& obj : hum->part_objects) {
@ -723,6 +726,7 @@ void Human::SyncAroundPlayers(const char* file, int line, const char* func)
}
room->CheckPartObjects(hum, this);
hum->InPartObjects(this);
#endif
#endif
assert(hum->part_objects.find(this) != hum->part_objects.end());
if (hum->part_objects.find(this) == hum->part_objects.end()) {
@ -741,6 +745,7 @@ void Human::SyncAroundPlayers(const char* file, int line, const char* func)
}
});
#ifdef DEBUG
#if 0
room->CheckPartObjects();
a8::UdpLog::Instance()->Debug("syncaround end %s %d %s",
{
@ -748,6 +753,7 @@ void Human::SyncAroundPlayers(const char* file, int line, const char* func)
line,
func
});
#endif
#endif
}
@ -3277,12 +3283,14 @@ void Human::ProcDecGridList(std::set<GridCell*>& old_grids,
AddOutObjects(hum);
hum->AddOutObjects(this);
#ifdef DEBUG
#if 0
a8::UdpLog::Instance()->Debug("addoutobjects %d %d",
{
(long long)hum,
hum->GetEntityUniId()
});
#endif
#endif
}
});
room->grid_service->TouchAllLayerEntityList

View File

@ -60,7 +60,7 @@ public:
std::list<metatable::Robot> robot_meta_list;
std::vector<MetaData::Robot> robot_list;
std::list<metatable::AI> ai_meta_list;
std::vector<MetaData::AI> ai_list;
std::list<MetaData::AI> ai_list;
std::map<std::string, MetaData::Parameter*> parameter_hash;
std::map<int, MetaData::Map*> gamemap_hash;

View File

@ -533,6 +533,7 @@ void Room::RemoveObjectLater(RoomEntity* entity)
}
entity->room->RemoveFromEntityHash(entity);
#ifdef DEBUG
#if 0
a8::UdpLog::Instance()->Debug
(
"remove object pointer:%d uniid:%d",
@ -541,6 +542,7 @@ void Room::RemoveObjectLater(RoomEntity* entity)
entity->GetEntityUniId()
}
);
#endif
#endif
delete entity;
};
@ -2371,6 +2373,7 @@ bool Room::RuningInTimer()
#ifdef DEBUG
void Room::InitDebugInfo()
{
#if 0
xtimer.AddRepeatTimer
(
SERVER_FRAME_RATE * 3,
@ -2385,14 +2388,17 @@ void Room::InitDebugInfo()
room->RealAliveCount()
});
});
#endif
}
void Room::UnInitDebugInfo()
{
#if 0
a8::UdpLog::Instance()->Debug("destroy room_idx:%d",
{
GetRoomIdx()
});
#endif
}
#endif
@ -2906,6 +2912,9 @@ void Room::InitAndroidAI()
}
}
for (Android* hum : androids) {
#if 1
hum->SetAiLevel(2);
#endif
if (IsMiniRoom()) {
int rnd = rand() % MetaMgr::Instance()->mini_room_ai_weights_space;
++rnd;