summaryrefslogtreecommitdiff
path: root/src/gamehandler.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/gamehandler.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/gamehandler.h')
-rw-r--r--src/gamehandler.h51
1 files changed, 40 insertions, 11 deletions
diff --git a/src/gamehandler.h b/src/gamehandler.h
index 4a017705..6a2da6e9 100644
--- a/src/gamehandler.h
+++ b/src/gamehandler.h
@@ -24,21 +24,50 @@
#ifndef _TMW_SERVER_GAMEHANDLER_
#define _TMW_SERVER_GAMEHANDLER_
-#include "messagehandler.h"
+#include "account.h"
+#include "being.h"
+#include "connectionhandler.h"
-class MessageIn;
-class NetComputer;
+class GameClient;
-/**
- * Manage main game events & server processing.
+/*
+ * Manage connections to game server.
*/
-class GameHandler : public MessageHandler
+class GameHandler: public ConnectionHandler
{
- public:
- /**
- * Recieve messages related to core game events
- */
- void receiveMessage(NetComputer &computer, MessageIn &message);
+ public:
+ void process();
+
+ /**
+ * Send message to the given being.
+ */
+ void sendTo(tmwserv::BeingPtr beingPtr, MessageOut &msg);
+
+ protected:
+ NetComputer *computerConnected(ENetPeer *);
+ void computerDisconnected(NetComputer *);
+
+ /**
+ * Process messages related to core game events.
+ */
+ void processMessage(NetComputer *computer, MessageIn &message);
+
+ private:
+ /**
+ * 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(GameClient &computer, std::string const &text);
+
+ void removeOutdatedPending();
};
+/**
+ * Register future client attempt. Temporary until physical server split.
+ */
+void registerGameClient(std::string const &, tmwserv::BeingPtr);
+
+extern GameHandler *gameHandler;
+
#endif