mirror of
https://github.com/araxiaonline/mod-mythic-plus.git
synced 2026-06-13 03:02:24 -04:00
36 lines
773 B
C++
36 lines
773 B
C++
#ifndef MYTHIC_PLUS_CLIENT_DISPATCHER_H
|
|
#define MYTHIC_PLUS_CLIENT_DISPATCHER_H
|
|
|
|
#include "MpEvent.h"
|
|
#include "Player.h"
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
class MpClientDispatcher
|
|
{
|
|
|
|
public:
|
|
static MpClientDispatcher* instance() {
|
|
static MpClientDispatcher instance;
|
|
return &instance;
|
|
}
|
|
|
|
MpClientDispatcher(const MpClientDispatcher&) = delete;
|
|
MpClientDispatcher& operator=(const MpClientDispatcher&) = delete;
|
|
|
|
// encode and send a message to the client for an event in the map
|
|
bool Dispatch(MpClientEvent event, Player* player, std::vector<std::string>& args);
|
|
|
|
private:
|
|
MpClientDispatcher() {};
|
|
~MpClientDispatcher() {};
|
|
|
|
};
|
|
|
|
#define sMpClientDispatcher MpClientDispatcher::instance()
|
|
|
|
#endif
|
|
|