Skip to content

Commit

Permalink
improve: silence a few more noisy tasks (#1589)
Browse files Browse the repository at this point in the history
  • Loading branch information
luan authored Sep 15, 2023
1 parent eb20f26 commit 8c0e9eb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/creatures/monsters/spawns/spawn_monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void SpawnMonster::checkSpawnMonster() {
}

if (spawnedMonsterMap.size() < spawnMonsterMap.size()) {
checkSpawnMonsterEvent = g_scheduler().addEvent(getInterval(), std::bind(&SpawnMonster::checkSpawnMonster, this), __FUNCTION__);
checkSpawnMonsterEvent = g_scheduler().addEvent(getInterval(), std::bind(&SpawnMonster::checkSpawnMonster, this), "SpawnMonster::checkSpawnMonster");
}
}

Expand All @@ -251,7 +251,7 @@ void SpawnMonster::scheduleSpawn(uint32_t spawnMonsterId, spawnBlock_t &sb, uint
spawnMonster(spawnMonsterId, sb.monsterType, sb.pos, sb.direction);
} else {
g_game().addMagicEffect(sb.pos, CONST_ME_TELEPORT);
g_scheduler().addEvent(1400, std::bind(&SpawnMonster::scheduleSpawn, this, spawnMonsterId, sb, interval - NONBLOCKABLE_SPAWN_MONSTER_INTERVAL), __FUNCTION__);
g_scheduler().addEvent(1400, std::bind(&SpawnMonster::scheduleSpawn, this, spawnMonsterId, sb, interval - NONBLOCKABLE_SPAWN_MONSTER_INTERVAL), "SpawnMonster::scheduleSpawn");
}
}

Expand Down
11 changes: 11 additions & 0 deletions src/game/scheduling/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,27 @@ class Task {

bool hasTraceableContext() const {
return std::set<std::string> {
"Creature::checkCreatureWalk",
"Decay::checkDecay",
"Game::checkCreatureAttack",
"Game::checkCreatures",
"Game::checkImbuements",
"Game::checkLight",
"Game::createFiendishMonsters",
"Game::createInfluencedMonsters",
"Game::updateCreatureWalk",
"Game::updateForgeableMonsters",
"GlobalEvents::think",
"LuaEnvironment::executeTimerEvent",
"Modules::executeOnRecvbyte",
"OutputMessagePool::sendAll",
"ProtocolGame::addGameTask",
"ProtocolGame::parsePacketFromDispatcher",
"Raids::checkRaids",
"SpawnMonster::checkSpawnMonster",
"SpawnNpc::checkSpawnNpc",
"Webhook::run",
"sendRecvMessageCallback",
}
.contains(context);
}
Expand Down
2 changes: 1 addition & 1 deletion src/items/decay/decay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void Decay::checkDecay() {
}

if (it != end) {
eventId = g_scheduler().addEvent(std::max<int32_t>(SCHEDULER_MINTICKS, static_cast<int32_t>(it->first - timestamp)), std::bind(&Decay::checkDecay, this), __FUNCTION__);
eventId = g_scheduler().addEvent(std::max<int32_t>(SCHEDULER_MINTICKS, static_cast<int32_t>(it->first - timestamp)), std::bind(&Decay::checkDecay, this), "Decay::checkDecay");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lua/creature/raids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void Raids::checkRaids() {
}
}

checkRaidsEvent = g_scheduler().addEvent(CHECK_RAIDS_INTERVAL * 1000, std::bind(&Raids::checkRaids, this), __FUNCTION__);
checkRaidsEvent = g_scheduler().addEvent(CHECK_RAIDS_INTERVAL * 1000, std::bind(&Raids::checkRaids, this), "Raids::checkRaids");
}

void Raids::clear() {
Expand Down

0 comments on commit 8c0e9eb

Please sign in to comment.