Add ambient sound system and eliminate log spam

- Implement AmbientSoundManager with tavern/outdoor ambience
- Fix audio buffer limit (5s → 60s) for long ambient loops
- Set log level to INFO to eliminate DEBUG spam (130MB → 3.2MB logs)
- Remove excessive terrain/model/network logging
- Fix ambient sound timer sharing and pitch parameter bugs
This commit is contained in:
Kelsi 2026-02-09 14:50:14 -08:00
parent 4a7e599764
commit dab23f1895
24 changed files with 701 additions and 138 deletions

View file

@ -1522,7 +1522,6 @@ void GameHandler::setOrientation(float orientation) {
}
void GameHandler::handleUpdateObject(network::Packet& packet) {
LOG_INFO("Handling SMSG_UPDATE_OBJECT");
UpdateObjectData data;
if (!UpdateObjectParser::parse(packet, data)) {
@ -1563,24 +1562,19 @@ void GameHandler::handleUpdateObject(network::Packet& packet) {
switch (block.objectType) {
case ObjectType::PLAYER:
entity = std::make_shared<Player>(block.guid);
LOG_INFO("Created player entity: 0x", std::hex, block.guid, std::dec);
break;
case ObjectType::UNIT:
entity = std::make_shared<Unit>(block.guid);
LOG_INFO("Created unit entity: 0x", std::hex, block.guid, std::dec);
break;
case ObjectType::GAMEOBJECT:
entity = std::make_shared<GameObject>(block.guid);
LOG_INFO("Created gameobject entity: 0x", std::hex, block.guid, std::dec);
break;
default:
entity = std::make_shared<Entity>(block.guid);
entity->setType(block.objectType);
LOG_INFO("Created generic entity: 0x", std::hex, block.guid, std::dec,
", type=", static_cast<int>(block.objectType));
break;
}
@ -1948,7 +1942,6 @@ void GameHandler::handleUpdateObject(network::Packet& packet) {
LOG_DEBUG("Updated entity fields: 0x", std::hex, block.guid, std::dec);
} else {
LOG_WARNING("VALUES update for unknown entity: 0x", std::hex, block.guid, std::dec);
}
break;
}
@ -1983,7 +1976,7 @@ void GameHandler::handleUpdateObject(network::Packet& packet) {
}
tabCycleStale = true;
LOG_INFO("Entity count: ", entityManager.getEntityCount());
// Entity count logging disabled
// Late inventory base detection once items are known
if (playerGuid != 0 && invSlotBase_ < 0 && !lastPlayerFields_.empty() && !onlineItems_.empty()) {
@ -2070,7 +2063,7 @@ void GameHandler::handleDestroyObject(network::Packet& packet) {
npcQuestStatus_.erase(data.guid);
tabCycleStale = true;
LOG_INFO("Entity count: ", entityManager.getEntityCount());
// Entity count logging disabled
}
void GameHandler::sendChatMessage(ChatType type, const std::string& message, const std::string& target) {

View file

@ -843,9 +843,6 @@ void NpcManager::initialize(pipeline::AssetManager* am,
npc.isEmoting = false;
npc.isCritter = s.isCritter;
npcs.push_back(npc);
LOG_INFO("NpcManager: spawned '", s.name, "' guid=0x", std::hex, guid, std::dec,
" at GL(", glPos.x, ",", glPos.y, ",", glPos.z, ")");
}
LOG_INFO("NpcManager: initialized ", npcs.size(), " NPCs with ",

View file

@ -924,11 +924,9 @@ bool UpdateObjectParser::parseUpdateBlock(network::Packet& packet, UpdateBlock&
}
bool UpdateObjectParser::parse(network::Packet& packet, UpdateObjectData& data) {
LOG_INFO("Parsing SMSG_UPDATE_OBJECT");
// Read block count
data.blockCount = packet.readUInt32();
LOG_INFO(" Block count: ", data.blockCount);
// Check for out-of-range objects first
if (packet.getReadPos() + 1 <= packet.getSize()) {
@ -937,7 +935,6 @@ bool UpdateObjectParser::parse(network::Packet& packet, UpdateObjectData& data)
if (firstByte == static_cast<uint8_t>(UpdateType::OUT_OF_RANGE_OBJECTS)) {
// Read out-of-range GUID count
uint32_t count = packet.readUInt32();
LOG_INFO(" Out-of-range objects: ", count);
for (uint32_t i = 0; i < count; ++i) {
uint64_t guid = readPackedGuid(packet);
@ -968,7 +965,6 @@ bool UpdateObjectParser::parse(network::Packet& packet, UpdateObjectData& data)
data.blocks.push_back(block);
}
LOG_INFO("Successfully parsed ", data.blocks.size(), " update blocks");
return true;
}