1234567891011121314151617181920212223242526272829303132333435363738 |
- #pragma once
- #include "ChatCommandExecutor.h"
- #include "ChatMessage.h"
- #include "ChatObserver.h"
- class Chat : public virtual Framework::ReferenceCounter
- {
- public:
- static const Framework::Text CHANNEL_INFO;
- static const Framework::Text CHANNEL_WARNING;
- static const Framework::Text CHANNEL_ERROR;
- private:
- ChatCommandExecutor* commandExecutor;
- Framework::RCArray<ChatMessage> history;
- Framework::RCArray<ChatObserver> observer;
- Framework::Critical cs;
- void addMessage(ChatMessage* message);
-
- public:
- Chat();
- ~Chat();
- void addObserver(int entityId);
- void removeObserver(int entityId);
- void chatApi(Framework::StreamReader* zRequest,
- Entity* zSource,
- NetworkMessage* zResponse);
- void broadcastMessage(Framework::Text message, Framework::Text channel);
- void sendMessageTo(
- Framework::Text message, Entity* zTarget, Framework::Text channel);
- void save();
- ChatCommandExecutor* zCommandExecutor() const;
-
- static Framework::Text getPlayerChannelName(Framework::Text playerName);
- };
|