# HG changeset patch # User Teemu Piippo # Date 1638135930 -7200 # Node ID c55e46b7ddeb50e88abfc57a8f1269bc9b39c1ed # Parent d10a6be4d99ede03638fdc2ea1bed22927aedefd Read the colorset value recent Zandronum versions add into userinfo diff -r d10a6be4d99e -r c55e46b7ddeb launcher/demo.cpp --- a/launcher/demo.cpp Sun Nov 14 21:45:45 2021 +0200 +++ b/launcher/demo.cpp Sun Nov 28 23:45:30 2021 +0200 @@ -160,6 +160,7 @@ quint8 respawnOnFire; quint8 ticsPerUpdate; quint8 connectionType; + quint8 colorset; }; // @@ -197,6 +198,7 @@ quint16 zanversionID, numWads; quint32 longSink; QString zanversion; + QString dateversion = "00000000"; QStringList wads; UserInfo userinfo; @@ -250,6 +252,10 @@ stream >> a; buildID = (BuildType) a; } + if (zanversion.contains("-r")) + { + dateversion = zanversion.split("-r").last(); + } // The demo wads header accidentally changed in 1.3. :( if (zanversion.left(1).toInt() >= 2 or zanversion.startsWith ("1.3")) @@ -261,6 +267,12 @@ { userinfo.netname = readString (stream); stream >> userinfo.gender; + // Zandronum commit 507a744e69c4 added support for colorsets and versions since that + // write a byte for the colorset in the userinfo. + if (dateversion >= "210307-0319") + { + stream >> userinfo.colorset; + } stream >> userinfo.color; stream >> userinfo.aimdist; userinfo.skin = readString (stream);