QTfrontend/game.cpp
changeset 21 dff476dcaaa3
parent 20 ccd2c45f043d
child 25 27aa8030322b
--- a/QTfrontend/game.cpp	Wed Nov 09 18:31:11 2005 +0000
+++ b/QTfrontend/game.cpp	Sun Nov 13 22:13:58 2005 +0000
@@ -54,6 +54,7 @@
 	connect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection()));
 	IPCSocket = 0;
 	TeamCount = 0;
+	seed = "seed";
 }
 
 void HWGame::NewConnection()
@@ -162,7 +163,8 @@
 			readbytes = IPCSocket->read((char *)&msgsize, 1);
 		} else
 		{
-			msgbufsize += readbytes = IPCSocket->read((char *)&msgbuf[msgbufsize], msgsize - msgbufsize);
+			msgbufsize += 
+			readbytes = IPCSocket->read((char *)&msgbuf[msgbufsize], msgsize - msgbufsize);
 			if (msgbufsize = msgsize)
 			{
 				ParseMessage();
@@ -172,22 +174,23 @@
 	}
 }
 
-void HWGame::Start(int Resolution)
+void HWGame::Start(int Resolution, bool Fullscreen)
 {
 	if (TeamCount < 2) return;
 	QProcess * process;
 	QStringList arguments;
+	seedgen.GenRNDStr(seed, 10);
 	process = new QProcess;
 	arguments << resolutions[0][Resolution];
 	arguments << resolutions[1][Resolution];
 	arguments << "avematan";
 	arguments << "46631";
-	arguments << "=seed=";
-	arguments << "1";
+	arguments << seed;
+	arguments << (Fullscreen ? "1" : "0");
 	process->start("hw", arguments);
 }
 
-void HWGame::AddTeam(const QString teamname)
+void HWGame::AddTeam(const QString & teamname)
 {
 	if (TeamCount == 5) return;
 	teams[TeamCount] = teamname;