author | unC0Rr |
Thu, 10 Sep 2020 09:30:41 +0200 | |
changeset 15739 | 94f4d0a96143 |
parent 15258 | 1ce9b717bb41 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
486 | 3 |
* Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com> |
11046 | 4 |
* Copyright (c) 2004-2015 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 |
|
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
9998
diff
changeset
|
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
184 | 18 |
*/ |
19 |
||
20 |
#include <QList> |
|
21 |
#include <QImage> |
|
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
22 |
#include <QThread> |
10175
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
23 |
#include <QApplication> |
14599
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
24 |
#include <QProcessEnvironment> |
184 | 25 |
|
10175
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
26 |
#include "tcpBase.h" |
184 | 27 |
#include "hwconsts.h" |
8799
44e520374cfc
drop QApplication in favor of HWApplication and minor refactor of MessageDialog
koda
parents:
8635
diff
changeset
|
28 |
#include "MessageDialog.h" |
14599
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
29 |
#include "gameuiconfig.h" |
184 | 30 |
|
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
31 |
#ifdef HWLIBRARY |
10175
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
32 |
extern "C" { |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
33 |
void RunEngine(int argc, char ** argv); |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
34 |
|
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
35 |
int operatingsystem_parameter_argc; |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
36 |
char ** operatingsystem_parameter_argv; |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
37 |
} |
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
38 |
|
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
39 |
|
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
40 |
EngineInstance::EngineInstance(QObject *parent) |
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
41 |
: QObject(parent) |
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
42 |
{ |
10175
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
43 |
|
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
44 |
} |
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
45 |
|
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
46 |
EngineInstance::~EngineInstance() |
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
47 |
{ |
10177 | 48 |
qDebug() << "EngineInstance delete" << QThread::currentThreadId(); |
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
49 |
} |
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
50 |
|
10175
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
51 |
void EngineInstance::setArguments(const QStringList & arguments) |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
52 |
{ |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
53 |
m_arguments.clear(); |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
54 |
m_arguments << qApp->arguments().at(0).toUtf8(); |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
55 |
|
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
56 |
m_argv.resize(arguments.size() + 1); |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
57 |
m_argv[0] = m_arguments.last().data(); |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
58 |
|
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
59 |
int i = 1; |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
60 |
foreach(const QString & s, arguments) |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
61 |
{ |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
62 |
m_arguments << s.toUtf8(); |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
63 |
m_argv[i] = m_arguments.last().data(); |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
64 |
++i; |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
65 |
} |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
66 |
} |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
67 |
|
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
68 |
void EngineInstance::start() |
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
69 |
{ |
10177 | 70 |
qDebug() << "EngineInstance start" << QThread::currentThreadId(); |
71 |
||
10175
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
72 |
RunEngine(m_argv.size(), m_argv.data()); |
10177 | 73 |
|
74 |
emit finished(); |
|
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
75 |
} |
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
76 |
|
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
77 |
#endif |
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
78 |
|
184 | 79 |
QList<TCPBase*> srvsList; |
389 | 80 |
QPointer<QTcpServer> TCPBase::IPCServer(0); |
184 | 81 |
|
419
fdeed9718e6b
virtual destructors for tcpBase derived classes, readarray clear removed as unneeded
displacer
parents:
390
diff
changeset
|
82 |
TCPBase::~TCPBase() |
fdeed9718e6b
virtual destructors for tcpBase derived classes, readarray clear removed as unneeded
displacer
parents:
390
diff
changeset
|
83 |
{ |
10177 | 84 |
if(m_hasStarted) |
85 |
{ |
|
86 |
if(IPCSocket) |
|
87 |
IPCSocket->close(); |
|
88 |
||
89 |
if(m_connected) |
|
90 |
{ |
|
91 |
#ifdef HWLIBRARY |
|
92 |
if(!thread) |
|
93 |
qDebug("WTF"); |
|
94 |
thread->quit(); |
|
95 |
thread->wait(); |
|
96 |
#else |
|
97 |
process->waitForFinished(1000); |
|
98 |
#endif |
|
99 |
} |
|
100 |
} |
|
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
101 |
// make sure this object is not in the server list anymore |
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
102 |
srvsList.removeOne(this); |
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
103 |
|
7289
835bb2852579
Restore almost old TCPBase behaviour
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
104 |
if (IPCSocket) |
835bb2852579
Restore almost old TCPBase behaviour
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
105 |
IPCSocket->deleteLater(); |
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
106 |
|
419
fdeed9718e6b
virtual destructors for tcpBase derived classes, readarray clear removed as unneeded
displacer
parents:
390
diff
changeset
|
107 |
} |
fdeed9718e6b
virtual destructors for tcpBase derived classes, readarray clear removed as unneeded
displacer
parents:
390
diff
changeset
|
108 |
|
14599
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
109 |
TCPBase::TCPBase(bool demoMode, bool usesCustomLanguage, QObject *parent) : |
8070
66bc20d089fc
Okay, remove previous request only if it has same parent
unc0rr
parents:
8069
diff
changeset
|
110 |
QObject(parent), |
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
111 |
m_hasStarted(false), |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
112 |
m_isDemoMode(demoMode), |
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
113 |
m_connected(false), |
14599
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
114 |
m_usesCustomLanguage(usesCustomLanguage), |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
115 |
IPCSocket(0) |
184 | 116 |
{ |
10248 | 117 |
process = 0; |
118 |
||
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
119 |
if(!IPCServer) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
120 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
121 |
IPCServer = new QTcpServer(0); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
122 |
IPCServer->setMaxPendingConnections(1); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
123 |
if (!IPCServer->listen(QHostAddress::LocalHost)) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
124 |
{ |
8799
44e520374cfc
drop QApplication in favor of HWApplication and minor refactor of MessageDialog
koda
parents:
8635
diff
changeset
|
125 |
MessageDialog::ShowFatalMessage(tr("Unable to start server at %1.").arg(IPCServer->errorString())); |
7794
ab7b94c03bc9
QMessageBox overhaul: unify buttons, style and appearance of info dialogs, fixing a few typos and return values along the way
koda
parents:
7673
diff
changeset
|
126 |
exit(0); // FIXME - should be graceful exit here (lower Critical -> Warning above when implemented) |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
127 |
} |
185 | 128 |
} |
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
129 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
130 |
ipc_port=IPCServer->serverPort(); |
184 | 131 |
} |
132 |
||
133 |
void TCPBase::NewConnection() |
|
134 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
135 |
if(IPCSocket) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
136 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
137 |
// connection should be already finished |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
138 |
return; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
139 |
} |
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
140 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
141 |
disconnect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection())); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
142 |
IPCSocket = IPCServer->nextPendingConnection(); |
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
143 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
144 |
if(!IPCSocket) return; |
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
145 |
|
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
146 |
m_connected = true; |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
147 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
148 |
connect(IPCSocket, SIGNAL(disconnected()), this, SLOT(ClientDisconnect())); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
149 |
connect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead())); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
150 |
SendToClientFirst(); |
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
151 |
|
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
152 |
if(simultaneousRun()) |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
153 |
{ |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
154 |
srvsList.removeOne(this); |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
155 |
emit isReadyNow(); |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
156 |
} |
184 | 157 |
} |
158 |
||
159 |
void TCPBase::RealStart() |
|
160 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
161 |
connect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection())); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
162 |
IPCSocket = 0; |
389 | 163 |
|
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
164 |
#ifdef HWLIBRARY |
10177 | 165 |
thread = new QThread(this); |
10175
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
166 |
EngineInstance *instance = new EngineInstance(); |
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
167 |
instance->setArguments(getArguments()); |
8310
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
168 |
|
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
169 |
instance->moveToThread(thread); |
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
170 |
|
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
171 |
connect(thread, SIGNAL(started()), instance, SLOT(start(void))); |
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
172 |
connect(instance, SIGNAL(finished()), thread, SLOT(quit())); |
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
173 |
connect(instance, SIGNAL(finished()), instance, SLOT(deleteLater())); |
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
174 |
connect(instance, SIGNAL(finished()), thread, SLOT(deleteLater())); |
a98c349bc06b
minor adjustments to libengine, moc is correctly created as definitions are set before calling it, params are better numbered and we don't subclass qthread but rather use moveToThread()
koda
parents:
8082
diff
changeset
|
175 |
thread->start(); |
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
176 |
#else |
10177 | 177 |
process = new QProcess(this); |
10307
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
178 |
connect(process, SIGNAL(error(QProcess::ProcessError)), |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
179 |
this, SLOT(StartProcessError(QProcess::ProcessError))); |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
180 |
connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
181 |
this, SLOT(onEngineDeath(int, QProcess::ExitStatus))); |
10175
c92668840ea8
Remove game/preview functions split in library mode, just let normal procedure run instead:
unc0rr
parents:
10108
diff
changeset
|
182 |
QStringList arguments = getArguments(); |
3697 | 183 |
|
9212 | 184 |
#ifdef QT_DEBUG |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
185 |
// redirect everything written on stdout/stderr |
8635 | 186 |
process->setProcessChannelMode(QProcess::ForwardedChannels); |
187 |
#endif |
|
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
188 |
|
14599
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
189 |
// If game config uses non-system locale, we set the environment |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
190 |
// of the engine first |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
191 |
if(m_usesCustomLanguage) |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
192 |
{ |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
193 |
QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
194 |
QString hwengineLang = QLocale().name() + ".UTF8"; |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
195 |
qDebug("Setting hwengine environment: LANG=%s", qPrintable(hwengineLang)); |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
196 |
// TODO: Check if this is correct and works on all systems |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
197 |
env.insert("LANG", QLocale().name() + ".UTF8"); |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
198 |
process->setProcessEnvironment(env); |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
199 |
} |
b86e6e4f3c58
Make game engine load the user's locale correctly (bug 688)
Wuzzy <Wuzzy2@mail.ru>
parents:
13512
diff
changeset
|
200 |
qDebug("Starting hwengine ..."); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
201 |
process->start(bindir->absolutePath() + "/hwengine", arguments); |
8082
675372256a01
lotsa hackery to get frontend somehow link libengine...
koda
parents:
8070
diff
changeset
|
202 |
#endif |
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
203 |
m_hasStarted = true; |
184 | 204 |
} |
205 |
||
206 |
void TCPBase::ClientDisconnect() |
|
207 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
208 |
onClientDisconnect(); |
184 | 209 |
|
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
210 |
if(!simultaneousRun()) |
10177 | 211 |
{ |
212 |
#ifdef HWLIBRARY |
|
213 |
thread->quit(); |
|
214 |
thread->wait(); |
|
215 |
#endif |
|
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
216 |
emit isReadyNow(); |
10177 | 217 |
} |
10307
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
218 |
|
12824 | 219 |
if(IPCSocket) { |
220 |
disconnect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead())); |
|
221 |
IPCSocket->deleteLater(); |
|
222 |
IPCSocket = NULL; |
|
223 |
} |
|
7673
e06b83cbde74
fix a segfault related to tcp servers deleting themselves without removing themselves from the internal server list first.
sheepluva
parents:
7615
diff
changeset
|
224 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
225 |
deleteLater(); |
184 | 226 |
} |
227 |
||
228 |
void TCPBase::ClientRead() |
|
229 |
{ |
|
10177 | 230 |
QByteArray read = IPCSocket->readAll(); |
231 |
if(read.isEmpty()) return; |
|
232 |
readbuffer.append(read); |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
233 |
onClientRead(); |
184 | 234 |
} |
235 |
||
236 |
void TCPBase::StartProcessError(QProcess::ProcessError error) |
|
237 |
{ |
|
8799
44e520374cfc
drop QApplication in favor of HWApplication and minor refactor of MessageDialog
koda
parents:
8635
diff
changeset
|
238 |
MessageDialog::ShowFatalMessage(tr("Unable to run engine at %1\nError code: %2").arg(bindir->absolutePath() + "/hwengine").arg(error)); |
7587
688076d61b83
Don't leave frontend in engine waiting state when there's error occured on attempt to start engine
unc0rr
parents:
6952
diff
changeset
|
239 |
ClientDisconnect(); |
184 | 240 |
} |
241 |
||
10307
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
242 |
void TCPBase::onEngineDeath(int exitCode, QProcess::ExitStatus exitStatus) |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
243 |
{ |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
244 |
Q_UNUSED(exitStatus); |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
245 |
|
13208
fcffacc6ee8f
Fix broken previews for me, pepper with comments on logic. Probably makes it fail for windows users again.
unc0rr
parents:
12874
diff
changeset
|
246 |
if(!m_connected) { // yes, it is intended to be like this |
fcffacc6ee8f
Fix broken previews for me, pepper with comments on logic. Probably makes it fail for windows users again.
unc0rr
parents:
12874
diff
changeset
|
247 |
ClientDisconnect(); // need to do cleanup in case no connection occured, |
fcffacc6ee8f
Fix broken previews for me, pepper with comments on logic. Probably makes it fail for windows users again.
unc0rr
parents:
12874
diff
changeset
|
248 |
//if m_connected is true, it is done automatically in socket disconnect handler |
fcffacc6ee8f
Fix broken previews for me, pepper with comments on logic. Probably makes it fail for windows users again.
unc0rr
parents:
12874
diff
changeset
|
249 |
} |
10307
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
250 |
|
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
251 |
// show error message if there was an error that was not an engine's |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
252 |
// fatal error - because that one already sent a info via IPC |
13500
d9f9e66543d7
Fix frontend showing 2 errors on engine fatal error (exit code 52)
Wuzzy <Wuzzy2@mail.ru>
parents:
13208
diff
changeset
|
253 |
if ((exitCode != HWENGINE_EXITCODE_OK) && (exitCode != HWENGINE_EXITCODE_FATAL)) |
10307
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
254 |
{ |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
255 |
// inform user that something bad happened |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
256 |
MessageDialog::ShowFatalMessage( |
10310 | 257 |
tr("The game engine died unexpectedly!\n" |
258 |
"(exit code %1)\n\n" |
|
259 |
"We are very sorry for the inconvenience :(\n\n" |
|
260 |
"If this keeps happening, please click the '%2' button in the main menu!") |
|
261 |
.arg(exitCode) |
|
15258
1ce9b717bb41
Fix word "Feedback" not being translated in error message
Wuzzy <Wuzzy2@mail.ru>
parents:
14599
diff
changeset
|
262 |
.arg(QCoreApplication::translate("PageMain", "Feedback"))); |
10307
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
263 |
|
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
264 |
} |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
265 |
} |
e13d3147f15b
do not get stuck on "in game..." page just because of game crash. output a message instead. could still need some tweaking, but a man gotta sleep. and sheep too...
sheepluva
parents:
10248
diff
changeset
|
266 |
|
184 | 267 |
void TCPBase::tcpServerReady() |
268 |
{ |
|
13512
4c5c8a83e298
Fix crash when aborting encoding phase of video recording in videos page if >1 video is being encoded
Wuzzy <Wuzzy2@mail.ru>
parents:
13500
diff
changeset
|
269 |
if (!srvsList.isEmpty()) |
4c5c8a83e298
Fix crash when aborting encoding phase of video recording in videos page if >1 video is being encoded
Wuzzy <Wuzzy2@mail.ru>
parents:
13500
diff
changeset
|
270 |
{ |
4c5c8a83e298
Fix crash when aborting encoding phase of video recording in videos page if >1 video is being encoded
Wuzzy <Wuzzy2@mail.ru>
parents:
13500
diff
changeset
|
271 |
disconnect(srvsList.first(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady())); |
4c5c8a83e298
Fix crash when aborting encoding phase of video recording in videos page if >1 video is being encoded
Wuzzy <Wuzzy2@mail.ru>
parents:
13500
diff
changeset
|
272 |
RealStart(); |
4c5c8a83e298
Fix crash when aborting encoding phase of video recording in videos page if >1 video is being encoded
Wuzzy <Wuzzy2@mail.ru>
parents:
13500
diff
changeset
|
273 |
} |
4c5c8a83e298
Fix crash when aborting encoding phase of video recording in videos page if >1 video is being encoded
Wuzzy <Wuzzy2@mail.ru>
parents:
13500
diff
changeset
|
274 |
else |
4c5c8a83e298
Fix crash when aborting encoding phase of video recording in videos page if >1 video is being encoded
Wuzzy <Wuzzy2@mail.ru>
parents:
13500
diff
changeset
|
275 |
{ |
4c5c8a83e298
Fix crash when aborting encoding phase of video recording in videos page if >1 video is being encoded
Wuzzy <Wuzzy2@mail.ru>
parents:
13500
diff
changeset
|
276 |
qDebug("tcpServerReady() called while srvsList was empty. Not starting TCP server"); |
4c5c8a83e298
Fix crash when aborting encoding phase of video recording in videos page if >1 video is being encoded
Wuzzy <Wuzzy2@mail.ru>
parents:
13500
diff
changeset
|
277 |
} |
184 | 278 |
} |
279 |
||
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
280 |
void TCPBase::Start(bool couldCancelPreviousRequest) |
184 | 281 |
{ |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
282 |
if(srvsList.isEmpty()) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
283 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
284 |
srvsList.push_back(this); |
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
285 |
RealStart(); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
286 |
} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
287 |
else |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
288 |
{ |
8070
66bc20d089fc
Okay, remove previous request only if it has same parent
unc0rr
parents:
8069
diff
changeset
|
289 |
TCPBase * last = srvsList.last(); |
66bc20d089fc
Okay, remove previous request only if it has same parent
unc0rr
parents:
8069
diff
changeset
|
290 |
if(couldCancelPreviousRequest |
66bc20d089fc
Okay, remove previous request only if it has same parent
unc0rr
parents:
8069
diff
changeset
|
291 |
&& last->couldBeRemoved() |
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
292 |
&& (last->isConnected() || !last->hasStarted()) |
8070
66bc20d089fc
Okay, remove previous request only if it has same parent
unc0rr
parents:
8069
diff
changeset
|
293 |
&& (last->parent() == parent())) |
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
294 |
{ |
8070
66bc20d089fc
Okay, remove previous request only if it has same parent
unc0rr
parents:
8069
diff
changeset
|
295 |
srvsList.removeLast(); |
10177 | 296 |
delete last; |
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
297 |
Start(couldCancelPreviousRequest); |
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
298 |
} else |
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
299 |
{ |
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
300 |
connect(last, SIGNAL(isReadyNow()), this, SLOT(tcpServerReady())); |
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
301 |
srvsList.push_back(this); |
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
302 |
} |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
303 |
} |
184 | 304 |
} |
305 |
||
306 |
void TCPBase::onClientRead() |
|
307 |
{ |
|
308 |
} |
|
309 |
||
310 |
void TCPBase::onClientDisconnect() |
|
311 |
{ |
|
312 |
} |
|
313 |
||
314 |
void TCPBase::SendToClientFirst() |
|
315 |
{ |
|
316 |
} |
|
317 |
||
318 |
void TCPBase::SendIPC(const QByteArray & buf) |
|
319 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
320 |
if (buf.size() > MAXMSGCHARS) return; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
321 |
quint8 len = buf.size(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
322 |
RawSendIPC(QByteArray::fromRawData((char *)&len, 1) + buf); |
184 | 323 |
} |
324 |
||
325 |
void TCPBase::RawSendIPC(const QByteArray & buf) |
|
326 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
327 |
if (!IPCSocket) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
328 |
{ |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
329 |
toSendBuf += buf; |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
330 |
} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
331 |
else |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
332 |
{ |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
333 |
if (toSendBuf.size() > 0) |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
334 |
{ |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
335 |
IPCSocket->write(toSendBuf); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
336 |
if(m_isDemoMode) demo.append(toSendBuf); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
337 |
toSendBuf.clear(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
338 |
} |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
339 |
if(!buf.isEmpty()) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
340 |
{ |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
341 |
IPCSocket->write(buf); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
342 |
if(m_isDemoMode) demo.append(buf); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
343 |
} |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
1066
diff
changeset
|
344 |
} |
184 | 345 |
} |
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
346 |
|
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
347 |
bool TCPBase::couldBeRemoved() |
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
348 |
{ |
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
349 |
return false; |
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
7794
diff
changeset
|
350 |
} |
9800
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
351 |
|
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
352 |
bool TCPBase::isConnected() |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
353 |
{ |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
354 |
return m_connected; |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
355 |
} |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
356 |
|
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
357 |
bool TCPBase::simultaneousRun() |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
358 |
{ |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
359 |
return false; |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
360 |
} |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
361 |
|
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
362 |
bool TCPBase::hasStarted() |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
363 |
{ |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
364 |
return m_hasStarted; |
169fbb968bb3
No idea what this is doing, seems to allow recorder instance to not block further engine starts while it is doing its job.
unc0rr
parents:
9212
diff
changeset
|
365 |
} |