summaryrefslogtreecommitdiff
path: root/src/chathandler.h
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-05-23 05:35:13 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-05-23 05:35:13 +0000
commit351f050dd77c7dfae7ab901b9dab08336e59b4fc (patch)
tree709142480b61e116eca5ac17685e29b6fe658e5a /src/chathandler.h
parent71ef3ccdc4d628e93d445251121f36a35c6f6a4e (diff)
downloadmanaserv-351f050dd77c7dfae7ab901b9dab08336e59b4fc.tar.gz
manaserv-351f050dd77c7dfae7ab901b9dab08336e59b4fc.tar.bz2
manaserv-351f050dd77c7dfae7ab901b9dab08336e59b4fc.tar.xz
manaserv-351f050dd77c7dfae7ab901b9dab08336e59b4fc.zip
Split server into three logical servers: an account server, a chat
server, and a game server.
Diffstat (limited to 'src/chathandler.h')
-rw-r--r--src/chathandler.h104
1 files changed, 61 insertions, 43 deletions
diff --git a/src/chathandler.h b/src/chathandler.h
index d7273528..b5a81375 100644
--- a/src/chathandler.h
+++ b/src/chathandler.h
@@ -26,55 +26,73 @@
#include <iosfwd>
-#include "messagehandler.h"
+#include "connectionhandler.h"
-class MessageIn;
-class NetComputer;
-class ClientComputer;
+class ChatClient;
/**
* Manages all chat related
*/
-class ChatHandler : public MessageHandler
+class ChatHandler : public ConnectionHandler
{
- public:
- /**
- * Receives chat related messages.
- */
- void receiveMessage(NetComputer &computer, MessageIn &message);
-
- private:
- /**
- * Deals with command messages
- */
- void handleCommand(ClientComputer &computer, const std::string& command);
-
- /**
- * Tells the player to be more polite.
- */
- void warnPlayerAboutBadWords(ClientComputer &computer);
-
- /**
- * Announce a message to every being in the default channel.
- */
- void announce(ClientComputer &computer, const std::string& text);
-
- /**
- * Display a message to every player around one's player
- * in the default channel.
- * The tile area has been set to 10 for now.
- */
- void sayAround(ClientComputer &computer, const std::string& text);
-
- /**
- * Say something private to a player.
- */
- void sayToPlayer(ClientComputer &computer, const std::string& playerName, const std::string& text);
-
- /**
- * Say something in a specific channel.
- */
- void sayInChannel(ClientComputer &computer, short channel, const std::string& text);
+ public:
+ void process();
+
+ protected:
+ /**
+ * Process chat related messages.
+ */
+ void processMessage(NetComputer *computer, MessageIn &message);
+ NetComputer *computerConnected(ENetPeer *);
+ void computerDisconnected(NetComputer *);
+
+ private:
+ /**
+ * Deal with command messages.
+ */
+ void handleCommand(ChatClient &computer, std::string const &command);
+
+ /**
+ * Tell the player to be more polite.
+ */
+ void warnPlayerAboutBadWords(ChatClient &computer);
+
+ /**
+ * Announce a message to every being in the default channel.
+ */
+ void announce(ChatClient &computer, std::string const &text);
+
+ /**
+ * Say something private to a player.
+ */
+ void sayToPlayer(ChatClient &computer, std::string const &playerName, std::string const &text);
+
+ /**
+ * Say something in a specific channel.
+ */
+ void sayInChannel(ChatClient &computer, short channel, std::string const &);
+
+ /**
+ * Send packet to every client in a registered channel.
+ */
+ void sendInChannel(short channelId, MessageOut &);
+
+ /**
+ * Tell a list of user they are leaving a channel.
+ */
+ void makeUsersLeaveChannel(short channelId);
+
+ /**
+ * Tell a list of user about an event in a chatchannel about a player.
+ */
+ void warnUsersAboutPlayerEventInChat(short channelId, std::string const &userName, char eventId);
+
+ void removeOutdatedPending();
};
+/**
+ * Register future client attempt. Temporary until physical server split.
+ */
+void registerChatClient(std::string const &, std::string const &, int);
+
#endif