ClientChannelManager Class Reference

#include <ClientChannelManager.h>

Inheritance diagram for ClientChannelManager:

ComsMessageHandlerI

List of all members.

Public Member Functions

void showText (const ChannelText &text)
void sendText (const ChannelText &text)
std::set< unsigned
int > & 
getMutedPlayers ()
bool registerClient (ClientChannelManagerI *reciever, std::list< std::string > &channels)
bool deregisterClient (ClientChannelManagerI *reciever)
bool changeRegistration (ClientChannelManagerI *reciever, std::list< std::string > &channels)
void addChannel (const char *lookfor, const char *channel)
void removeChannel (const char *channel)
virtual bool processMessage (NetMessage &message, const char *messageType, NetBufferReader &reader)

Static Public Member Functions

static
ClientChannelManager
instance ()

Protected Member Functions

unsigned int getChannelEntry (ClientChannelManagerI *reciever)
void say (std::vector< ConsoleRuleValue > &values)

Protected Attributes

std::set< unsigned int > mutedPlayers_
std::map< unsigned
int, ChannelEntry * > 
recievers_

Static Protected Attributes

static
ClientChannelManager
instance_ = 0
static unsigned int nextRecieverId_ = 0

Private Member Functions

 ClientChannelManager ()
virtual ~ClientChannelManager ()

Classes

class  ChannelEntry


Detailed Description

Definition at line 29 of file ClientChannelManager.h.


Constructor & Destructor Documentation

ClientChannelManager::ClientChannelManager (  )  [private]

Definition at line 69 of file ClientChannelManager.cpp.

References ComsMessageHandler::addHandler(), ConsoleRuleTypeString, ConsoleUtil::formParams(), ScorchedContext::getComsMessageHandler(), ScorchedClient::instance(), and say().

ClientChannelManager::~ClientChannelManager (  )  [private, virtual]

Definition at line 85 of file ClientChannelManager.cpp.


Member Function Documentation

ClientChannelManager * ClientChannelManager::instance (  )  [static]

Definition at line 60 of file ClientChannelManager.cpp.

References instance_.

Referenced by ClientAdmin::adminNoParams(), AdminCheckDialog::adminResult(), ClientAdmin::adminTwoParam(), ProgressDialog::changeTip(), GLWChannelView::draw(), initComsHandlers(), GLWChannelText::itemSelected(), GLWChannelView::joinChannel(), GLWTalkBox::keyDown(), GLWChannelView::leaveChannel(), MessageDialog::MessageDialog(), ClientAddPlayerHandler::processMessage(), GLWChannelText::processNormalText(), ChannelManager::showText(), and FrameTimer::simulate().

void ClientChannelManager::showText ( const ChannelText text  ) 

Definition at line 258 of file ClientChannelManager.cpp.

References ClientChannelManagerI::channelText(), LangStringUtil::convertFromLang(), ChannelText::eNoLog, S3D::formatStringBuffer(), ChannelText::getChannel(), ChannelText::getFlags(), ChannelText::getMessage(), ClientChannelManager::ChannelEntry::getUser(), ClientChannelManager::ChannelEntry::hasChannel(), Logger::log(), and recievers_.

Referenced by ProgressDialog::changeTip(), ChannelManager::showText(), and FrameTimer::simulate().

void ClientChannelManager::sendText ( const ChannelText text  ) 

Definition at line 228 of file ClientChannelManager.cpp.

References TankContainer::getCurrentDestinationId(), TankContainer::getCurrentPlayerId(), Tank::getDestinationId(), Target::getPlayerId(), TankContainer::getPlayingTanks(), ScorchedContext::getTankContainer(), ScorchedClient::instance(), ComsMessageSender::sendToServer(), and ChannelText::setSrcPlayerId().

Referenced by GLWChannelText::itemSelected(), GLWTalkBox::keyDown(), GLWChannelText::processNormalText(), and say().

std::set<unsigned int>& ClientChannelManager::getMutedPlayers (  )  [inline]

Definition at line 38 of file ClientChannelManager.h.

References mutedPlayers_.

Referenced by GLWChannelText::itemSelected(), and ClientAddPlayerHandler::processMessage().

bool ClientChannelManager::registerClient ( ClientChannelManagerI reciever,
std::list< std::string > &  channels 
)

Definition at line 89 of file ClientChannelManager.cpp.

References ComsChannelMessage::eRegisterRequest, getChannelEntry(), ComsChannelMessage::getChannels(), nextRecieverId_, recievers_, and ComsMessageSender::sendToServer().

Referenced by GLWChannelView::draw(), and MessageDialog::MessageDialog().

