author | koda |
Tue, 04 Dec 2012 03:25:31 +0100 | |
branch | flibqtfrontend |
changeset 8214 | 8edc37cdcfbf |
parent 8092 | 08960209db8c |
child 8363 | 0b4ac686fc44 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
4976 | 3 |
* Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com> |
6952 | 4 |
* Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
184 | 5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
|
7 |
* it under the terms of the GNU General Public License as published by |
|
8 |
* the Free Software Foundation; version 2 of the License |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
18 |
*/ |
|
19 |
||
20 |
#ifndef _TCPBASE_INCLUDED |
|
21 |
#define _TCPBASE_INCLUDED |
|
22 |
||
23 |
#include <QObject> |
|
24 |
#include <QProcess> |
|
25 |
||
26 |
class TCPBase : public QObject |
|
27 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
28 |
Q_OBJECT |
389 | 29 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
30 |
public: |
8092 | 31 |
TCPBase(QObject * parent = 0); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
32 |
virtual ~TCPBase(); |
184 | 33 |
|
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7289
diff
changeset
|
34 |
virtual bool couldBeRemoved(); |
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7289
diff
changeset
|
35 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
36 |
signals: |
8092 | 37 |
void nextPlease(); |
184 | 38 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
39 |
protected: |
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7289
diff
changeset
|
40 |
bool m_hasStarted; |
8092 | 41 |
int m_port; |
291 | 42 |
|
8092 | 43 |
void start(bool couldCancelPreviousRequest); |
184 | 44 |
|
8092 | 45 |
virtual QStringList getArguments() = 0; |
46 |
virtual void onEngineStart() = 0; |
|
184 | 47 |
|
8092 | 48 |
void clientDisconnected(); |
184 | 49 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
50 |
private: |
7289
835bb2852579
Restore almost old TCPBase behaviour
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
51 |
void RealStart(); |
184 | 52 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
53 |
private slots: |
8092 | 54 |
void iStart(); |
184 | 55 |
}; |
56 |
||
57 |
#endif // _TCPBASE_INCLUDED |