00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __RCON_PROTOCOL_H_
00024 #define __RCON_PROTOCOL_H_
00025
00026 #include "player.h"
00027 #include <QThread>
00028 #include <QUdpSocket>
00029
00030 class Server;
00031
00035 class MAIN_EXPORT RConProtocol : public QObject
00036 {
00037 Q_OBJECT
00038
00039 public:
00040 virtual ~RConProtocol();
00041
00042 bool isConnected() const { return connected; }
00043 const QList<Player> &playerList() const { return players; }
00044
00045 public slots:
00046 virtual void disconnectFromServer()=0;
00047 virtual void sendCommand(const QString &cmd)=0;
00048 virtual void sendPassword(const QString &password)=0;
00049
00050 signals:
00051 void disconnected();
00052 void invalidPassword();
00053 void messageReceived(const QString &cmd);
00054 void playerListUpdated();
00055 void serverNameChanged(const QString &name);
00056
00057 protected:
00058 RConProtocol(Server *server);
00059
00060 bool connected;
00061 QList<Player> players;
00062 Server *server;
00063 QUdpSocket socket;
00064
00065 friend class Server;
00066
00067 protected slots:
00068 virtual void packetReady()=0;
00069 };
00070
00071 #endif