#ifndef RAGNAROK_SOURCE_CONTENTS_PLAYERNAMEDICTIONARY_H #define RAGNAROK_SOURCE_CONTENTS_PLAYERNAMEDICTIONARY_H #include #include #include #include #include class CConnection; struct PlayerNameContext { CConnection& connection; const bool& languagePrefix; const int& service; const WORD& language; }; class CPlayerNameDictionary { public: explicit CPlayerNameDictionary(PlayerNameContext& context); virtual ~CPlayerNameDictionary(); std::string Lookup(std::uint32_t id); void Set(std::uint32_t id, std::string name); void Clear(); bool Contains(std::uint32_t id) const; void Update(); private: struct Entry { std::string name; std::uint32_t tick; }; struct Request { std::uint32_t id; std::uint32_t tick; }; /* 0004 */ bool m_enabled; /* 0008 */ std::map m_names; /* 0010 */ std::deque m_pending; /* 0024 */ std::deque m_requests; PlayerNameContext* m_context; }; #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(CPlayerNameDictionary) == 60); #endif #endif