QTfrontend/newnetclient.cpp
changeset 1354 a8dcdeb88a43
parent 1351 aa7aefec5c1b
child 1356 77ab8735401d
equal deleted inserted replaced
1353:c72d37d4eb4e 1354:a8dcdeb88a43
    51   NetSocket.connectToHost(hostName, port);
    51   NetSocket.connectToHost(hostName, port);
    52 }
    52 }
    53 
    53 
    54 void HWNewNet::Disconnect()
    54 void HWNewNet::Disconnect()
    55 {
    55 {
    56   m_game_connected = false;
    56 	if (m_game_connected)
    57   NetSocket.disconnectFromHost();
    57 		RawSendNet(QString("QUIT"));
       
    58 	m_game_connected = false;
       
    59 	NetSocket.disconnectFromHost();
    58 }
    60 }
    59 
    61 
    60 void HWNewNet::CreateRoom(const QString & room)
    62 void HWNewNet::CreateRoom(const QString & room)
    61 {
    63 {
    62 	if(netClientState != 2)
    64 	if(netClientState != 2)
   156 
   158 
   157 void HWNewNet::OnDisconnect()
   159 void HWNewNet::OnDisconnect()
   158 {
   160 {
   159   //emit ChangeInTeams(QStringList());
   161   //emit ChangeInTeams(QStringList());
   160   if(m_game_connected) emit Disconnected();
   162   if(m_game_connected) emit Disconnected();
   161   m_game_connected=false;
   163   m_game_connected = false;
   162 }
   164 }
   163 
   165 
   164 void HWNewNet::displayError(QAbstractSocket::SocketError socketError)
   166 void HWNewNet::displayError(QAbstractSocket::SocketError socketError)
   165 {
   167 {
   166 	switch (socketError) {
   168 	switch (socketError) {