QTfrontend/game.h
changeset 26 e32fa14529f8
parent 25 27aa8030322b
child 28 59f7db859b8a
equal deleted inserted replaced
25:27aa8030322b 26:e32fa14529f8
    49 
    49 
    50 class HWGame : public QDialog
    50 class HWGame : public QDialog
    51 {
    51 {
    52 	Q_OBJECT
    52 	Q_OBJECT
    53 public:
    53 public:
    54 	HWGame();
    54 	HWGame(int Resolution, bool Fullscreen);
    55 	void Start(int Resolution, bool Fullscreen);
    55 	void Start();
    56 	void AddTeam(const QString & team);
    56 	void AddTeam(const QString & team);
       
    57 	void PlayDemo(const QString & demofilename);
    57 
    58 
    58 private:
    59 private:
    59 	QTcpServer * IPCServer;
    60     enum GameType {
       
    61         gtLocal = 1,
       
    62         gtDemo  = 2,
       
    63         gtNet   = 3
       
    64     };
       
    65     QTcpServer * IPCServer;
    60 	QTcpSocket * IPCSocket;
    66 	QTcpSocket * IPCSocket;
    61 	char msgbuf[MAXMSGCHARS];
    67 	char msgbuf[MAXMSGCHARS];
    62 	quint8 msgbufsize;
    68 	quint8 msgbufsize;
    63 	quint8 msgsize;
    69 	quint8 msgsize;
    64 	QString teams[5];
    70 	QString teams[5];
    65 	QString seed;
    71 	QString seed;
    66 	int TeamCount;
    72 	int TeamCount;
    67 	RNDStr seedgen;
    73 	RNDStr seedgen;
    68 	QByteArray * demo;
    74 	QByteArray * demo;
       
    75 	QByteArray * toSendBuf;
       
    76 	int vid_Resolution;
       
    77 	bool vid_Fullscreen;
       
    78 	GameType gameType;
    69 
    79 
    70 	void SendConfig();
    80 	void SendConfig();
    71 	void SendTeamConfig(int index);
    81 	void SendTeamConfig(int index);
    72 	void ParseMessage();
    82 	void ParseMessage();
    73 	void SendIPC(const char * msg, quint8 len);
    83 	void SendIPC(const char * msg, quint8 len);
    74 	void SendIPC(const QByteArray & buf);
    84 	void SendIPC(const QByteArray & buf);
       
    85 	void SendIPCRaw(const char * msg, quint32 len);
    75 	void SaveDemo(const QString & filename);
    86 	void SaveDemo(const QString & filename);
    76 	QString GetThemeBySeed();
    87 	QString GetThemeBySeed();
    77 
    88 
    78 private slots:
    89 private slots:
    79 	void NewConnection();
    90 	void NewConnection();