[prev in list] [next in list] [prev in thread] [next in thread] 

List:       atlantik-devel
Subject:    [atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp,1.110,1.111
From:       kde () office ! kde ! org
Date:       2002-07-26 6:16:41
[Download RAW message or body]

Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv8982/client

Modified Files:
	atlantik.cpp 
Log Message:
Leaving a server and reconnecting works properly now.

Except that I am not able to connect to some hosts. Also, when trying to
connect to localhost when there's no server there a couple of times,
KExtendedSocket decided the crash dialog would be fun.

So be it. Shouldn't be hard to go back to QSocket if this persists.


Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- atlantik.cpp	2002/07/26 05:34:48	1.110
+++ atlantik.cpp	2002/07/26 06:16:39	1.111
@@ -63,13 +63,13 @@
 	m_selectGame = 0;
 	m_selectConfiguration = 0;
 	m_playerSelf = 0;
+	m_atlantikNetwork = 0;
 
 	// Game core
 	m_atlanticCore = new AtlanticCore(this, "atlanticCore");
 
 	connect(m_atlanticCore, SIGNAL(removeGUI(Trade *)), this, SLOT(removeGUI(Trade \
*)));  
-	m_atlantikNetwork = 0;
 	initNetworkObject();
 
 	// Menu,toolbar: Move
@@ -81,11 +81,11 @@
 	m_auctionEstate->setEnabled(false);
 	m_endTurn = KStdGameAction::endTurn(m_atlantikNetwork, SLOT(endTurn()), \
actionCollection());  m_endTurn->setEnabled(false);
-	m_jailCard = new KAction(i18n("Use Card to Leave Jail"), "altantik_move_jail_card", \
0, m_atlantikNetwork, SLOT(jailCard()), actionCollection(), "move_jailcard"); \
+	m_jailCard = new KAction(i18n("Use Card to Leave Jail"), "atlantik_move_jail_card", \
0, m_atlantikNetwork, SLOT(jailCard()), actionCollection(), "move_jailcard");  \
m_jailCard->setEnabled(false);  m_jailPay = new KAction(i18n("&Pay to Leave Jail"), \
"jail_pay", CTRL+Key_P, m_atlantikNetwork, SLOT(jailPay()), actionCollection(), \
"move_jailpay");  m_jailPay->setEnabled(false);
-	m_jailRoll = new KAction(i18n("Roll to Leave &Jail"), "altantik_move_jail_roll", \
CTRL+Key_J, m_atlantikNetwork, SLOT(jailRoll()), actionCollection(), \
"move_jailroll"); +	m_jailRoll = new KAction(i18n("Roll to Leave &Jail"), \
"atlantik_move_jail_roll", CTRL+Key_J, m_atlantikNetwork, SLOT(jailRoll()), \
actionCollection(), "move_jailroll");  m_jailRoll->setEnabled(false);
 
 	// Mix code and XML into GUI
@@ -223,12 +223,8 @@
 	{
 		delete m_selectGame;
 		m_selectGame = 0;
-	}
-	if (m_atlantikNetwork)
-	{
-		connect(m_selectServer, SIGNAL(serverConnect(const QString, int)), \
                m_atlantikNetwork, SLOT(serverConnect(const QString, int)));
-		connect(m_atlantikNetwork, SIGNAL(gameListClear()), this, SLOT(showSelectGame()));
 	}
+	initNetworkObject();
 }
 
 void Atlantik::showSelectGame()
@@ -322,8 +318,8 @@
 
 	serverMsgsAppend(errMsg);
 
-	// Re-init network object (not yet, KExtendedSocket does weird stuff)
-	// initNetworkObject();
+	// Re-init network object
+	initNetworkObject();
 }
 
 void Atlantik::initGame()
@@ -444,7 +440,7 @@
 
 void Atlantik::slotMsgError(QString msg)
 {
-	serverMsgsAppend("ERR: " + msg);
+	serverMsgsAppend("Error: " + msg);
 }
 
 void Atlantik::slotMsgChat(QString player, QString msg)
@@ -475,7 +471,10 @@
 void Atlantik::initNetworkObject()
 {
 	if (m_atlantikNetwork)
+	{
+		m_atlantikNetwork->closeNow();
 		delete m_atlantikNetwork;
+	}
 
 	m_atlantikNetwork = new AtlantikNetwork(m_atlanticCore, this, "atlantikNetwork");
 	connect(m_atlantikNetwork, SIGNAL(msgInfo(QString)), this, \
SLOT(slotMsgInfo(QString)));

_______________________________________________
atlantik-cvs mailing list
atlantik-cvs@mail.kde.org
http://mail.kde.org/mailman/listinfo/atlantik-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic