QTfrontend/game.h
changeset 25 27aa8030322b
parent 21 dff476dcaaa3
child 26 e32fa14529f8
equal deleted inserted replaced
24:79c411363184 25:27aa8030322b
    37 #include <QObject>
    37 #include <QObject>
    38 #include <QDialog>
    38 #include <QDialog>
    39 #include <QTcpServer>
    39 #include <QTcpServer>
    40 #include <QTcpSocket>
    40 #include <QTcpSocket>
    41 #include <QByteArray>
    41 #include <QByteArray>
       
    42 #include <QString>
    42 #include "team.h"
    43 #include "team.h"
    43 #include "rndstr.h"
    44 #include "rndstr.h"
    44 
    45 
    45 #define IPC_PORT 46631
    46 #define IPC_PORT 46631
    46 #define MAXMSGCHARS 255
    47 #define MAXMSGCHARS 255
    51 	Q_OBJECT
    52 	Q_OBJECT
    52 public:
    53 public:
    53 	HWGame();
    54 	HWGame();
    54 	void Start(int Resolution, bool Fullscreen);
    55 	void Start(int Resolution, bool Fullscreen);
    55 	void AddTeam(const QString & team);
    56 	void AddTeam(const QString & team);
    56 	
    57 
    57 private:
    58 private:
    58 	QTcpServer * IPCServer;
    59 	QTcpServer * IPCServer;
    59 	QTcpSocket * IPCSocket;
    60 	QTcpSocket * IPCSocket;
    60 	char msgbuf[MAXMSGCHARS];
    61 	char msgbuf[MAXMSGCHARS];
    61 	unsigned char msgbufsize; 
    62 	quint8 msgbufsize;
    62 	unsigned char msgsize;
    63 	quint8 msgsize;
    63 	QString teams[5];
    64 	QString teams[5];
    64 	QString seed;
    65 	QString seed;
    65 	int TeamCount;
    66 	int TeamCount;
    66 	RNDStr seedgen;
    67 	RNDStr seedgen;
    67 	
    68 	QByteArray * demo;
       
    69 
    68 	void SendConfig();
    70 	void SendConfig();
    69 	void SendTeamConfig(int index);
    71 	void SendTeamConfig(int index);
    70 	void ParseMessage();
    72 	void ParseMessage();
    71 	void SendIPC(const char* msg, unsigned char len);
    73 	void SendIPC(const char * msg, quint8 len);
    72 	void SendIPC(const QByteArray buf);
    74 	void SendIPC(const QByteArray & buf);
       
    75 	void SaveDemo(const QString & filename);
       
    76 	QString GetThemeBySeed();
    73 
    77 
    74 private slots:
    78 private slots:
    75 	void NewConnection();
    79 	void NewConnection();
    76 	void ClientDisconnect();
    80 	void ClientDisconnect();
    77 	void ClientRead();
    81 	void ClientRead();