QTfrontend/netserver.cpp
changeset 1375 c95c6887b289
parent 1374 f33fa81e583d
child 1384 329d3308e2e3
--- a/QTfrontend/netserver.cpp	Sat Oct 18 13:37:03 2008 +0000
+++ b/QTfrontend/netserver.cpp	Sat Oct 18 13:43:30 2008 +0000
@@ -18,17 +18,30 @@
  */
 
 #include <QMessageBox>
+
+#include "hwconsts.h"
 #include "netserver.h"
 
+HWNetServer::~HWNetServer()
+{
+	StopServer();
+}
+
 bool HWNetServer::StartServer(quint16 port)
 {
 	ds_port = port;
 
-	return true;
+	QStringList params;
+	params << QString("--port=%1").arg(port);
+	
+	process.start(bindir->absolutePath() + "/hedgewars-server", params);
+
+	return process.waitForStarted(5000);
 }
 
 void HWNetServer::StopServer()
 {
+	process.close();
 }