ChatHandler Class Reference

#include <chathandler.hpp>

Inheritance diagram for ChatHandler:

ConnectionHandler List of all members.

Detailed Description

Manages all chat related.

Definition at line 36 of file chathandler.hpp.

Public Member Functions

void process (enet_uint32 timeout=0)
 Overridden from ConnectionHandler to also clean connected clients that haven't sent in a magic token.
bool startListen (enet_uint16 port)
 Start the handler.

Protected Member Functions

void processMessage (NetComputer *computer, MessageIn &message)
 Process chat related messages.
NetComputercomputerConnected (ENetPeer *)
 Called when a computer connects to the server.
void computerDisconnected (NetComputer *)
 Called when a computer disconnects from the server.

Private Member Functions

void handleCommand (ChatClient &computer, std::string const &command)
 Deal with command messages.
void warnPlayerAboutBadWords (ChatClient &computer)
 Tell the player to be more polite.
void announce (ChatClient &computer, std::string const &text)
 Announce a message to every being in the default channel.
void sayToPlayer (ChatClient &computer, std::string const &playerName, std::string const &text)
 Say something private to a player.
void sayInChannel (ChatClient &computer, short channel, std::string const &)
 Say something in a specific channel.
void sendInChannel (short channelId, MessageOut &)
 Send packet to every client in a registered channel.
void warnUsersAboutPlayerEventInChat (short channelId, std::string const &userName, char eventId)
 Tell a list of user about an event in a chatchannel about a player.
void removeOutdatedPending ()
 Removes outdated pending logins.


Member Function Documentation

void ChatHandler::announce ChatClient computer,
std::string const &  text
[private]
 

Announce a message to every being in the default channel.

Definition at line 514 of file chathandler.cpp.

NetComputer * ChatHandler::computerConnected ENetPeer *   )  [protected, virtual]
 

Called when a computer connects to the server.

Initialize an object derived of NetComputer.

Implements ConnectionHandler.

Definition at line 109 of file chathandler.cpp.

void ChatHandler::computerDisconnected NetComputer  )  [protected, virtual]
 

Called when a computer disconnects from the server.

Note: After returning from this method the NetComputer reference is no longer guaranteed to be valid.

Implements ConnectionHandler.

Definition at line 114 of file chathandler.cpp.

void ChatHandler::handleCommand ChatClient computer,
std::string const &  command
[private]
 

Deal with command messages.

Definition at line 492 of file chathandler.cpp.

void ChatHandler::process enet_uint32  timeout = 0  )  [virtual]
 

Overridden from ConnectionHandler to also clean connected clients that haven't sent in a magic token.

See also:
ConnectionHandler::process

Reimplemented from ConnectionHandler.

Definition at line 131 of file chathandler.cpp.

void ChatHandler::processMessage NetComputer computer,
MessageIn message
[protected, virtual]
 

Process chat related messages.

Implements ConnectionHandler.

Definition at line 137 of file chathandler.cpp.

void ChatHandler::removeOutdatedPending  )  [private]
 

Removes outdated pending logins.

These are connected clients that still haven't sent in their magic token.

Definition at line 98 of file chathandler.cpp.

void ChatHandler::sayInChannel ChatClient computer,
short  channel,
std::string const & 
[private]
 

Say something in a specific channel.

Definition at line 558 of file chathandler.cpp.

void ChatHandler::sayToPlayer ChatClient computer,
std::string const &  playerName,
std::string const &  text
[private]
 

Say something private to a player.

Definition at line 537 of file chathandler.cpp.

void ChatHandler::sendInChannel short  channelId,
MessageOut
[private]
 

Send packet to every client in a registered channel.

Definition at line 584 of file chathandler.cpp.

bool ChatHandler::startListen enet_uint16  port  ) 
 

Start the handler.

Reimplemented from ConnectionHandler.

Definition at line 92 of file chathandler.cpp.

void ChatHandler::warnPlayerAboutBadWords ChatClient computer  )  [private]
 

Tell the player to be more polite.

Definition at line 502 of file chathandler.cpp.

void ChatHandler::warnUsersAboutPlayerEventInChat short  channelId,
std::string const &  userName,
char  eventId
[private]
 

Tell a list of user about an event in a chatchannel about a player.

Definition at line 572 of file chathandler.cpp.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 15:39:18 2007 for TMW Server by  doxygen 1.3.9.1