shithub: choc

Download patch

ref: 26446dde302568de04185498bddf1caa9f2c5984
parent: 5af0b0450d5e7ae30ec6cef585f1f5c4ef4dddce
author: Simon Howard <fraggle@gmail.com>
date: Fri Sep 20 23:08:01 EDT 2013

Sync -random command line parameter as part of game settings.

Subversion-branch: /branches/v2-branch
Subversion-revision: 2670

--- a/src/net_defs.h
+++ b/src/net_defs.h
@@ -168,7 +168,7 @@
 // Game settings sent by client to server when initiating game start,
 // and received from the server by clients when the game starts.
 
-typedef struct 
+typedef struct
 {
     int ticdup;
     int extratics;
@@ -184,6 +184,7 @@
     int new_sync;
     int timelimit;
     int loadgame;
+    int random;  // [Strife only]
 
     // These fields are only used by the server when sending a game
     // start message:
--- a/src/net_structrw.c
+++ b/src/net_structrw.c
@@ -75,6 +75,7 @@
     NET_WriteInt8(packet, settings->new_sync);
     NET_WriteInt32(packet, settings->timelimit);
     NET_WriteInt8(packet, settings->loadgame);
+    NET_WriteInt8(packet, settings->random);
     NET_WriteInt8(packet, settings->num_players);
     NET_WriteInt8(packet, settings->consoleplayer);
 
@@ -103,6 +104,7 @@
            && NET_ReadInt8(packet, (unsigned int *) &settings->new_sync)
            && NET_ReadInt32(packet, (unsigned int *) &settings->timelimit)
            && NET_ReadSInt8(packet, (signed int *) &settings->loadgame)
+           && NET_ReadInt8(packet, (unsigned int *) &settings->random)
            && NET_ReadInt8(packet, (unsigned int *) &settings->num_players)
            && NET_ReadSInt8(packet, (signed int *) &settings->consoleplayer);
 
--- a/src/strife/d_net.c
+++ b/src/strife/d_net.c
@@ -133,6 +133,7 @@
     respawnparm = settings->respawn_monsters;
     timelimit = settings->timelimit;
     consoleplayer = settings->consoleplayer;
+    randomparm = settings->random;
 
     if (lowres_turn)
     {
@@ -164,6 +165,7 @@
     settings->fast_monsters = fastparm;
     settings->respawn_monsters = respawnparm;
     settings->timelimit = timelimit;
+    settings->random = randomparm;
 
     settings->lowres_turn = M_ParmExists("-record")
                          && !M_ParmExists("-longtics");