Planeshift
ChatManager Class Reference

#include <chatmanager.h>

Public Member Functions

csString channelsToString ()
 
 ChatManager ()
 
NpcResponseCheckNPCEvent (Client *client, csString &trigger, gemNPC *&target)
 
void HandleCacheMessage (MsgEntry *me, Client *client)
 
void HandleChannelJoinMessage (MsgEntry *me, Client *client)
 
void HandleChannelLeaveMessage (MsgEntry *me, Client *client)
 
void HandleChatMessage (MsgEntry *me, Client *client)
 
void RemoveAllChannels (Client *client)
 
void SendAlliance (const csString &sender, EID senderEID, psGuildAlliance *alliance, psChatMessage &msg)
 actually sends the message to all connected members of the alliance More...
 
void SendGuild (const csString &sender, EID senderEID, psGuildInfo *guild, psChatMessage &msg)
 
void SendMultipleAudioFileHashes (Client *client, const char *voiceFile)
 Starts the process of sending the specified list of files to the client. More...
 
void SendNotice (psChatMessage &msg)
 
void SendServerChannelMessage (psChatMessage &msg, uint32_t channelID)
 
virtual ~ChatManager ()
 
- Public Member Functions inherited from MessageManager< ChatManager >
void HandleMessage (MsgEntry *msg, Client *client)
 Transfers the message to the manager specific function. More...
 
void Subscribe (FunctionPointer fpt, msgtype type, uint32_t flags=0x01)
 Subscribes this manager to a specific message type with a custom callback. More...
 
bool Unsubscribe (msgtype type)
 Unsubscribes this manager from a specific message type. More...
 
bool Unsubscribe (FunctionPointer handler, msgtype type)
 Unsubscribes a specific handler from a specific message type. More...
 
bool UnsubscribeAll ()
 Unsubscribes this manager from all message types. More...
 
virtual ~MessageManager ()
 Unsubscribes all messages then destroys this object. More...
 
- Public Member Functions inherited from MessageManagerBase
csArray< csString > DecodeCommandArea (Client *client, csString target)
 Decodes an area: expression. More...
 
gemObjectFindObjectByString (const csString &str, gemActor *me) const
 Find the object we are referring to in str. More...
 
ClientFindPlayerClient (const char *name)
 Finds Client* of character with given name. More...
 
virtual bool Verify (MsgEntry *pMsg, unsigned int flags, Client *&client)
 

Protected Member Functions

bool FloodControl (csString &newMessage, Client *client)
 If this returns true, all went well. If it returns false, the client was muted. More...
 
void SendAlliance (Client *client, psChatMessage &msg)
 gets the message from a client to dispatch to the alliance chat More...
 
void SendAudioFile (Client *client, const char *voiceFile)
 Sends the actual file to the client if needed. More...
 
void SendAudioFileHash (Client *client, const char *voiceFile, csTicks delay)
 Starts the process of sending the specified file to the client. More...
 
void SendGroup (Client *client, psChatMessage &msg)
 
void SendGuild (Client *client, psChatMessage &msg)
 
void SendSay (uint32_t clientNum, gemActor *actor, psChatMessage &msg, const char *who)
 
void SendShout (Client *client, psChatMessage &msg)
 
void SendTell (psChatMessage &msg, const char *who, Client *client, Client *target)
 

Protected Attributes

csPDelArray< CachedDataaudioFileCache
 
csHash< uint32_t, csString > channelIDs
 
csHash< csString, uint32_t > channelNames
 
csHash< uint32_t, uint32_t > channelSubscribers
 
csHash< uint32_t, uint32_t > channelSubscriptions
 
uint32_t nextChannelID
 

Additional Inherited Members

- Public Types inherited from MessageManager< ChatManager >
typedef void(ChatManager::* FunctionPointer) (MsgEntry *, Client *)
 

Detailed Description

Definition at line 70 of file chatmanager.h.

Constructor & Destructor Documentation

ChatManager::ChatManager ( )
virtual ChatManager::~ChatManager ( )
virtual

Member Function Documentation

csString ChatManager::channelsToString ( )
NpcResponse* ChatManager::CheckNPCEvent ( Client client,
csString &  trigger,
gemNPC *&  target 
)
bool ChatManager::FloodControl ( csString &  newMessage,
Client client 
)
protected

If this returns true, all went well. If it returns false, the client was muted.

void ChatManager::HandleCacheMessage ( MsgEntry me,
Client client 
)
void ChatManager::HandleChannelJoinMessage ( MsgEntry me,
Client client 
)
void ChatManager::HandleChannelLeaveMessage ( MsgEntry me,
Client client 
)
void ChatManager::HandleChatMessage ( MsgEntry me,
Client client 
)
void ChatManager::RemoveAllChannels ( Client client)
void ChatManager::SendAlliance ( const csString &  sender,
EID  senderEID,
psGuildAlliance alliance,
psChatMessage msg 
)

actually sends the message to all connected members of the alliance

void ChatManager::SendAlliance ( Client client,
psChatMessage msg 
)
protected

gets the message from a client to dispatch to the alliance chat

void ChatManager::SendAudioFile ( Client client,
const char *  voiceFile 
)
protected

Sends the actual file to the client if needed.

void ChatManager::SendAudioFileHash ( Client client,
const char *  voiceFile,
csTicks  delay 
)
protected

Starts the process of sending the specified file to the client.

void ChatManager::SendGroup ( Client client,
psChatMessage msg 
)
protected
void ChatManager::SendGuild ( const csString &  sender,
EID  senderEID,
psGuildInfo guild,
psChatMessage msg 
)
void ChatManager::SendGuild ( Client client,
psChatMessage msg 
)
protected
void ChatManager::SendMultipleAudioFileHashes ( Client client,
const char *  voiceFile 
)

Starts the process of sending the specified list of files to the client.

void ChatManager::SendNotice ( psChatMessage msg)
void ChatManager::SendSay ( uint32_t  clientNum,
gemActor actor,
psChatMessage msg,
const char *  who 
)
protected
void ChatManager::SendServerChannelMessage ( psChatMessage msg,
uint32_t  channelID 
)
void ChatManager::SendShout ( Client client,
psChatMessage msg 
)
protected
void ChatManager::SendTell ( psChatMessage msg,
const char *  who,
Client client,
Client target 
)
protected

Member Data Documentation

csPDelArray<CachedData> ChatManager::audioFileCache
protected

Definition at line 101 of file chatmanager.h.

csHash<uint32_t, csString> ChatManager::channelIDs
protected

Definition at line 129 of file chatmanager.h.

csHash<csString, uint32_t> ChatManager::channelNames
protected

Definition at line 131 of file chatmanager.h.

csHash<uint32_t, uint32_t> ChatManager::channelSubscribers
protected

Definition at line 126 of file chatmanager.h.

csHash<uint32_t, uint32_t> ChatManager::channelSubscriptions
protected

Definition at line 123 of file chatmanager.h.

uint32_t ChatManager::nextChannelID
protected

Definition at line 133 of file chatmanager.h.


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