#include <ServerChannelManager.h>

Public Member Functions | |
| void | sendText (const ChannelText &text, bool serverLog, bool filter=true) |
| void | sendText (const ChannelText &text, unsigned int destination, bool serverLog, bool filter=true) |
| std::list < MessageEntry > & | getLastMessages () |
| std::list< std::string > | getAllChannels () |
| void | simulate (float frameTime) |
| void | destinationDisconnected (unsigned int destinationId) |
| void | refreshDestination (unsigned int destinationId) |
| virtual bool | processMessage (NetMessage &message, const char *messageType, NetBufferReader &reader) |
Static Public Member Functions | |
| static ServerChannelManager * | instance () |
Protected Member Functions | |
| ChannelEntry * | getChannelEntryByName (const std::string &name) |
| DestinationEntry * | getDestinationEntryById (unsigned int destinationId) |
| void | registerClient (unsigned int destinationId, unsigned int localId, std::list< ChannelDefinition > &startChannels) |
| void | deregisterClient (unsigned int destinationId, unsigned int localId) |
| void | joinClient (unsigned int destinationId, unsigned int localId, std::list< ChannelDefinition > &startChannels) |
| void | actualSend (const ChannelText &constText, std::map< unsigned int, DestinationEntry * > &destinations, bool serverLog, bool filter) |
Protected Attributes | |
| unsigned int | lastMessageId_ |
| float | totalTime_ |
| std::map< unsigned int, DestinationEntry * > | destinationEntries_ |
| std::list < ChannelEntry * > | channelEntries_ |
| std::list< MessageEntry > | lastMessages_ |
Static Protected Attributes | |
| static ServerChannelManager * | instance_ = 0 |
Private Member Functions | |
| ServerChannelManager () | |
| virtual | ~ServerChannelManager () |
Classes | |
| class | ChannelEntry |
| class | DestinationEntry |
| class | DestinationLocalEntry |
| struct | MessageEntry |
Definition at line 31 of file ServerChannelManager.h.
| ServerChannelManager::ServerChannelManager | ( | ) | [private] |
Definition at line 151 of file ServerChannelManager.cpp.
References ComsMessageHandler::addHandler(), channelEntries_, ChannelDefinition::eReadOnlyChannel, ChannelDefinition::eWhisperChannel, ScorchedContext::getComsMessageHandler(), and ScorchedServer::instance().
| ServerChannelManager::~ServerChannelManager | ( | ) | [private, virtual] |
Definition at line 186 of file ServerChannelManager.cpp.
| ServerChannelManager * ServerChannelManager::instance | ( | ) | [static] |
Definition at line 142 of file ServerChannelManager.cpp.
References instance_.
Referenced by ServerStateTooFewPlayersState::acceptStateChange(), ServerStartingState::acceptStateChange(), ServerReadyState::acceptStateChange(), ServerPlayingState::acceptStateChange(), ServerConnectAuthHandler::addNextTank(), ServerNewGameState::addTanksToGame(), adminLog(), ServerAdminCommon::adminSay(), ServerTimedMessage::checkEntries(), ServerKeepAliveHandler::checkKeepAlives(), ServerNewGameState::checkTeamsAuto(), ServerMessageHandler::clientDisconnected(), ServerMessageHandler::destroyPlayer(), ServerStateTooFewPlayersState::enterState(), ServerShotState::enterState(), ServerNextTurnState::enterState(), ServerNextShotState::enterState(), ServerNewGameState::enterState(), ServerCommon::kickPlayer(), ServerHaveModFilesHandler::processMessage(), ServerAdminHandler::processMessage(), ServerAddPlayerHandler::processMessage(), ServerWebAppletHandler::AppletAsyncHandler::processRequest(), ServerShotFinishedState::scoreOverallWinner(), serverLoop(), startServer(), and ServerWebServer::validateUser().
| void ServerChannelManager::sendText | ( | const ChannelText & | text, | |
| bool | serverLog, | |||
| bool | filter = true | |||
| ) |
Definition at line 474 of file ServerChannelManager.cpp.
References actualSend(), and destinationEntries_.
Referenced by ServerStateTooFewPlayersState::acceptStateChange(), ServerStartingState::acceptStateChange(), ServerReadyState::acceptStateChange(), ServerPlayingState::acceptStateChange(), ServerConnectAuthHandler::addNextTank(), ServerNewGameState::addTanksToGame(), adminLog(), ServerAdminCommon::adminSay(), ServerTimedMessage::checkEntries(), ServerKeepAliveHandler::checkKeepAlives(), ServerNewGameState::checkTeamsAuto(), ServerMessageHandler::destroyPlayer(), ServerStateTooFewPlayersState::enterState(), ServerShotState::enterState(), ServerNextTurnState::enterState(), ServerNextShotState::enterState(), ServerNewGameState::enterState(), ServerCommon::kickPlayer(), ServerHaveModFilesHandler::processMessage(), processMessage(), ServerAdminHandler::processMessage(), ServerAddPlayerHandler::processMessage(), ServerShotFinishedState::scoreOverallWinner(), simulate(), and ServerWebServer::validateUser().
| void ServerChannelManager::sendText | ( | const ChannelText & | text, | |
| unsigned int | destination, | |||
| bool | serverLog, | |||
| bool | filter = true | |||
| ) |
Definition at line 461 of file ServerChannelManager.cpp.
References actualSend(), and getDestinationEntryById().
| std::list<MessageEntry>& ServerChannelManager::getLastMessages | ( | ) | [inline] |
Definition at line 45 of file ServerChannelManager.h.
References lastMessages_.
Referenced by ServerWebAppletHandler::AppletAsyncHandler::processRequest().
| std::list< std::string > ServerChannelManager::getAllChannels | ( | ) |
Definition at line 270 of file ServerChannelManager.cpp.
References channelEntries_, and ServerChannelManager::ChannelEntry::getName().
Referenced by ServerWebAppletHandler::AppletAsyncHandler::processRequest().
| void ServerChannelManager::simulate | ( | float | frameTime | ) |
Definition at line 190 of file ServerChannelManager.cpp.
References destinationEntries_, ServerChannelManager::DestinationEntry::getDestinationId(), ServerChannelManager::DestinationEntry::getMessageCount(), ServerChannelManager::DestinationEntry::getMuteTime(), LANG_RESOURCE, LANG_RESOURCE_1, sendText(), ServerChannelManager::DestinationEntry::setMessageCount(), ServerChannelManager::DestinationEntry::setMuteTime(), and totalTime_.
Referenced by serverLoop().
| void ServerChannelManager::destinationDisconnected | ( | unsigned int | destinationId | ) |
Definition at line 238 of file ServerChannelManager.cpp.
References destinationEntries_, and getDestinationEntryById().
Referenced by ServerMessageHandler::clientDisconnected().
| void ServerChannelManager::refreshDestination | ( | unsigned int | destinationId | ) |
Definition at line 317 of file ServerChannelManager.cpp.
References ServerChannelManager::DestinationEntry::addChannel(), ServerChannelAuth::allowConnection(), channelEntries_, ComsChannelMessage::eJoinRequest, ServerChannelManager::ChannelEntry::getAuth(), ComsChannelMessage::getAvailableChannels(), ServerChannelManager::DestinationLocalEntry::getAvailableChannels(), ComsChannelMessage::getChannels(), ServerChannelManager::DestinationLocalEntry::getChannels(), ServerChannelManager::ChannelEntry::getDefinition(), getDestinationEntryById(), ServerChannelManager::DestinationEntry::getLocalEntries(), ServerChannelManager::ChannelEntry::getName(), ServerChannelManager::DestinationEntry::removeChannel(), and ComsMessageSender::sendToSingleClient().
Referenced by ServerAdminHandler::processMessage().
| bool ServerChannelManager::processMessage | ( | NetMessage & | message, | |
| const char * | messageType, | |||
| NetBufferReader & | reader | |||
| ) | [virtual] |
Implements ComsMessageHandlerI.
Definition at line 584 of file ServerChannelManager.cpp.
References deregisterClient(), ComsChannelMessage::eDeregisterRequest, ComsChannelMessage::eJoinRequest, ChannelDefinition::eReadOnlyChannel, ComsChannelMessage::eRegisterRequest, ChannelDefinition::eWhisperChannel, ChannelText::getChannel(), getChannelEntryByName(), ComsChannelMessage::getChannels(), ComsChannelTextMessage::getChannelText(), ServerChannelManager::ChannelEntry::getDefinition(), getDestinationEntryById(), Tank::getDestinationId(), NetMessage::getDestinationId(), ChannelText::getDestPlayerId(), ComsChannelMessage::getId(), ChannelText::getMessage(), ServerChannelManager::DestinationEntry::getMessageCount(), TankState::getMuted(), ServerChannelManager::DestinationEntry::getMuteTime(), ChannelText::getSrcPlayerId(), Tank::getState(), TankContainer::getTankById(), ScorchedContext::getTankContainer(), ChannelDefinition::getType(), ComsChannelMessage::getType(), ServerChannelManager::DestinationEntry::hasChannel(), ScorchedServer::instance(), joinClient(), LANG_RESOURCE, ComsChannelTextMessage::readMessage(), ComsChannelMessage::readMessage(), registerClient(), sendText(), ChannelText::setAdminPlayer(), ChannelText::setChannel(), ServerChannelManager::DestinationEntry::setMessageCount(), ChannelText::setMessageKey(), ChannelText::setMessageValue(), and LangStringUtil::strcmp().
| ServerChannelManager::ChannelEntry * ServerChannelManager::getChannelEntryByName | ( | const std::string & | name | ) | [protected] |
Definition at line 247 of file ServerChannelManager.cpp.
References channelEntries_, and ServerChannelManager::ChannelEntry::getName().
Referenced by actualSend(), and processMessage().
| ServerChannelManager::DestinationEntry * ServerChannelManager::getDestinationEntryById | ( | unsigned int | destinationId | ) | [protected] |
Definition at line 260 of file ServerChannelManager.cpp.
References destinationEntries_.
Referenced by deregisterClient(), destinationDisconnected(), joinClient(), processMessage(), refreshDestination(), registerClient(), and sendText().
| void ServerChannelManager::registerClient | ( | unsigned int | destinationId, | |
| unsigned int | localId, | |||
| std::list< ChannelDefinition > & | startChannels | |||
| ) | [protected] |
Definition at line 284 of file ServerChannelManager.cpp.
References ServerChannelManager::DestinationEntry::addLocalId(), destinationEntries_, getDestinationEntryById(), ServerChannelManager::DestinationEntry::hasLocalId(), and joinClient().
Referenced by processMessage().
| void ServerChannelManager::deregisterClient | ( | unsigned int | destinationId, | |
| unsigned int | localId | |||
| ) | [protected] |
Definition at line 307 of file ServerChannelManager.cpp.
References getDestinationEntryById(), ServerChannelManager::DestinationEntry::hasLocalId(), and ServerChannelManager::DestinationEntry::removeLocalId().
Referenced by processMessage().
| void ServerChannelManager::joinClient | ( | unsigned int | destinationId, | |
| unsigned int | localId, | |||
| std::list< ChannelDefinition > & | startChannels | |||
| ) | [protected] |
Definition at line 413 of file ServerChannelManager.cpp.
References ServerChannelManager::DestinationEntry::addChannel(), ServerChannelAuth::allowConnection(), channelEntries_, ComsChannelMessage::eJoinRequest, ServerChannelManager::ChannelEntry::getAuth(), ComsChannelMessage::getAvailableChannels(), ComsChannelMessage::getChannels(), ServerChannelManager::ChannelEntry::getDefinition(), getDestinationEntryById(), ServerChannelManager::ChannelEntry::getName(), ServerChannelManager::DestinationEntry::hasLocalId(), ServerChannelManager::DestinationEntry::removeChannel(), ComsMessageSender::sendToSingleClient(), and LangStringUtil::strcmp().
Referenced by processMessage(), and registerClient().
| void ServerChannelManager::actualSend | ( | const ChannelText & | constText, | |
| std::map< unsigned int, DestinationEntry * > & | destinations, | |||
| bool | serverLog, | |||
| bool | filter | |||
| ) | [protected] |
Definition at line 479 of file ServerChannelManager.cpp.
References LUAScriptHook::callHook(), LangStringUtil::convertFromLang(), ServerTextFilter::filterString(), S3D::formatStringBuffer(), ChannelText::getAdminPlayer(), ChannelText::getChannel(), getChannelEntryByName(), Target::getCStrName(), ServerChannelManager::DestinationEntry::getDestinationId(), ServerChannelManager::ChannelEntry::getFilter(), ComsChannelTextMessage::getIds(), ServerChannelManager::DestinationEntry::getLocalIds(), ScorchedContext::getLUAScriptHook(), ChannelText::getMessage(), ScorchedContext::getOptionsGame(), Target::getPlayerId(), ChannelText::getSrcPlayerId(), TankContainer::getTankById(), ScorchedContext::getTankContainer(), ServerChannelManager::DestinationEntry::hasChannel(), ScorchedServerUtil::instance(), ScorchedServer::instance(), lastMessageId_, lastMessages_, ServerChannelManager::MessageEntry::message, ServerChannelManager::MessageEntry::messageid, ComsMessageSender::sendToSingleClient(), ServerChannelFilter::sentToDestination(), ServerCommon::serverLog(), ChannelText::setMessage(), and ScorchedServerUtil::textFilter.
Referenced by sendText().
ServerChannelManager * ServerChannelManager::instance_ = 0 [static, protected] |
unsigned int ServerChannelManager::lastMessageId_ [protected] |
float ServerChannelManager::totalTime_ [protected] |
std::map<unsigned int, DestinationEntry *> ServerChannelManager::destinationEntries_ [protected] |
Definition at line 131 of file ServerChannelManager.h.
Referenced by destinationDisconnected(), getDestinationEntryById(), registerClient(), sendText(), and simulate().
std::list<ChannelEntry *> ServerChannelManager::channelEntries_ [protected] |
Definition at line 132 of file ServerChannelManager.h.
Referenced by getAllChannels(), getChannelEntryByName(), joinClient(), refreshDestination(), and ServerChannelManager().
std::list<MessageEntry> ServerChannelManager::lastMessages_ [protected] |
Definition at line 133 of file ServerChannelManager.h.
Referenced by actualSend(), and getLastMessages().
1.5.3