7#include <unordered_map>
71 const std::vector<u16> &
getChannelPeers(
const std::string &channel)
const;
76 std::unordered_map<std::string, std::unique_ptr<ModChannel>>
Definition modchannels.h:52
void leaveAllChannels(session_t peer_id)
Definition modchannels.cpp:122
std::unordered_map< std::string, std::unique_ptr< ModChannel > > m_registered_channels
Definition modchannels.h:77
bool canWriteOnChannel(const std::string &channel) const
This function check if a local mod can write on the channel.
Definition modchannels.cpp:64
bool channelRegistered(const std::string &channel) const
Definition modchannels.cpp:51
bool joinChannel(const std::string &channel, session_t peer_id)
Definition modchannels.cpp:99
bool leaveChannel(const std::string &channel, session_t peer_id)
Definition modchannels.cpp:107
void registerChannel(const std::string &channel)
Definition modchannels.cpp:74
ModChannel * getModChannel(const std::string &channel)
Definition modchannels.cpp:56
const std::vector< u16 > & getChannelPeers(const std::string &channel) const
Definition modchannels.cpp:129
bool removeChannel(const std::string &channel)
Definition modchannels.cpp:90
bool setChannelState(const std::string &channel, ModChannelState state)
Definition modchannels.cpp:79
Definition modchannels.h:23
bool registerConsumer(session_t peer_id)
Definition modchannels.cpp:10
const std::string & getName() const
Definition modchannels.h:28
const std::vector< u16 > & getChannelPeers() const
Definition modchannels.h:31
ModChannel(const std::string &name)
Definition modchannels.h:25
bool removeConsumer(session_t peer_id)
Definition modchannels.cpp:21
ModChannelState m_state
Definition modchannels.h:37
void setState(ModChannelState state)
Definition modchannels.cpp:44
std::string m_name
Definition modchannels.h:36
bool canWrite() const
Definition modchannels.cpp:39
std::vector< u16 > m_client_consumers
Definition modchannels.h:38
ModChannelState
Definition modchannels.h:15
@ MODCHANNEL_STATE_READ_ONLY
Definition modchannels.h:18
@ MODCHANNEL_STATE_MAX
Definition modchannels.h:19
@ MODCHANNEL_STATE_INIT
Definition modchannels.h:16
@ MODCHANNEL_STATE_READ_WRITE
Definition modchannels.h:17
ModChannelSignal
Definition modchannels.h:42
@ MODCHANNEL_SIGNAL_LEAVE_OK
Definition modchannels.h:45
@ MODCHANNEL_SIGNAL_LEAVE_FAILURE
Definition modchannels.h:46
@ MODCHANNEL_SIGNAL_CHANNEL_NOT_REGISTERED
Definition modchannels.h:47
@ MODCHANNEL_SIGNAL_SET_STATE
Definition modchannels.h:48
@ MODCHANNEL_SIGNAL_JOIN_OK
Definition modchannels.h:43
@ MODCHANNEL_SIGNAL_JOIN_FAILURE
Definition modchannels.h:44
u16 session_t
Definition networkprotocol.h:22