stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src ui/menus.c network/commands.c inc...


From: ludovic pollet
Subject: [Stratagus-CVS] stratagus/src ui/menus.c network/commands.c inc...
Date: Thu, 13 Nov 2003 08:54:05 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     ludovic pollet <address@hidden> 03/11/13 08:54:04

Modified files:
        src/ui         : menus.c 
        src/network    : commands.c 
        src/include    : settings.h 
        src/game       : game.c 

Log message:
        Fix replay from multiplayer game [bug #5602]

Patches:
Index: stratagus/src/game/game.c
diff -u stratagus/src/game/game.c:1.111 stratagus/src/game/game.c:1.112
--- stratagus/src/game/game.c:1.111     Wed Nov 12 15:43:22 2003
+++ stratagus/src/game/game.c   Thu Nov 13 08:54:04 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: game.c,v 1.111 2003/11/12 20:43:22 jsalmon3 Exp $
+//     $Id: game.c,v 1.112 2003/11/13 13:54:04 pludov Exp $
 
 //@{
 
@@ -564,6 +564,7 @@
     GameSettings.Opponents = SettingsPresetMapDefault;
     GameSettings.Terrain = SettingsPresetMapDefault;
     GameSettings.GameType = SettingsPresetMapDefault;
+    GameSettings.NetGameType = SettingsSinglePlayerGame;
 }
 
 //@}
Index: stratagus/src/include/settings.h
diff -u stratagus/src/include/settings.h:1.29 
stratagus/src/include/settings.h:1.30
--- stratagus/src/include/settings.h:1.29       Sun Oct  5 22:02:11 2003
+++ stratagus/src/include/settings.h    Thu Nov 13 08:54:03 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: settings.h,v 1.29 2003/10/06 02:02:11 jsalmon3 Exp $
+//     $Id: settings.h,v 1.30 2003/11/13 13:54:03 pludov Exp $
 
 #ifndef __SETTINGS_H__
 #define __SETTINGS_H__
@@ -60,6 +60,8 @@
 **
 */
 struct _settings_ {
+    int                NetGameType;            /// Multiplayer or single player
+
 //  Individual presets:
 //  For single-player game only Presets[0] will be used..
     struct {
@@ -79,6 +81,12 @@
 };
 
 #define SettingsPresetMapDefault       -1      /// Special: Use pud/cm supplied
+
+/**
+**     Single or multiplayer settings
+*/
+#define SettingsSinglePlayerGame       1
+#define SettingsMultiPlayerGame                2
 
 /*
 **     Resource-Preset factor
Index: stratagus/src/network/commands.c
diff -u stratagus/src/network/commands.c:1.75 
stratagus/src/network/commands.c:1.76
--- stratagus/src/network/commands.c:1.75       Wed Nov 12 15:24:48 2003
+++ stratagus/src/network/commands.c    Thu Nov 13 08:54:02 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: commands.c,v 1.75 2003/11/12 20:24:48 jsalmon3 Exp $
+//     $Id: commands.c,v 1.76 2003/11/13 13:54:02 pludov Exp $
 
 //@{
 
@@ -146,8 +146,8 @@
        fprintf(LogFile, "(replay-log\n");
        fprintf(LogFile, "  'comment\t\"Generated by Stratagus Version " 
VERSION "\"\n");
        fprintf(LogFile, "  'comment\t\"Visit http://Stratagus.Org for more 
information\"\n");
-       fprintf(LogFile, "  'comment\t\"$Id: commands.c,v 1.75 2003/11/12 
20:24:48 jsalmon3 Exp $\"\n");
-       if (NetworkFildes == (Socket)-1) {
+       fprintf(LogFile, "  'comment\t\"$Id: commands.c,v 1.76 2003/11/13 
13:54:02 pludov Exp $\"\n");
+       if (GameSettings.NetGameType == SettingsSinglePlayerGame) {
            fprintf(LogFile, "  'type\t\"%s\"\n", "single-player");
            fprintf(LogFile, "  'race\t%d\n", GameSettings.Presets[0].Race);
        } else {
@@ -290,6 +290,9 @@
            if (!strcmp(logtype, "multi-player")) {
                ExitNetwork1();
                NetPlayers = 2;
+               GameSettings.NetGameType = SettingsMultiPlayerGame;
+           } else {
+               GameSettings.NetGameType = SettingsSinglePlayerGame;
            }
            list = gh_cdr(list);
        } else if (gh_eq_p(value, gh_symbol2scm("date"))) {
Index: stratagus/src/ui/menus.c
diff -u stratagus/src/ui/menus.c:1.585 stratagus/src/ui/menus.c:1.586
--- stratagus/src/ui/menus.c:1.585      Wed Nov 12 15:29:31 2003
+++ stratagus/src/ui/menus.c    Thu Nov 13 08:54:01 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: menus.c,v 1.585 2003/11/12 20:29:31 jsalmon3 Exp $
+//     $Id: menus.c,v 1.586 2003/11/13 13:54:01 pludov Exp $
 
 //@{
 
@@ -4222,6 +4222,8 @@
     DebugCheck(!MenuMapInfo);
 
     DebugLevel0Fn("NetPlayers = %d\n" _C_ NetPlayers);
+
+    GameSettings.NetGameType=SettingsMultiPlayerGame;
 
 #ifdef DEBUG
     for (i = 0; i < PlayerMax-1; i++) {




reply via email to

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