mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-05 19:46:35 +00:00
[Optimization] Handle channel name filter checks in memory (#2767)
* Handle channel name filter checks in memory With this commit, name filters are loaded into memory when the server loads and new channels are compared against these memory values VS hitting the database each time. * Minor formatting tweaks
This commit is contained in:
@@ -84,14 +84,20 @@ public:
|
||||
void SendAllChannels(Client *c);
|
||||
void Process();
|
||||
static inline std::vector<std::string> GetBlockedChannelNames() { return m_blocked_channel_names; }
|
||||
static inline std::vector<std::string> GetFilteredNames() { return m_filtered_names; }
|
||||
static inline void ClearChannelBlockList() { m_blocked_channel_names.clear(); };
|
||||
static inline void ClearFilteredNameList() { m_filtered_names.clear(); };
|
||||
static void AddToChannelBlockList(const std::string& channel_name);
|
||||
static void AddToFilteredNames(const std::string& name);
|
||||
static bool IsOnChannelBlockList(const std::string& channel_name);
|
||||
static bool IsOnFilteredNameList(const std::string& channel_name);
|
||||
static inline void SetChannelBlockList(std::vector<std::string> new_list) { m_blocked_channel_names = new_list; }
|
||||
static inline void SetFilteredNameList(std::vector<std::string> new_list) { m_filtered_names = new_list; }
|
||||
private:
|
||||
|
||||
LinkedList<ChatChannel*> ChatChannels;
|
||||
static inline std::vector<std::string> m_blocked_channel_names;
|
||||
static inline std::vector<std::string> m_filtered_names;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user