#include <ServerMessageHandler.h>

Public Member Functions | |
| virtual void | clientConnected (NetMessage &message) |
| virtual void | clientDisconnected (NetMessage &message) |
| virtual void | clientError (NetMessage &message, const char *errorString) |
| virtual void | messageRecv (unsigned int destinationId) |
| virtual void | messageSent (unsigned int destinationId) |
| DestinationInfo * | getDestinationInfo (unsigned int destinationId) |
| void | destroyPlayer (unsigned int playerId, const char *reason) |
| void | destroyTaggedPlayers () |
Static Public Member Functions | |
| static ServerMessageHandler * | instance () |
Protected Member Functions | |
| void | actualDestroyPlayer (unsigned int tankId) |
Protected Attributes | |
| std::map< unsigned int, DestinationInfo > | destinationInfos_ |
Static Protected Attributes | |
| static ServerMessageHandler * | instance_ = 0 |
Private Member Functions | |
| ServerMessageHandler () | |
| virtual | ~ServerMessageHandler () |
Classes | |
| struct | DestinationInfo |
Definition at line 28 of file ServerMessageHandler.h.
| ServerMessageHandler::ServerMessageHandler | ( | ) | [private] |
Definition at line 64 of file ServerMessageHandler.cpp.
| ServerMessageHandler::~ServerMessageHandler | ( | ) | [private, virtual] |
Definition at line 68 of file ServerMessageHandler.cpp.
| ServerMessageHandler * ServerMessageHandler::instance | ( | ) | [static] |
Definition at line 55 of file ServerMessageHandler.cpp.
References instance_.
Referenced by ServerChannelAuthAdmin::allowConnection(), ServerNewGameState::checkBots(), ServerShotFinishedState::enterState(), ServerCommon::kickPlayer(), ServerLinesHandler::processMessage(), ServerAdminHandler::processMessage(), and startServer().
| void ServerMessageHandler::clientConnected | ( | NetMessage & | message | ) | [virtual] |
Implements ComsMessageConnectionHandlerI.
Definition at line 81 of file ServerMessageHandler.cpp.
References ServerBanned::Banned, ScorchedServerUtil::bannedPlayers, destinationInfos_, S3D::formatStringBuffer(), ServerBanned::getBanned(), Tank::getDestinationId(), NetMessage::getDestinationId(), Tank::getIpAddress(), NetMessage::getIpAddress(), NetInterface::getIpName(), ScorchedContext::getNetInterface(), ScorchedContext::getOptionsGame(), TankContainer::getPlayingTanks(), ScorchedContext::getTankContainer(), ScorchedServer::instance(), ScorchedServerUtil::instance(), and Logger::log().
| void ServerMessageHandler::clientDisconnected | ( | NetMessage & | message | ) | [virtual] |
Implements ComsMessageConnectionHandlerI.
Definition at line 136 of file ServerMessageHandler.cpp.
References ServerChannelManager::destinationDisconnected(), destinationInfos_, destroyPlayer(), S3D::formatStringBuffer(), Tank::getDestinationId(), NetMessage::getDestinationId(), NetMessage::getFlags(), NetMessage::getIpAddress(), NetInterface::getIpName(), Target::getPlayerId(), TankContainer::getPlayingTanks(), ScorchedContext::getTankContainer(), ServerChannelManager::instance(), ScorchedServer::instance(), NetMessage::KickDisconnect, Logger::log(), NetMessage::TimeoutDisconnect, and NetMessage::UserDisconnect.
| void ServerMessageHandler::clientError | ( | NetMessage & | message, | |
| const char * | errorString | |||
| ) | [virtual] |
Implements ComsMessageConnectionHandlerI.
Definition at line 268 of file ServerMessageHandler.cpp.
References S3D::formatStringBuffer(), NetMessage::getDestinationId(), ServerCommon::kickDestination(), and Logger::log().
| void ServerMessageHandler::messageRecv | ( | unsigned int | destinationId | ) | [virtual] |
Implements ComsMessageConnectionHandlerI.
Definition at line 72 of file ServerMessageHandler.cpp.
References ServerKeepAliveHandler::instance(), and ServerKeepAliveHandler::keepAlive().
| void ServerMessageHandler::messageSent | ( | unsigned int | destinationId | ) | [virtual] |
| ServerMessageHandler::DestinationInfo * ServerMessageHandler::getDestinationInfo | ( | unsigned int | destinationId | ) |
Definition at line 45 of file ServerMessageHandler.cpp.
References destinationInfos_.
Referenced by ServerChannelAuthAdmin::allowConnection(), ServerLinesHandler::processMessage(), and ServerAdminHandler::processMessage().
| void ServerMessageHandler::destroyPlayer | ( | unsigned int | playerId, | |
| const char * | reason | |||
| ) |
Definition at line 182 of file ServerMessageHandler.cpp.
References actualDestroyPlayer(), TankDeadContainer::addTank(), TankAI::createCopy(), S3D::formatStringBuffer(), TankAIStore::getAIByName(), Target::getCStrName(), Tank::getDestinationId(), ScorchedContext::getGameState(), GameState::getState(), TankState::getState(), Tank::getState(), ScorchedServer::getTankAIs(), TankContainer::getTankById(), ScorchedContext::getTankContainer(), ScorchedServer::getTankDeadContainer(), Target::getTargetName(), ServerChannelManager::instance(), ScorchedServer::instance(), Logger::log(), ServerChannelManager::sendText(), ServerState::ServerStateShot, Tank::setDestinationId(), TankState::setDestroy(), Tank::setKeepAlive(), Tank::setTankAI(), and TankState::sNormal.
Referenced by ServerNewGameState::checkBots(), and clientDisconnected().
| void ServerMessageHandler::destroyTaggedPlayers | ( | ) |
Definition at line 233 of file ServerMessageHandler.cpp.
References actualDestroyPlayer(), TankContainer::getAllTanks(), TankState::getDestroy(), Target::getPlayerId(), Tank::getState(), ScorchedContext::getTankContainer(), and ScorchedServer::instance().
Referenced by ServerShotFinishedState::enterState().
| void ServerMessageHandler::actualDestroyPlayer | ( | unsigned int | tankId | ) | [protected] |
Definition at line 250 of file ServerMessageHandler.cpp.
References TankDeadContainer::addTank(), ScorchedContext::getTankContainer(), ScorchedServer::getTankDeadContainer(), StatsLogger::instance(), ScorchedServer::instance(), TankContainer::removeTank(), ComsMessageSender::sendToAllConnectedClients(), and StatsLogger::tankDisconnected().
Referenced by destroyPlayer(), and destroyTaggedPlayers().
ServerMessageHandler * ServerMessageHandler::instance_ = 0 [static, protected] |
std::map<unsigned int, DestinationInfo> ServerMessageHandler::destinationInfos_ [protected] |
Definition at line 58 of file ServerMessageHandler.h.
Referenced by clientConnected(), clientDisconnected(), and getDestinationInfo().
1.5.3