mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-06 01:03:52 +00:00
43 lines
1.0 KiB
C++
43 lines
1.0 KiB
C++
#ifndef NATS_H
|
|
#define NATS_H
|
|
|
|
#include "nats.h"
|
|
|
|
#include "world_config.h"
|
|
#include "../common/global_define.h"
|
|
#include "../common/types.h"
|
|
#include "../common/timer.h"
|
|
#ifndef PROTO_H
|
|
#define PROTO_H
|
|
#include "../common/proto/message.pb.h"
|
|
#endif
|
|
#include "../common/servertalk.h"
|
|
|
|
class NatsManager
|
|
{
|
|
public:
|
|
NatsManager();
|
|
~NatsManager();
|
|
|
|
void Process();
|
|
void OnChannelMessage(ServerChannelMessage_Struct * msg);
|
|
void OnEmoteMessage(ServerEmoteMessage_Struct * msg);
|
|
void SendAdminMessage(std::string adminMessage);
|
|
void ChannelMessageEvent(eqproto::ChannelMessage* message);
|
|
void CommandMessageEvent(eqproto::CommandMessage* message, const char* reply);
|
|
void SendChannelMessage(eqproto::ChannelMessage* message);
|
|
void Save();
|
|
void Load();
|
|
protected:
|
|
bool connect();
|
|
Timer nats_timer;
|
|
natsConnection *conn = NULL;
|
|
natsStatus s;
|
|
natsStatistics *stats = NULL;
|
|
natsOptions *opts = NULL;
|
|
natsSubscription *channelMessageSub = NULL;
|
|
natsSubscription *commandMessageSub = NULL;
|
|
natsSubscription *adminMessageSub = NULL;
|
|
};
|
|
|
|
#endif |