feat(db): bbb_autosave table for the client's BBB autosave

The client sends SetBBBAutosave (996) with the model being built every five
minutes, before an AFK kick and before quitting, and expects the server to
rebuild an unfinished model later (RebuildBBBAutosaveMsg). This keeps the
last one per character with the model items that were in the BBB inventory
at the time. MySQL 82 / SQLite 65; parity test included.

Refs #1632

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 04:08:19 -05:00
parent b9d6b739d5
commit 9256b31b23
13 changed files with 187 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
#define TESTSQLDATABASE_H
#include "GameDatabase.h"
#include <map>
class TestSQLDatabase : public GameDatabase {
void Connect() override;
@@ -245,6 +246,16 @@ class TestSQLDatabase : public GameDatabase {
std::vector<ZoneLimit> GetZoneLimits() override { return {}; }
void SetZoneLimit(const ZoneLimit& limit) override {}
void DeleteZoneLimit(uint32_t zoneId) override {}
// IBbbAutosave: kept in memory so the build workflow can be tested
std::optional<IBbbAutosave::Info> GetBbbAutosave(const LWOOBJID characterId) override {
const auto it = m_BbbAutosaves.find(characterId);
if (it == m_BbbAutosaves.end()) return std::nullopt;
return it->second;
}
void SetBbbAutosave(const LWOOBJID characterId, const IBbbAutosave::Info& info) override { m_BbbAutosaves[characterId] = info; }
void DeleteBbbAutosave(const LWOOBJID characterId) override { m_BbbAutosaves.erase(characterId); }
std::map<LWOOBJID, IBbbAutosave::Info> m_BbbAutosaves;
// IPropertyReputation
VisitorHistory GetPropertyVisitorHistory(LWOOBJID propertyId, uint32_t accountId, uint32_t day, uint32_t days) override { return {}; }
int64_t GetPropertyReputationOnDay(LWOOBJID propertyId, uint32_t day) override { return 0; }