equal
deleted
inserted
replaced
41 #include <QString> |
41 #include <QString> |
42 #include <QDir> |
42 #include <QDir> |
43 #include <QProcess> |
43 #include <QProcess> |
44 #include <QImage> |
44 #include <QImage> |
45 |
45 |
46 #include "game.h" |
46 #include "tcpBase.h" |
47 |
47 |
48 #include <string> |
48 #include <string> |
49 |
49 |
50 class HWMap : public QObject |
50 class HWMap : public TCPBase |
51 { |
51 { |
52 Q_OBJECT |
52 Q_OBJECT |
53 |
53 |
54 public: |
54 public: |
55 HWMap(); |
55 HWMap(); |
56 virtual ~HWMap(); |
56 virtual ~HWMap(); |
57 void getImage(std::string seed); |
57 void getImage(std::string seed); |
58 |
58 |
|
59 protected: |
|
60 virtual QStringList setArguments(); |
|
61 virtual void onClientDisconnect(); |
|
62 virtual void SendToClientFirst(); |
|
63 |
59 signals: |
64 signals: |
60 void ImageReceived(const QImage newImage); |
65 void ImageReceived(const QImage newImage); |
61 void isReadyNow(); |
|
62 |
66 |
63 private: |
67 private: |
64 void RealStart(); |
|
65 |
|
66 bool m_isStarted; |
|
67 std::string m_seed; |
68 std::string m_seed; |
68 QTcpServer * IPCServer; |
|
69 QTcpSocket * IPCSocket; |
|
70 |
|
71 QByteArray readbuffer; |
|
72 |
|
73 void Start(); |
|
74 |
|
75 void SendToClientFirst(); |
|
76 |
69 |
77 private slots: |
70 private slots: |
78 void NewConnection(); |
|
79 void ClientDisconnect(); |
|
80 void ClientRead(); |
|
81 void StartProcessError(QProcess::ProcessError error); |
|
82 |
|
83 void tcpServerReady(); |
|
84 }; |
71 }; |
85 |
72 |
86 #endif // _HWMAP_INCLUDED |
73 #endif // _HWMAP_INCLUDED |