eqemu-server/world/dynamic_zone.h
hg dadc1b2843
[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.
2021-04-07 01:20:35 -05:00

42 lines
948 B
C++

#ifndef WORLD_DYNAMIC_ZONE_H
#define WORLD_DYNAMIC_ZONE_H
#include "../common/dynamic_zone_base.h"
class Database;
class ServerPacket;
enum class DynamicZoneStatus
{
Unknown = 0,
Normal,
Expired,
ExpiredEmpty,
};
class DynamicZone : public DynamicZoneBase
{
public:
using DynamicZoneBase::DynamicZoneBase; // inherit base constructors
static DynamicZone* FindDynamicZoneByID(uint32_t dz_id);
static void HandleZoneMessage(ServerPacket* pack);
void SetSecondsRemaining(uint32_t seconds_remaining) override;
DynamicZoneStatus Process(bool force_expire);
protected:
Database& GetDatabase() override;
void SendInstanceAddRemoveCharacter(uint32_t character_id, bool remove) override;
void SendInstanceRemoveAllCharacters() override;
void SendGlobalLocationChange(uint16_t server_opcode, const DynamicZoneLocation& location) override;
private:
void SendZonesDurationUpdate();
bool m_is_pending_early_shutdown = false;
};
#endif