enigma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Enigma-devel] bug in enigma 1 beta


From: Ronald Lamprecht
Subject: Re: [Enigma-devel] bug in enigma 1 beta
Date: Mon, 04 Dec 2006 22:06:09 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Hi,

Marc Emanuel wrote:
When I start enigma it gives an error stating that there is a mismatch between enigma.score and state.xml . After deleting enigma.score or the .enigma directory i can start the game, but the next start gives me the same error.

We just fixed a problem with exactly the same symptoms - due to a AMD64 bit incompatibility. If you use such a system please apply the attached fix.

Otherwise do give us detailed info about the used system and attach a generated pair of enigma.score and state.xml. Please add the console output of starting enigma with option "--log".

Thanks

Ronald

Index: src/lev/ScoreManager.cc
===================================================================
--- src/lev/ScoreManager.cc     (Revision 495)
+++ src/lev/ScoreManager.cc     (Arbeitskopie)
@@ -91,11 +91,21 @@
         if (stateUserId.length() == 16 && 
                 stateUserId.find_first_not_of("01234567890ABCDEF") == 
std::string::npos) {
             unsigned i1, i2, i3, i4; 
-            sscanf(stateUserId.c_str(),"%4lX%4lX%4lX%4lX", &i1, &i2, &i3, &i4);
+//            sscanf(stateUserId.c_str(),"%4lX%4lX%4lX%4lX", &i1, &i2, &i3, 
&i4);
+            std::istringstream s1(stateUserId.substr(0, 4));
+            std::istringstream s2(stateUserId.substr(4, 4));
+            std::istringstream s3(stateUserId.substr(8, 4));
+            std::istringstream s4(stateUserId.substr(12, 4));
+            s1 >> std::hex >> i1;
+            s2 >> std::hex >> i2;
+            s3 >> std::hex >> i3;
+            s4 >> std::hex >> i4;
             if ((i4 == (i1 ^ i2 ^ i3)) && stateUserId != "0000000000000000") {
                 hasValidStateUserId = true;
                 Log << "User id '" << stateUserId << "'\n";
-            }
+            } else 
+                Log << "Bad user id '" << ecl::strf("%.4lX %.4lX %.4lX 
%.4lX",i1, i2,i3, i4) << "'\n";
+                
         }
         
         if (!app.resourceFS->findFile( "enigma.score" , scorePath)) {
@@ -257,7 +267,11 @@
 
     void ScoreManager::finishUserId(unsigned id3) {
         unsigned i1, i2, i3, i4; 
-        sscanf(userId.c_str(),"%4lX%4lX", &i1, &i2);
+//        sscanf(userId.c_str(),"%4lX%4lX", &i1, &i2);
+        std::istringstream s1(userId.substr(0, 4));
+        std::istringstream s2(userId.substr(4, 4));
+        s1 >> std::hex >> i1;
+        s2 >> std::hex >> i2;
         i3 = id3 & 0xFFFF;
         i4 = (i1 ^ i2 ^ i3);
         userId += ecl::strf("%.4lX%.4lX",i3, i4);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]