the demo auth checksums need to be read in with readString and not operator>>

Sun, 08 Sep 2013 17:44:58 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 08 Sep 2013 17:44:58 +0300
changeset 24
61e2752dd7cd
parent 23
3ce91eac0f24
child 25
256bb5c6b77f

the demo auth checksums need to be read in with readString and not operator>>

src/demo.cpp file | annotate | diff | comparison | revisions
--- a/src/demo.cpp	Sun Sep 08 17:18:50 2013 +0300
+++ b/src/demo.cpp	Sun Sep 08 17:44:58 2013 +0300
@@ -157,18 +157,14 @@
 	for (;;) {
 		uint8 header;
 		stream >> header;
-		print ("header: %1\n", (int) header);
 		
 		if (header == DemoBodyStart + offset) {
 			ready = true;
 			break;
 		} elif (header == DemoVersion + offset) {
-			print ("Read demo version\n");
 			stream >> zanversionID;
 			zanversion = readString (stream);
 			
-			print ("version ID: %1, version: %2\n", zanversionID, zanversion);
-			
 			if (!zanversion.startsWith ("1.1-") && !zanversion.startsWith ("1.1.1-")) {
 				uint8 a;
 				stream >> a;
@@ -182,7 +178,6 @@
 			
 			stream >> longSink; // rng seed - we don't need it
 		} elif (header == DemoUserInfo + offset) {
-			print ("Read userinfo\n");
 			userinfo.netname = readString (stream);
 			stream >> userinfo.gender
 			       >> userinfo.color
@@ -207,7 +202,7 @@
 			// The demo has two checksum strings. We're not interested
 			// in them though. Down the sink they go...
 			for (int i = 0; i < 2; ++i)
-				stream >> sink;
+				sink = readString (stream);
 		} else {
 			error (fmt (tr ("Unknown header %1!\n"), (int) header));
 			return 3;
@@ -282,7 +277,7 @@
 		ui.versionLabel->setText (zanversion);
 		ui.iwadLabel->setText (wads[0]);
 		ui.pwadsLabel->setText (pwadtext);
-		dlg->setWindowTitle (fmt (APPNAME " %1", versionString()));
+		dlg->setWindowTitle (str (APPNAME) + " " + versionString());
 		
 		if (!dlg->exec())
 			return 1;

mercurial