[Expeditions] Refactor expedition caching (#1315)

Add common expedition base class

Use repository for zone and world expedition caching

World now stores members and leader as Member objects instead of ids

This improves readability of the caching methods and lets world cache
expedition dzs and members like zone. World also now caches expeditions
as unique_ptr which will be necessary for future dz callback lambdas
that capture 'this' so addresses don't change on cache vector resizes.
This commit is contained in:
hg
2021-04-07 02:20:35 -04:00
committed by GitHub
parent 0534a2c6be
commit dadc1b2843
27 changed files with 580 additions and 559 deletions
-24
View File
@@ -38,14 +38,9 @@ namespace ExpeditionDatabase
uint32_t InsertExpedition(
const std::string& uuid, uint32_t instance_id, const std::string& expedition_name,
uint32_t leader_id, uint32_t min_players, uint32_t max_players);
std::string LoadExpeditionsSelectQuery();
MySQLRequestResult LoadExpedition(uint32_t expedition_id);
MySQLRequestResult LoadAllExpeditions();
std::vector<ExpeditionLockoutTimer> LoadCharacterLockouts(uint32_t character_id);
std::vector<ExpeditionLockoutTimer> LoadCharacterLockouts(uint32_t character_id,
const std::string& expedition_name);
std::unordered_map<uint32_t, std::unordered_map<std::string, ExpeditionLockoutTimer>>
LoadMultipleExpeditionLockouts(const std::vector<uint32_t>& expedition_ids);
void DeleteAllMembers(uint32_t expedition_id);
void DeleteMember(uint32_t expedition_id, uint32_t character_id);
void DeleteAllCharacterLockouts(uint32_t character_id);
@@ -73,23 +68,4 @@ namespace ExpeditionDatabase
const ExpeditionLockoutTimer& lockout, int seconds);
};
namespace LoadExpeditionColumns
{
enum eLoadExpeditionColumns
{
id = 0,
uuid,
dz_id,
expedition_name,
leader_id,
min_players,
max_players,
add_replay_on_join,
is_locked,
leader_name,
member_id,
member_name
};
};
#endif