author | unc0rr |
Sun, 11 Feb 2007 19:57:29 +0000 | |
changeset 435 | 25820c10c849 |
parent 431 | 79ac59673df3 |
child 443 | eec37eb7f5db |
permissions | -rw-r--r-- |
315 | 1 |
/* |
2 |
* Hedgewars, a worms-like game |
|
3 |
* Copyright (c) 2006 Ulyanov Igor <iulyanov@gmail.com> |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*/ |
|
18 |
||
19 |
#include <QMessageBox> |
|
20 |
#include <QDebug> |
|
21 |
||
22 |
#include "newnetclient.h" |
|
23 |
#include "proto.h" |
|
24 |
#include "gameuiconfig.h" |
|
25 |
#include "game.h" |
|
334 | 26 |
#include "gamecfgwidget.h" |
347 | 27 |
#include "teamselect.h" |
315 | 28 |
|
29 |
char delimeter='\t'; |
|
30 |
||
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
31 |
HWNewNet::HWNewNet(GameUIConfig * config, GameCFGWidget* pGameCFGWidget, TeamSelWidget* pTeamSelWidget) : |
334 | 32 |
config(config), |
33 |
m_pGameCFGWidget(pGameCFGWidget), |
|
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
34 |
m_pTeamSelWidget(pTeamSelWidget), |
383 | 35 |
isChief(false), |
36 |
m_game_connected(false) |
|
315 | 37 |
{ |
38 |
connect(&NetSocket, SIGNAL(readyRead()), this, SLOT(ClientRead())); |
|
39 |
connect(&NetSocket, SIGNAL(connected()), this, SLOT(OnConnect())); |
|
40 |
connect(&NetSocket, SIGNAL(disconnected()), this, SLOT(OnDisconnect())); |
|
41 |
connect(&NetSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, |
|
42 |
SLOT(displayError(QAbstractSocket::SocketError))); |
|
43 |
} |
|
44 |
||
45 |
void HWNewNet::Connect(const QString & hostName, quint16 port, const QString & nick) |
|
46 |
{ |
|
47 |
qDebug() << hostName << ":" << port; |
|
48 |
NetSocket.connectToHost(hostName, port); |
|
49 |
mynick = nick; |
|
50 |
} |
|
51 |
||
52 |
void HWNewNet::Disconnect() |
|
53 |
{ |
|
407 | 54 |
m_game_connected=false; |
383 | 55 |
NetSocket.disconnectFromHost(); |
315 | 56 |
} |
57 |
||
58 |
void HWNewNet::JoinGame(const QString & game) |
|
59 |
{ |
|
60 |
RawSendNet(QString("JOIN %1").arg(game)); |
|
61 |
} |
|
62 |
||
63 |
void HWNewNet::AddTeam(const HWTeam & team) |
|
64 |
{ |
|
65 |
RawSendNet(QString("ADDTEAM:") + delimeter + |
|
382
e7220e48ead1
colors changing config fully working (still need disabling in slaves)
displacer
parents:
373
diff
changeset
|
66 |
team.TeamName + delimeter + |
e7220e48ead1
colors changing config fully working (still need disabling in slaves)
displacer
parents:
373
diff
changeset
|
67 |
team.teamColor.name() + delimeter + |
e7220e48ead1
colors changing config fully working (still need disabling in slaves)
displacer
parents:
373
diff
changeset
|
68 |
team.HHName[0] + delimeter + team.HHName[1] + delimeter + |
315 | 69 |
team.HHName[2] + delimeter + team.HHName[3] + delimeter + team.HHName[4] + delimeter + |
70 |
team.HHName[5] + delimeter + team.HHName[6] + delimeter + team.HHName[7]); |
|
71 |
} |
|
72 |
||
347 | 73 |
void HWNewNet::RemoveTeam(const HWTeam & team) |
74 |
{ |
|
75 |
RawSendNet(QString("REMOVETEAM:") + delimeter + team.TeamName); |
|
401 | 76 |
m_networkToLocalteams.remove(m_networkToLocalteams.key(team.TeamName)); |
347 | 77 |
} |
78 |
||
315 | 79 |
void HWNewNet::StartGame() |
80 |
{ |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
81 |
RawSendNet(QString("START:")); |
315 | 82 |
} |
83 |
||
84 |
void HWNewNet::SendNet(const QByteArray & buf) |
|
85 |
{ |
|
86 |
QString msg = QString(buf.toBase64()); |
|
87 |
||
88 |
//NetBuffer += buf; |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
89 |
RawSendNet(QString("GAMEMSG:%1%2").arg(delimeter).arg(msg)); |
315 | 90 |
} |
91 |
||
92 |
void HWNewNet::RawSendNet(const QString & str) |
|
93 |
{ |
|
94 |
RawSendNet(str.toUtf8()); |
|
95 |
} |
|
96 |
||
97 |
void HWNewNet::RawSendNet(const QByteArray & buf) |
|
98 |
{ |
|
99 |
NetSocket.write(buf); |
|
100 |
NetSocket.write("\n", 1); |
|
101 |
} |
|
102 |
||
103 |
void HWNewNet::ClientRead() |
|
104 |
{ |
|
105 |
while (NetSocket.canReadLine()) { |
|
106 |
ParseLine(NetSocket.readLine().trimmed()); |
|
107 |
} |
|
108 |
} |
|
109 |
||
110 |
void HWNewNet::OnConnect() |
|
111 |
{ |
|
112 |
RawSendNet(QString("USER") + delimeter + "hwgame 1 2 Hedgewars game"); |
|
113 |
RawSendNet(QString("NICK%1%2").arg(delimeter).arg(mynick)); |
|
114 |
} |
|
115 |
||
116 |
void HWNewNet::OnDisconnect() |
|
117 |
{ |
|
338
d1e75dcd285f
multiple teams now available per host (still alpha)
displacer
parents:
335
diff
changeset
|
118 |
//emit ChangeInTeams(QStringList()); |
383 | 119 |
if(m_game_connected) emit Disconnected(); |
120 |
m_game_connected=false; |
|
315 | 121 |
} |
122 |
||
123 |
void HWNewNet::displayError(QAbstractSocket::SocketError socketError) |
|
124 |
{ |
|
125 |
switch (socketError) { |
|
126 |
case QAbstractSocket::RemoteHostClosedError: |
|
127 |
break; |
|
128 |
case QAbstractSocket::HostNotFoundError: |
|
129 |
QMessageBox::information(0, tr("Error"), |
|
130 |
tr("The host was not found. Please check the host name and port settings.")); |
|
131 |
break; |
|
132 |
case QAbstractSocket::ConnectionRefusedError: |
|
133 |
QMessageBox::information(0, tr("Error"), |
|
134 |
tr("Connection refused")); |
|
135 |
break; |
|
136 |
default: |
|
137 |
QMessageBox::information(0, tr("Error"), |
|
138 |
NetSocket.errorString()); |
|
139 |
} |
|
140 |
} |
|
141 |
||
142 |
void HWNewNet::ParseLine(const QByteArray & line) |
|
143 |
{ |
|
144 |
QString msg = QString::fromUtf8 (line.data(), line.size()); |
|
320 | 145 |
|
315 | 146 |
QStringList lst = msg.split(delimeter); |
147 |
if (lst[0] == "ERRONEUSNICKNAME") { |
|
148 |
QMessageBox::information(0, 0, "Your net nickname is in use or cannot be used"); |
|
149 |
return; |
|
150 |
} |
|
151 |
||
152 |
if (lst[0] == "CONNECTED") { |
|
383 | 153 |
m_game_connected=true; |
315 | 154 |
emit Connected(); |
155 |
emit EnteredGame(); |
|
156 |
return; |
|
157 |
} |
|
158 |
||
338
d1e75dcd285f
multiple teams now available per host (still alpha)
displacer
parents:
335
diff
changeset
|
159 |
if (lst[0] == "ADDTEAM:") { |
315 | 160 |
lst.pop_front(); |
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
161 |
emit AddNetTeam(lst); |
315 | 162 |
return; |
163 |
} |
|
164 |
||
347 | 165 |
if (lst[0] == "REMOVETEAM:") { |
352 | 166 |
if(lst.size()<3) return; |
167 |
m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1], lst[2].toUInt())); |
|
347 | 168 |
return; |
169 |
} |
|
170 |
||
349 | 171 |
if(lst[0]=="SLAVE") { |
172 |
m_pGameCFGWidget->setEnabled(false); |
|
362
b28e0dd48269
hedgehogs num modification now allowed to chief client only
displacer
parents:
356
diff
changeset
|
173 |
m_pTeamSelWidget->setNonInteractive(); |
354
60e4af0a4375
network to local teams map, addteams from server before team config bug, fixed some segfaults
displacer
parents:
352
diff
changeset
|
174 |
return; |
349 | 175 |
} |
176 |
||
315 | 177 |
if (lst[0] == "CONFIGASKED") { |
334 | 178 |
isChief=true; |
315 | 179 |
ConfigAsked(); |
180 |
return; |
|
181 |
} |
|
320 | 182 |
|
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
183 |
if (lst[0] == "RUNGAME") { |
396 | 184 |
RunGame(); |
185 |
return; |
|
339
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
186 |
} |
7535ab6c3820
Run game message added, team and config info provided for net game
displacer
parents:
338
diff
changeset
|
187 |
|
315 | 188 |
if (lst[0] == "CONFIGURED") { |
189 |
lst.pop_front(); |
|
334 | 190 |
if(lst.size()<5) return; |
191 |
qDebug() << lst; |
|
192 |
emit seedChanged(lst[0]); |
|
193 |
emit mapChanged(lst[1]); |
|
194 |
emit themeChanged(lst[2]); |
|
195 |
emit initHealthChanged(lst[3].toUInt()); |
|
196 |
emit turnTimeChanged(lst[4].toUInt()); |
|
197 |
//emit fortsModeChanged(lst[5].toInt() != 0); // FIXME: add a getFortsMode in ConfigAsked |
|
315 | 198 |
return; |
199 |
} |
|
200 |
||
354
60e4af0a4375
network to local teams map, addteams from server before team config bug, fixed some segfaults
displacer
parents:
352
diff
changeset
|
201 |
if(lst[0]=="TEAM_ACCEPTED") { |
401 | 202 |
qDebug() << "accepted " << lst[2].toUInt() << " team"; |
354
60e4af0a4375
network to local teams map, addteams from server before team config bug, fixed some segfaults
displacer
parents:
352
diff
changeset
|
203 |
m_networkToLocalteams.insert(lst[2].toUInt(), lst[1]); |
373 | 204 |
m_pTeamSelWidget->changeTeamStatus(lst[1]); |
354
60e4af0a4375
network to local teams map, addteams from server before team config bug, fixed some segfaults
displacer
parents:
352
diff
changeset
|
205 |
return; |
60e4af0a4375
network to local teams map, addteams from server before team config bug, fixed some segfaults
displacer
parents:
352
diff
changeset
|
206 |
} |
60e4af0a4375
network to local teams map, addteams from server before team config bug, fixed some segfaults
displacer
parents:
352
diff
changeset
|
207 |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
208 |
if (lst[0] == "CONFIG_PARAM") { |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
209 |
if (lst[1] == "SEED") { |
332 | 210 |
emit seedChanged(lst[2]); |
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
211 |
return; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
212 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
213 |
if (lst[1] == "MAP") { |
332 | 214 |
emit mapChanged(lst[2]); |
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
215 |
return; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
216 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
217 |
if (lst[1] == "THEME") { |
332 | 218 |
emit themeChanged(lst[2]); |
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
219 |
return; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
220 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
221 |
if (lst[1] == "HEALTH") { |
332 | 222 |
emit initHealthChanged(lst[2].toUInt()); |
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
223 |
return; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
224 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
225 |
if (lst[1] == "TURNTIME") { |
332 | 226 |
emit turnTimeChanged(lst[2].toUInt()); |
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
227 |
return; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
228 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
229 |
if (lst[1] == "FORTSMODE") { |
332 | 230 |
emit fortsModeChanged(lst[2].toInt() != 0); |
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
231 |
return; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
232 |
} |
401 | 233 |
QStringList hhTmpList=lst[1].split('+'); |
234 |
if (hhTmpList[0] == "TEAM_COLOR") { |
|
235 |
HWTeam tmptm(hhTmpList[1], hhTmpList[2].toUInt()); |
|
236 |
if(m_networkToLocalteams.find(hhTmpList[2].toUInt())!=m_networkToLocalteams.end()) { |
|
237 |
tmptm=HWTeam(hhTmpList[1]); // local team should be changed |
|
372 | 238 |
} |
401 | 239 |
tmptm.teamColor=QColor(lst[2]); |
372 | 240 |
emit teamColorChanged(tmptm); |
241 |
return; |
|
242 |
} |
|
401 | 243 |
if (hhTmpList[0] == "HHNUM") { |
399 | 244 |
qDebug() << "NEW HHNUM!"; |
245 |
HWTeam tmptm(hhTmpList[1], hhTmpList[2].toUInt()); |
|
246 |
if(m_networkToLocalteams.find(hhTmpList[2].toUInt())!=m_networkToLocalteams.end()) { |
|
247 |
tmptm=HWTeam(hhTmpList[1]); // local team should be changed |
|
248 |
} |
|
249 |
tmptm.numHedgehogs=lst[2].toUInt(); |
|
250 |
emit hhnumChanged(tmptm); |
|
251 |
return; |
|
252 |
} |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
253 |
qDebug() << "unknow config param: " << lst[1]; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
254 |
return; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
255 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
256 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
257 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
258 |
// should be kinda game states, which don't allow "GAMEMSG:" at configure step, |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
259 |
// "CONNECTED" at round phase, etc. |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
260 |
if (lst[0] == "GAMEMSG:") { |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
261 |
QByteArray em = QByteArray::fromBase64(lst[1].toAscii()); |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
262 |
emit FromNet(em); |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
263 |
return; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
264 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
265 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
266 |
qDebug() << "unknown net command: " << msg; |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
267 |
|
315 | 268 |
} |
269 |
||
270 |
||
271 |
void HWNewNet::ConfigAsked() |
|
272 |
{ |
|
335 | 273 |
onSeedChanged(m_pGameCFGWidget->getCurrentSeed()); |
274 |
onMapChanged(m_pGameCFGWidget->getCurrentMap()); |
|
275 |
onThemeChanged(m_pGameCFGWidget->getCurrentTheme()); |
|
276 |
onInitHealthChanged(m_pGameCFGWidget->getInitHealth()); |
|
277 |
onTurnTimeChanged(m_pGameCFGWidget->getTurnTime()); |
|
315 | 278 |
} |
279 |
||
280 |
void HWNewNet::RunGame() |
|
281 |
{ |
|
395 | 282 |
HWGame* game = new HWGame(config, m_pGameCFGWidget, m_pTeamSelWidget); // FIXME: memory leak here (stackify it?) |
315 | 283 |
connect(game, SIGNAL(SendNet(const QByteArray &)), this, SLOT(SendNet(const QByteArray &))); |
284 |
connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &))); |
|
285 |
connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &))); |
|
431 | 286 |
connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection); |
315 | 287 |
game->StartNet(); |
288 |
} |
|
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
289 |
|
431 | 290 |
void HWNewNet::ShowErrorMessage(const QString & msg) |
291 |
{ |
|
292 |
QMessageBox::warning(0, |
|
293 |
"Hedgewars", |
|
294 |
msg); |
|
295 |
} |
|
296 |
||
352 | 297 |
void HWNewNet::onHedgehogsNumChanged(const HWTeam& team) |
298 |
{ |
|
299 |
qDebug() << team.getNetID() << ":" << team.numHedgehogs; |
|
399 | 300 |
RawSendNet(QString("CONFIG_PARAM%1HHNUM+%2+%3%1%4").arg(delimeter).arg(team.TeamName)\ |
354
60e4af0a4375
network to local teams map, addteams from server before team config bug, fixed some segfaults
displacer
parents:
352
diff
changeset
|
301 |
.arg(team.getNetID() ? team.getNetID() : m_networkToLocalteams.key(team.TeamName))\ |
60e4af0a4375
network to local teams map, addteams from server before team config bug, fixed some segfaults
displacer
parents:
352
diff
changeset
|
302 |
.arg(team.numHedgehogs)); |
352 | 303 |
} |
304 |
||
372 | 305 |
void HWNewNet::onTeamColorChanged(const HWTeam& team) |
306 |
{ |
|
307 |
qDebug() << team.getNetID() << ":" << team.teamColor.name(); |
|
401 | 308 |
RawSendNet(QString("CONFIG_PARAM%1TEAM_COLOR+%2+%3%1%4").arg(delimeter).arg(team.TeamName)\ |
372 | 309 |
.arg(team.getNetID() ? team.getNetID() : m_networkToLocalteams.key(team.TeamName))\ |
310 |
.arg(team.teamColor.name())); |
|
311 |
} |
|
312 |
||
329
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
313 |
void HWNewNet::onSeedChanged(const QString & seed) |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
314 |
{ |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
315 |
RawSendNet(QString("CONFIG_PARAM%1SEED%1%2").arg(delimeter).arg(seed)); |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
316 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
317 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
318 |
void HWNewNet::onMapChanged(const QString & map) |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
319 |
{ |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
320 |
RawSendNet(QString("CONFIG_PARAM%1MAP%1%2").arg(delimeter).arg(map)); |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
321 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
322 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
323 |
void HWNewNet::onThemeChanged(const QString & theme) |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
324 |
{ |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
325 |
RawSendNet(QString("CONFIG_PARAM%1THEME%1%2").arg(delimeter).arg(theme)); |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
326 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
327 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
328 |
void HWNewNet::onInitHealthChanged(quint32 health) |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
329 |
{ |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
330 |
RawSendNet(QString("CONFIG_PARAM%1HEALTH%1%2").arg(delimeter).arg(health)); |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
331 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
332 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
333 |
void HWNewNet::onTurnTimeChanged(quint32 time) |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
334 |
{ |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
335 |
RawSendNet(QString("CONFIG_PARAM%1TURNTIME%1%2").arg(delimeter).arg(time)); |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
336 |
} |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
337 |
|
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
338 |
void HWNewNet::onFortsModeChanged(bool value) |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
339 |
{ |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
340 |
RawSendNet(QString("CONFIG_PARAM%1FORTSMODE%1%2").arg(delimeter).arg(value)); |
4c3aad46baa5
Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents:
322
diff
changeset
|
341 |
} |