#include <modchannels.h>
Public Member Functions | |
| ModChannelMgr ()=default | |
| ~ModChannelMgr ()=default | |
| void | registerChannel (const std::string &channel) |
| bool | setChannelState (const std::string &channel, ModChannelState state) |
| bool | joinChannel (const std::string &channel, session_t peer_id, std::size_t max_channels=0) |
| bool | leaveChannel (const std::string &channel, session_t peer_id) |
| bool | channelRegistered (const std::string &channel) const |
| ModChannel * | getModChannel (const std::string &channel) |
| bool | canWriteOnChannel (const std::string &channel) const |
| This function check if a local mod can write on the channel. | |
| void | leaveAllChannels (session_t peer_id) |
| const std::vector< u16 > & | getChannelPeers (const std::string &channel) const |
Private Member Functions | |
| bool | removeChannel (const std::string &channel) |
Private Attributes | |
| std::unordered_map< std::string, std::unique_ptr< ModChannel > > | m_registered_channels |
| std::unordered_map< session_t, std::size_t > | m_consumer_channel_counts |
|
default |
|
default |
References canWriteOnChannel(), channelRegistered(), getChannelPeers(), getModChannel(), joinChannel(), leaveAllChannels(), leaveChannel(), registerChannel(), removeChannel(), and setChannelState().
| bool ModChannelMgr::canWriteOnChannel | ( | const std::string & | channel | ) | const |
This function check if a local mod can write on the channel.
| channel |
References m_registered_channels.
Referenced by ~ModChannelMgr(), and Server::sendModChannelMessage().
| bool ModChannelMgr::channelRegistered | ( | const std::string & | channel | ) | const |
References m_registered_channels.
Referenced by ~ModChannelMgr(), getModChannel(), Client::handleCommand_ModChannelMsg(), Server::handleCommand_ModChannelMsg(), joinChannel(), leaveChannel(), removeChannel(), and TestGameDef::sendModChannelMessage().
| const std::vector< u16 > & ModChannelMgr::getChannelPeers | ( | const std::string & | channel | ) | const |
References empty_channel_list, and m_registered_channels.
Referenced by ~ModChannelMgr(), Server::broadcastModChannelMessage(), and leaveChannel().
| ModChannel * ModChannelMgr::getModChannel | ( | const std::string & | channel | ) |
References channelRegistered(), and m_registered_channels.
Referenced by ~ModChannelMgr(), Server::getModChannel(), and TestGameDef::getModChannel().
| bool ModChannelMgr::joinChannel | ( | const std::string & | channel, |
| session_t | peer_id, | ||
| std::size_t | max_channels = 0 ) |
References channelRegistered(), m_consumer_channel_counts, m_registered_channels, and registerChannel().
Referenced by ~ModChannelMgr(), Server::handleCommand_ModChannelJoin(), Server::joinModChannel(), and TestGameDef::joinModChannel().
| void ModChannelMgr::leaveAllChannels | ( | session_t | peer_id | ) |
References m_consumer_channel_counts, and m_registered_channels.
Referenced by ~ModChannelMgr(), and Server::DisconnectPeer().
| bool ModChannelMgr::leaveChannel | ( | const std::string & | channel, |
| session_t | peer_id ) |
References channelRegistered(), getChannelPeers(), m_consumer_channel_counts, m_registered_channels, and removeChannel().
Referenced by ~ModChannelMgr(), Server::handleCommand_ModChannelLeave(), Client::handleCommand_ModChannelSignal(), Server::leaveModChannel(), and TestGameDef::leaveModChannel().
| void ModChannelMgr::registerChannel | ( | const std::string & | channel | ) |
References m_registered_channels.
Referenced by ~ModChannelMgr(), and joinChannel().
|
private |
References channelRegistered(), and m_registered_channels.
Referenced by ~ModChannelMgr(), and leaveChannel().
| bool ModChannelMgr::setChannelState | ( | const std::string & | channel, |
| ModChannelState | state ) |
References m_registered_channels.
Referenced by ~ModChannelMgr(), Client::handleCommand_ModChannelSignal(), and Server::joinModChannel().
|
private |
Referenced by joinChannel(), leaveAllChannels(), and leaveChannel().
|
private |