summaryrefslogtreecommitdiffstats
path: root/kbattleship/kbattleship/konnectionhandling.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbattleship/kbattleship/konnectionhandling.cpp')
-rw-r--r--kbattleship/kbattleship/konnectionhandling.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/kbattleship/kbattleship/konnectionhandling.cpp b/kbattleship/kbattleship/konnectionhandling.cpp
index bcfefe04..5d5c1026 100644
--- a/kbattleship/kbattleship/konnectionhandling.cpp
+++ b/kbattleship/kbattleship/konnectionhandling.cpp
@@ -19,27 +19,27 @@
extern const char *protocolVersion;
-KonnectionHandling::KonnectionHandling(QWidget *parent, KBattleshipServer *server) : QObject(parent)
+KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipServer *server) : TQObject(parent)
{
m_kbserver = server;
m_kbclient = 0;
m_type = KonnectionHandling::SERVER;
- connect(server, SIGNAL(sigServerFailure()), this, SIGNAL(sigAbortNetworkGame()));
- connect(server, SIGNAL(sigNewConnect()), this, SLOT(slotNewClient()));
- connect(server, SIGNAL(sigEndConnect()), this, SLOT(slotLostClient()));
- connect(server, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *)));
- connect(server, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *)));
+ connect(server, TQT_SIGNAL(sigServerFailure()), this, TQT_SIGNAL(sigAbortNetworkGame()));
+ connect(server, TQT_SIGNAL(sigNewConnect()), this, TQT_SLOT(slotNewClient()));
+ connect(server, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostClient()));
+ connect(server, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *)));
+ connect(server, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *)));
}
-KonnectionHandling::KonnectionHandling(QWidget *parent, KBattleshipClient *client) : QObject(parent)
+KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipClient *client) : TQObject(parent)
{
m_kbclient = client;
m_kbserver = 0;
m_type = KonnectionHandling::CLIENT;
- connect(client, SIGNAL(sigEndConnect()), this, SLOT(slotLostServer()));
- connect(client, SIGNAL(sigSocketFailure(int)), this, SLOT(slotSocketError(int)));
- connect(client, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *)));
- connect(client, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *)));
+ connect(client, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostServer()));
+ connect(client, TQT_SIGNAL(sigSocketFailure(int)), this, TQT_SLOT(slotSocketError(int)));
+ connect(client, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *)));
+ connect(client, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *)));
}
void KonnectionHandling::updateInternal(KBattleshipServer *server)
@@ -47,11 +47,11 @@ void KonnectionHandling::updateInternal(KBattleshipServer *server)
m_kbserver = server;
m_kbclient = 0;
m_type = KonnectionHandling::SERVER;
- connect(server, SIGNAL(sigServerFailure()), this, SIGNAL(sigAbortNetworkGame()));
- connect(server, SIGNAL(sigNewConnect()), this, SLOT(slotNewClient()));
- connect(server, SIGNAL(sigEndConnect()), this, SLOT(slotLostClient()));
- connect(server, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *)));
- connect(server, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *)));
+ connect(server, TQT_SIGNAL(sigServerFailure()), this, TQT_SIGNAL(sigAbortNetworkGame()));
+ connect(server, TQT_SIGNAL(sigNewConnect()), this, TQT_SLOT(slotNewClient()));
+ connect(server, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostClient()));
+ connect(server, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *)));
+ connect(server, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *)));
}
void KonnectionHandling::updateInternal(KBattleshipClient *client)
@@ -59,10 +59,10 @@ void KonnectionHandling::updateInternal(KBattleshipClient *client)
m_kbclient = client;
m_kbserver = 0;
m_type = KonnectionHandling::CLIENT;
- connect(client, SIGNAL(sigEndConnect()), this, SLOT(slotLostServer()));
- connect(client, SIGNAL(sigSocketFailure(int)), this, SLOT(slotSocketError(int)));
- connect(client, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *)));
- connect(client, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *)));
+ connect(client, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostServer()));
+ connect(client, TQT_SIGNAL(sigSocketFailure(int)), this, TQT_SLOT(slotSocketError(int)));
+ connect(client, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *)));
+ connect(client, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *)));
}
void KonnectionHandling::slotNewClient()
@@ -92,7 +92,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg)
{
// First possible message
case KMessage::DISCARD:
- if(msg->field("kmversion") == QString("true"))
+ if(msg->field("kmversion") == TQString("true"))
{
KMessageBox::error(0L, i18n("Connection dropped by enemy. The client's protocol implementation (%1) is not compatible with our (%2) version.").arg(msg->field("reason")).arg(protocolVersion));
emit sigAbortNetworkGame();
@@ -128,7 +128,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg)
// The server gave us the field data of our last shot
case KMessage::ANSWER_SHOOT:
emit sigShootable(false);
- emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == QString("true")));
+ emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == TQString("true")));
break;
// The server starts a new game
@@ -156,7 +156,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg)
{
// First message....got client information
case KMessage::GETVERSION:
- if(msg->field("protocolVersion") != QString::fromLatin1(protocolVersion))
+ if(msg->field("protocolVersion") != TQString::fromLatin1(protocolVersion))
{
m_kbserver->slotDiscardClient(protocolVersion, true, false);
KMessageBox::error(0L, i18n("Connection to client dropped. The client's protocol implementation (%1) is not compatible with our (%2) version.").arg(msg->field("protocolVersion")).arg(protocolVersion));
@@ -183,7 +183,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg)
// The client gave us the field data of our last shot
case KMessage::ANSWER_SHOOT:
emit sigShootable(false);
- emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == QString("true")));
+ emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == TQString("true")));
break;
// The client shot and wants the field state