[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/network commands.c
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus/src/network commands.c |
Date: |
31 Jan 2004 20:26:14 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/01/31 20:26:13
Modified files:
src/network : commands.c
Log message:
Fix replay in savegames.
Patches:
Index: stratagus/src/network/commands.c
diff -u stratagus/src/network/commands.c:1.102
stratagus/src/network/commands.c:1.103
--- stratagus/src/network/commands.c:1.102 Thu Jan 29 23:50:34 2004
+++ stratagus/src/network/commands.c Sat Jan 31 20:26:13 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: commands.c,v 1.102 2004/01/29 12:50:34 nobody_ Exp $
+// $Id: commands.c,v 1.103 2004/01/31 09:26:13 nobody_ Exp $
//@{
@@ -173,7 +173,7 @@
replay->Comment1 = strdup("Generated by Stratagus Version " VERSION "");
replay->Comment2 = strdup("Visit http://Stratagus.Org for more
information");
- replay->Comment3 = strdup("$Id: commands.c,v 1.102 2004/01/29 12:50:34
nobody_ Exp $");
+ replay->Comment3 = strdup("$Id: commands.c,v 1.103 2004/01/31 09:26:13
nobody_ Exp $");
if (GameSettings.NetGameType == SettingsSinglePlayerGame) {
replay->Type = ReplaySinglePlayer;
@@ -292,6 +292,33 @@
free(replay);
}
+local void PrintLogCommand(LogEntry* log, CLFile* dest)
+{
+ CLprintf(dest, "Log( { ");
+ CLprintf(dest, "GameCycle = %lu, ", log->GameCycle);
+ if (log->UnitNumber != -1) {
+ CLprintf(dest, "UnitNumber = %d, ", log->UnitNumber);
+ }
+ if (log->UnitIdent) {
+ CLprintf(dest, "UnitIdent = \"%s\", ", log->UnitIdent);
+ }
+ CLprintf(dest, "Action = \"%s\", ", log->Action);
+ CLprintf(dest, "Flush = %d, ", log->Flush);
+ if (log->PosX != -1 || log->PosY != -1) {
+ CLprintf(dest, "PosX = %d, PosY = %d, ", log->PosX, log->PosY);
+ }
+ if (log->DestUnitNumber != -1) {
+ CLprintf(dest, "DestUnitNumber = %d, ", log->DestUnitNumber);
+ }
+ if (log->Value) {
+ CLprintf(dest, "Value = [[%s]], ", log->Value);
+ }
+ if (log->Num != -1) {
+ CLprintf(dest, "Num = %d, ", log->Num);
+ }
+ CLprintf(dest, "SyncRandSeed = %u } )\n", log->SyncRandSeed);
+}
+
/**
** Output the FullReplay list to dest file
**
@@ -340,7 +367,7 @@
CLprintf(dest, "} )\n");
log = CurrentReplay->Commands;
while (log) {
- AppendLog(log, dest);
+ PrintLogCommand(log, dest);
log = log->Next;
}
}
@@ -368,29 +395,7 @@
return;
}
- CLprintf(dest, "Log( { ");
- CLprintf(dest, "GameCycle = %lu, ", log->GameCycle);
- if (log->UnitNumber != -1) {
- CLprintf(dest, "UnitNumber = %d, ", log->UnitNumber);
- }
- if (log->UnitIdent) {
- CLprintf(dest, "UnitIdent = \"%s\", ", log->UnitIdent);
- }
- CLprintf(dest, "Action = \"%s\", ", log->Action);
- CLprintf(dest, "Flush = %d, ", log->Flush);
- if (log->PosX != -1 || log->PosY != -1) {
- CLprintf(dest, "PosX = %d, PosY = %d, ", log->PosX, log->PosY);
- }
- if (log->DestUnitNumber != -1) {
- CLprintf(dest, "DestUnitNumber = %d, ", log->DestUnitNumber);
- }
- if (log->Value) {
- CLprintf(dest, "Value = [[%s]], ", log->Value);
- }
- if (log->Num != -1) {
- CLprintf(dest, "Num = %d, ", log->Num);
- }
- CLprintf(dest, "SyncRandSeed = %u } )\n", log->SyncRandSeed);
+ PrintLogCommand(log, dest);
CLflush(dest);
}
- [Stratagus-CVS] stratagus/src/network commands.c, address@hidden, 2004/01/01
- [Stratagus-CVS] stratagus/src/network commands.c, address@hidden, 2004/01/02
- [Stratagus-CVS] stratagus/src/network commands.c, address@hidden, 2004/01/23
- [Stratagus-CVS] stratagus/src/network commands.c, address@hidden, 2004/01/23
- [Stratagus-CVS] stratagus/src/network commands.c, address@hidden, 2004/01/23
- [Stratagus-CVS] stratagus/src/network commands.c, address@hidden, 2004/01/23
- [Stratagus-CVS] stratagus/src/network commands.c, address@hidden, 2004/01/27
- [Stratagus-CVS] stratagus/src/network commands.c, address@hidden, 2004/01/29
- [Stratagus-CVS] stratagus/src/network commands.c,
address@hidden <=