equal
deleted
inserted
replaced
78 emit disconnected(""); |
78 emit disconnected(""); |
79 } |
79 } |
80 NetSocket.flush(); |
80 NetSocket.flush(); |
81 } |
81 } |
82 |
82 |
83 void HWNewNet::Connect(const QString & hostName, quint16 port, const QString & nick) |
83 void HWNewNet::Connect(const QString & hostName, quint16 port, bool useTls, const QString & nick) |
84 { |
84 { |
85 netClientState = Connecting; |
85 netClientState = Connecting; |
86 mynick = nick; |
86 mynick = nick; |
87 myhost = hostName + QString(":%1").arg(port); |
87 myhost = hostName + QString(":%1").arg(port); |
88 NetSocket.connectToHost(hostName, port); |
88 NetSocket.connectToHost(hostName, port); |
255 m_passwordHash = hash.toLatin1(); |
255 m_passwordHash = hash.toLatin1(); |
256 |
256 |
257 maybeSendPassword(); |
257 maybeSendPassword(); |
258 } |
258 } |
259 |
259 |
|
260 void HWNewNet::ContinueConnection() |
|
261 { |
|
262 if (netClientState == Connected) |
|
263 { |
|
264 RawSendNet(QString("NICK%1%2").arg(delimiter).arg(mynick)); |
|
265 RawSendNet(QString("PROTO%1%2").arg(delimiter).arg(*cProtoVer)); |
|
266 m_game_connected = true; |
|
267 emit adminAccess(false); |
|
268 } |
|
269 } |
|
270 |
260 void HWNewNet::ParseCmd(const QStringList & lst) |
271 void HWNewNet::ParseCmd(const QStringList & lst) |
261 { |
272 { |
262 qDebug() << "Server: " << lst; |
273 qDebug() << "Server: " << lst; |
263 |
274 |
264 if(!lst.size()) |
275 if(!lst.size()) |
309 { |
320 { |
310 qWarning() << "Invalid redirection port"; |
321 qWarning() << "Invalid redirection port"; |
311 } |
322 } |
312 else |
323 else |
313 { |
324 { |
|
325 netClientState = Redirected; |
314 emit redirected(port); |
326 emit redirected(port); |
315 } |
327 } |
316 return; |
328 return; |
317 } |
329 } |
318 |
330 |
326 Disconnect(); |
338 Disconnect(); |
327 emit disconnected(tr("The server is too old. Disconnecting now.")); |
339 emit disconnected(tr("The server is too old. Disconnecting now.")); |
328 return; |
340 return; |
329 } |
341 } |
330 |
342 |
331 RawSendNet(QString("NICK%1%2").arg(delimiter).arg(mynick)); |
343 ClientState lastState = netClientState; |
332 RawSendNet(QString("PROTO%1%2").arg(delimiter).arg(*cProtoVer)); |
344 netClientState = Connected; |
333 netClientState = Connected; |
345 if (lastState != Redirected) |
334 m_game_connected = true; |
346 { |
335 emit adminAccess(false); |
347 ContinueConnection(); |
|
348 } |
336 return; |
349 return; |
337 } |
350 } |
338 |
351 |
339 if (lst[0] == "SERVER_AUTH") |
352 if (lst[0] == "SERVER_AUTH") |
340 { |
353 { |