diff options
author | Simon Howard | 2013-09-21 03:08:01 +0000 |
---|---|---|
committer | Simon Howard | 2013-09-21 03:08:01 +0000 |
commit | 26446dde302568de04185498bddf1caa9f2c5984 (patch) | |
tree | 6770fa2ebbaaf19a3f958838c0a4302845251cf4 | |
parent | 5af0b0450d5e7ae30ec6cef585f1f5c4ef4dddce (diff) | |
download | chocolate-doom-26446dde302568de04185498bddf1caa9f2c5984.tar.gz chocolate-doom-26446dde302568de04185498bddf1caa9f2c5984.tar.bz2 chocolate-doom-26446dde302568de04185498bddf1caa9f2c5984.zip |
Sync -random command line parameter as part of game settings.
Subversion-branch: /branches/v2-branch
Subversion-revision: 2670
-rw-r--r-- | src/net_defs.h | 3 | ||||
-rw-r--r-- | src/net_structrw.c | 2 | ||||
-rw-r--r-- | src/strife/d_net.c | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/net_defs.h b/src/net_defs.h index 38114efc..bdc8acc2 100644 --- a/src/net_defs.h +++ b/src/net_defs.h @@ -168,7 +168,7 @@ typedef struct // 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 @@ typedef struct 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: diff --git a/src/net_structrw.c b/src/net_structrw.c index 17556ccd..19996b14 100644 --- a/src/net_structrw.c +++ b/src/net_structrw.c @@ -75,6 +75,7 @@ void NET_WriteSettings(net_packet_t *packet, net_gamesettings_t *settings) 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 @@ boolean NET_ReadSettings(net_packet_t *packet, net_gamesettings_t *settings) && 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); diff --git a/src/strife/d_net.c b/src/strife/d_net.c index ab9d7e12..f2bfc629 100644 --- a/src/strife/d_net.c +++ b/src/strife/d_net.c @@ -133,6 +133,7 @@ static void LoadGameSettings(net_gamesettings_t *settings) respawnparm = settings->respawn_monsters; timelimit = settings->timelimit; consoleplayer = settings->consoleplayer; + randomparm = settings->random; if (lowres_turn) { @@ -164,6 +165,7 @@ static void SaveGameSettings(net_gamesettings_t *settings) settings->fast_monsters = fastparm; settings->respawn_monsters = respawnparm; settings->timelimit = timelimit; + settings->random = randomparm; settings->lowres_turn = M_ParmExists("-record") && !M_ParmExists("-longtics"); |