Luanti 5.16.0-dev
Loading...
Searching...
No Matches
ModChannelMgr Class Reference

#include <modchannels.h>

Collaboration diagram for ModChannelMgr:

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)
bool leaveChannel (const std::string &channel, session_t peer_id)
bool channelRegistered (const std::string &channel) const
ModChannelgetModChannel (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

Constructor & Destructor Documentation

◆ ModChannelMgr()

ModChannelMgr::ModChannelMgr ( )
default

◆ ~ModChannelMgr()

ModChannelMgr::~ModChannelMgr ( )
default

Member Function Documentation

◆ canWriteOnChannel()

bool ModChannelMgr::canWriteOnChannel ( const std::string & channel) const

This function check if a local mod can write on the channel.

Parameters
channel
Returns
true if write is allowed

References m_registered_channels.

◆ channelRegistered()

bool ModChannelMgr::channelRegistered ( const std::string & channel) const

References m_registered_channels.

Referenced by getModChannel(), joinChannel(), leaveChannel(), removeChannel(), and setChannelState().

Here is the caller graph for this function:

◆ getChannelPeers()

const std::vector< u16 > & ModChannelMgr::getChannelPeers ( const std::string & channel) const

References empty_channel_list, and m_registered_channels.

Referenced by leaveChannel().

Here is the caller graph for this function:

◆ getModChannel()

ModChannel * ModChannelMgr::getModChannel ( const std::string & channel)

References channelRegistered(), and m_registered_channels.

Here is the call graph for this function:

◆ joinChannel()

bool ModChannelMgr::joinChannel ( const std::string & channel,
session_t peer_id )

References channelRegistered(), m_registered_channels, and registerChannel().

Here is the call graph for this function:

◆ leaveAllChannels()

void ModChannelMgr::leaveAllChannels ( session_t peer_id)

References m_registered_channels.

◆ leaveChannel()

bool ModChannelMgr::leaveChannel ( const std::string & channel,
session_t peer_id )

References channelRegistered(), getChannelPeers(), m_registered_channels, and removeChannel().

Here is the call graph for this function:

◆ registerChannel()

void ModChannelMgr::registerChannel ( const std::string & channel)

References m_registered_channels.

Referenced by joinChannel().

Here is the caller graph for this function:

◆ removeChannel()

bool ModChannelMgr::removeChannel ( const std::string & channel)
private

References channelRegistered(), and m_registered_channels.

Referenced by leaveChannel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setChannelState()

bool ModChannelMgr::setChannelState ( const std::string & channel,
ModChannelState state )

References channelRegistered(), and m_registered_channels.

Here is the call graph for this function:

Member Data Documentation

◆ m_registered_channels

std::unordered_map<std::string, std::unique_ptr<ModChannel> > ModChannelMgr::m_registered_channels
private

The documentation for this class was generated from the following files: