stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus doc/ChangeLog.html src/network/comman...


From: ludovic pollet
Subject: [Stratagus-CVS] stratagus doc/ChangeLog.html src/network/comman...
Date: Fri, 21 Nov 2003 10:52:37 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     ludovic pollet <address@hidden> 03/11/21 10:52:37

Modified files:
        doc            : ChangeLog.html 
        src/network    : commands.c 

Log message:
        Record and check sync info in replays. replays without sync info will 
still work

Patches:
Index: stratagus/doc/ChangeLog.html
diff -u stratagus/doc/ChangeLog.html:1.584 stratagus/doc/ChangeLog.html:1.585
--- stratagus/doc/ChangeLog.html:1.584  Thu Nov 20 11:18:31 2003
+++ stratagus/doc/ChangeLog.html        Fri Nov 21 10:52:35 2003
@@ -2,7 +2,7 @@
 <html>
 <head>
 <!--
-----   $Id: ChangeLog.html,v 1.584 2003/11/20 16:18:31 pludov Exp $
+----   $Id: ChangeLog.html,v 1.585 2003/11/21 15:52:35 pludov Exp $
 
 ----   (c) Copyright 1998-2003 by Lutz Sammer
 
@@ -36,6 +36,7 @@
 <li>Future 2.00 Release<p>
     <ul>
     <li>++
+    <li>Record and check sync info in replay (from Ludovic Pollet)
     <li>Fixed Bug #6670 Support for keyboards other than QWERTY (from Ludovic 
Pollet)
     <li>AI can use automatically transporters (Task #2852) (from Ludovic 
Pollet)
     <li>Added a map splitter for fast PlaceReachable. (from Ludovic Pollet) 
Index: stratagus/src/network/commands.c
diff -u stratagus/src/network/commands.c:1.78 
stratagus/src/network/commands.c:1.79
--- stratagus/src/network/commands.c:1.78       Fri Nov 14 15:20:47 2003
+++ stratagus/src/network/commands.c    Fri Nov 21 10:52:37 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: commands.c,v 1.78 2003/11/14 20:20:47 jsalmon3 Exp $
+//     $Id: commands.c,v 1.79 2003/11/21 15:52:37 pludov Exp $
 
 //@{
 
@@ -81,6 +81,7 @@
     int                DestUnitNumber;
     char*      Value;
     int                Num;
+    int                SyncRandSeed;
     LogEntry*  Next;
 };
 
@@ -145,6 +146,7 @@
        {"dest-unit-number",    &IOInt,         &((LogEntry *) 
0)->DestUnitNumber,NULL},
        {"value",               &IOString,      &((LogEntry *) 0)->Value,       
NULL},
        {"Num",                 &IOInt,         &((LogEntry *) 0)->Num,         
NULL},
+       {"SyncRandSeed",        &IOInt,         &((LogEntry *) 
0)->SyncRandSeed,NULL},
        {0, 0, 0, 0}
     }
 };
@@ -238,7 +240,7 @@
 
     replay->Comment1 = strdup("Generated by Stratagus Version " VERSION 
"\"\n");
     replay->Comment2 = strdup("Visit http://Stratagus.Org for more 
information\"\n");
-    replay->Comment3 = strdup("$Id: commands.c,v 1.78 2003/11/14 20:20:47 
jsalmon3 Exp $");
+    replay->Comment3 = strdup("$Id: commands.c,v 1.79 2003/11/21 15:52:37 
pludov Exp $");
     
     if (GameSettings.NetGameType == SettingsSinglePlayerGame) {
        replay->Type = ReplaySinglePlayer;
@@ -506,6 +508,8 @@
     //
     log->Num = num;
 
+    log->SyncRandSeed = (signed)SyncRandSeed;
+
     // Append it to ReplayLog list
     AppendLog(log);
 }
@@ -677,6 +681,25 @@
     dunit = (ReplayStep->DestUnitNumber != -1 ? 
UnitSlots[ReplayStep->DestUnitNumber] : NoUnitP);
     val = ReplayStep->Value;
     num = ReplayStep->Num;
+    
+    if (((signed)SyncRandSeed) != ReplayStep->SyncRandSeed) {
+#ifdef DEBUG   
+       if (!ReplayStep->SyncRandSeed) {
+           // Replay without the 'sync info
+           NotifyPlayer(ThisPlayer, NotifyYellow, 0, 0, "No sync info for this 
replay !");
+       } else {
+           NotifyPlayer(ThisPlayer, NotifyYellow, 0, 0, "Replay got out of 
sync !");
+           ReplayStep = 0;
+           NextLogCycle = ~0UL;
+           return;
+       }
+#else
+       NotifyPlayer(ThisPlayer, NotifyYellow, 0, 0, "Replay got out of sync 
!");
+       ReplayStep = 0;
+       NextLogCycle = ~0UL;
+       return;
+#endif
+    }
     
     if (!strcmp(name, "stop")) {
        SendCommandStopUnit(UnitSlots[unit]);




reply via email to

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