summaryrefslogtreecommitdiffstats
path: root/signet/ServerConnectionHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'signet/ServerConnectionHandler.cpp')
-rw-r--r--signet/ServerConnectionHandler.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/signet/ServerConnectionHandler.cpp b/signet/ServerConnectionHandler.cpp
new file mode 100644
index 00000000..be5d8e53
--- /dev/null
+++ b/signet/ServerConnectionHandler.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2008 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Header include
+#include "ServerConnectionHandler.h"
+
+// Signet includes
+#include "Server.h"
+
+// KDE includes
+#include <KConfigGroup>
+
+Signet::ServerConnectionHandler::ServerConnectionHandler(Server* server, QObject* parent) :
+ ConnectionHandler(parent),
+ m_server(server)
+{
+}
+
+void Signet::ServerConnectionHandler::connectToMaster(const KConfigGroup& group)
+{
+ // TODO: Get the information from the configuration
+ // TODO: Connect to the master
+// QHostAddress masterAddress;
+// int port;
+// QString key;
+// int timeout;
+// if (config->hasGroup("Master Server"))
+// {
+// const KConfigGroup& group = config->group("Master Server");
+// QString address = group.readEntry("Address", "");
+// if (!masterAddress.setAddress(address))
+// qFatal(QString("Invalid address for the master server: %1").arg(address));
+// port = group.readEntry("Port", -1);
+// if (port < 0)
+// qFatal(QString("Invalid port for the master server: %1").arg(port));
+// key = group.readEntry("Key", "");
+// timeout = group.readEntry("Timeout", 30000);
+// }
+// else
+// {
+// // TODO: Configuration not complete
+// }
+// // TODO: Proxy support?
+// m_masterServer->connectToHost(masterAddress, port);
+// if (!m_masterServer->waitForConnect(timeout))
+// {
+// // TODO: Connect failed
+// }
+}