--- 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();
}