mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
* [Code] DiscordManager Global to Singleton Cleanup * Update discord_manager.h --------- Co-authored-by: Chris Miles <akkadius1@gmail.com>
29 lines
672 B
C++
29 lines
672 B
C++
#ifndef EQEMU_DISCORD_MANAGER_H
|
|
#define EQEMU_DISCORD_MANAGER_H
|
|
|
|
#include <mutex>
|
|
#include <map>
|
|
#include <vector>
|
|
#include "../../common/types.h"
|
|
#include "../repositories/player_event_logs_repository.h"
|
|
#include "../events/player_events.h"
|
|
|
|
class DiscordManager {
|
|
public:
|
|
void QueueWebhookMessage(uint32 webhook_id, const std::string& message);
|
|
void ProcessMessageQueue();
|
|
void QueuePlayerEventMessage(const PlayerEvent::PlayerEventContainer& e);
|
|
|
|
static DiscordManager* Instance()
|
|
{
|
|
static DiscordManager instance;
|
|
return &instance;
|
|
}
|
|
private:
|
|
std::mutex webhook_queue_lock{};
|
|
std::map<uint32, std::vector<std::string>> webhook_message_queue{};
|
|
};
|
|
|
|
|
|
#endif
|