bool ClientChannelManager::deregisterClient ( ClientChannelManagerI reciever  ) 

Definition at line 114 of file ClientChannelManager.cpp.

References ComsChannelMessage::eDeregisterRequest, getChannelEntry(), recievers_, and ComsMessageSender::sendToServer().

bool ClientChannelManager::changeRegistration ( ClientChannelManagerI reciever,
std::list< std::string > &  channels 
)

Definition at line 130 of file ClientChannelManager.cpp.

References ComsChannelMessage::eJoinRequest, getChannelEntry(), ComsChannelMessage::getChannels(), and ComsMessageSender::sendToServer().

Referenced by addChannel(), GLWChannelView::joinChannel(), GLWChannelView::leaveChannel(), and removeChannel().

void ClientChannelManager::addChannel ( const char *  lookfor,
const char *  channel 
)

Definition at line 151 of file ClientChannelManager.cpp.

References changeRegistration(), ClientChannelManager::ChannelEntry::getChannels(), ClientChannelManager::ChannelEntry::getUser(), ClientChannelManager::ChannelEntry::hasChannel(), and recievers_.

Referenced by ClientAdmin::adminNoParams(), AdminCheckDialog::adminResult(), and ClientAdmin::adminTwoParam().

void ClientChannelManager::removeChannel ( const char *  channel  ) 

Definition at line 178 of file ClientChannelManager.cpp.

References changeRegistration(), ClientChannelManager::ChannelEntry::getChannels(), ClientChannelManager::ChannelEntry::getUser(), ClientChannelManager::ChannelEntry::hasChannel(), and recievers_.

Referenced by ClientAdmin::adminNoParams(), and AdminCheckDialog::adminResult().

bool ClientChannelManager::processMessage ( NetMessage message,
const char *  messageType,
NetBufferReader reader 
) [virtual]

Implements ComsMessageHandlerI.

Definition at line 286 of file ClientChannelManager.cpp.

References FixedVector::asVector(), ClientChannelManagerI::channelText(), LangStringUtil::convertFromLang(), ComsChannelMessage::eJoinRequest, S3D::formatStringBuffer(), ScorchedContext::getActionController(), ComsChannelMessage::getAvailableChannels(), ChannelText::getChannel(), ComsChannelMessage::getChannels(), ComsChannelTextMessage::getChannelText(), Target::getCStrName(), ComsChannelMessage::getId(), ComsChannelTextMessage::getIds(), ChannelText::getMessage(), TankState::getMuted(), Tank::getPosition(), ChannelText::getSrcPlayerId(), TankState::getState(), Tank::getState(), TankContainer::getTankById(), ScorchedContext::getTankContainer(), TankPosition::getTankTurretPosition(), ComsChannelMessage::getType(), ClientChannelManager::ChannelEntry::getUser(), ScorchedClient::instance(), Logger::log(), ComsChannelTextMessage::readMessage(), ComsChannelMessage::readMessage(), recievers_, ClientChannelManagerI::registeredForChannels(), ClientChannelManager::ChannelEntry::setChannels(), TankState::sNormal, and LangStringUtil::strcmp().

unsigned int ClientChannelManager::getChannelEntry ( ClientChannelManagerI reciever  )  [protected]

Definition at line 205 of file ClientChannelManager.cpp.

References ClientChannelManager::ChannelEntry::getUser(), and recievers_.

Referenced by changeRegistration(), deregisterClient(), and registerClient().

void ClientChannelManager::say ( std::vector< ConsoleRuleValue > &  values  )  [protected]

Definition at line 218 of file ClientChannelManager.cpp.

References LANG_STRING, sendText(), and ConsoleRuleValue::valueString.

Referenced by ClientChannelManager().


Member Data Documentation

ClientChannelManager * ClientChannelManager::instance_ = 0 [static, protected]

Definition at line 56 of file ClientChannelManager.h.

Referenced by instance().

unsigned int ClientChannelManager::nextRecieverId_ = 0 [static, protected]

Definition at line 57 of file ClientChannelManager.h.

Referenced by registerClient().

std::set<unsigned int> ClientChannelManager::mutedPlayers_ [protected]

Definition at line 75 of file ClientChannelManager.h.

Referenced by getMutedPlayers().

std::map<unsigned int, ChannelEntry *> ClientChannelManager::recievers_ [protected]

Definition at line 76 of file ClientChannelManager.h.

Referenced by addChannel(), deregisterClient(), getChannelEntry(), processMessage(), registerClient(), removeChannel(), and showText().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:00 2009 for Scorched3D by  doxygen 1.5.3