This commit is contained in:
Max-Wilhelm Bruker
2009-10-29 17:13:37 +01:00
parent d329376e93
commit 1c2aa15b22
38 changed files with 638 additions and 1651 deletions

View File

@@ -0,0 +1,36 @@
#ifndef SERVER_PROTOCOLHANDLER_H
#define SERVER_PROTOCOLHANDLER_H
#include <QObject>
#include <QPair>
#include "server.h"
class Server_Player;
class Command;
class Server_ProtocolHandler : public QObject {
Q_OBJECT
private:
Server *server;
QMap<int, QPair<Server_Game *, Server_Player *> > games;
QMap<QString, Server_ChatChannel *> chatChannels;
QString playerName;
Server *getServer() const { return server; }
QPair<Server_Game *, Server_Player *> getGame(int gameId) const;
AuthenticationResult authState;
bool acceptsGameListChanges;
bool acceptsChatChannelListChanges;
public:
Server_ProtocolHandler(Server *_server, QObject *parent = 0);
~Server_ProtocolHandler();
bool getAcceptsGameListChanges() const { return acceptsGameListChanges; }
bool getAcceptsChatChannelListChanges() const { return acceptsChatChannelListChanges; }
const QString &getPlayerName() const { return playerName; }
void processCommand(Command *command);
};
#endif