From 35104488f0c896dbb43d6841a89a629b2ed248a4 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 6 Dec 2010 22:38:24 +0000 Subject: Rename -netdemo command line parameter to -solo-net, for consistency with other ports (-netdemo is still recognised). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2197 --- src/g_game.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 95cd77a6..d2694250 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2223,10 +2223,11 @@ void G_DoPlayDemo (void) // Play back a demo recorded in a netgame with a single player. // - if (playeringame[1] || M_CheckParm("-netdemo") > 0) - { - netgame = true; - netdemo = true; + if (playeringame[1] || M_CheckParm("-solo-net") > 0 + || M_CheckParm("-netdemo") > 0) + { + netgame = true; + netdemo = true; } // don't spend a lot of time in loadlevel -- cgit v1.2.3 From e4025e0a6a5e648ff59dd23973c5e7076a07eaa6 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 6 Dec 2010 23:37:27 +0000 Subject: Fix -solo-net to actually behave the same as other ports. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2198 --- src/d_net.c | 17 +++++++++++++++-- src/g_game.c | 6 ------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index bf9fbf2b..ae5a6d62 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -200,8 +200,8 @@ void NetUpdate (void) G_BuildTiccmd(&cmd); #ifdef FEATURE_MULTIPLAYER - - if (netgame && !demoplayback) + + if (net_client_connected) { NET_CL_SendTiccmd(&cmd, maketic); } @@ -254,6 +254,19 @@ void D_CheckNetGame (void) playeringame[0] = true; + //! + // @category net + // + // Start the game playing as though in a netgame with a single + // player. This can also be used to play back single player netgame + // demos. + // + + if (M_CheckParm("-solo-net") > 0) + { + netgame = true; + } + #ifdef FEATURE_MULTIPLAYER { diff --git a/src/g_game.c b/src/g_game.c index d2694250..59550513 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2217,12 +2217,6 @@ void G_DoPlayDemo (void) for (i=0 ; i 0 || M_CheckParm("-netdemo") > 0) { -- cgit v1.2.3 From 6727d54e95153c083acbba5ab77f1f9bce92b331 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 7 Dec 2010 22:35:17 +0000 Subject: Assign the oldest client to be the controller, not the first found in the clients[] array. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2201 --- src/net_server.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/net_server.c b/src/net_server.c index 43584170..4307e2e2 100644 --- a/src/net_server.c +++ b/src/net_server.c @@ -69,6 +69,11 @@ typedef struct int last_send_time; char *name; + // Time that this client connected to the server. + // This is used to determine the controller (oldest client). + + unsigned int connect_time; + // Last time new gamedata was received from this client int last_gamedata_time; @@ -381,19 +386,29 @@ static void NET_SV_AdvanceWindow(void) static net_client_t *NET_SV_Controller(void) { + net_client_t *best; int i; - // first client in the list is the controller + // Find the oldest client (first to connect). + + best = NULL; for (i=0; iconnect_time) + { + best = &clients[i]; } } - return NULL; + return best; } // Given an address, find the corresponding client @@ -433,6 +448,7 @@ static void NET_SV_InitNewClient(net_client_t *client, char *player_name) { client->active = true; + client->connect_time = I_GetTimeMS(); NET_Conn_InitServer(&client->connection, addr); client->addr = addr; client->last_send_time = -1; -- cgit v1.2.3 From 3f3efe93eb84ce222dcdb8469f66bcd0fae2e74d Mon Sep 17 00:00:00 2001 From: Russell Rice Date: Tue, 7 Dec 2010 23:13:34 +0000 Subject: - Update chocolate-server codeblocks project Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2202 --- codeblocks/server.cbp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codeblocks/server.cbp b/codeblocks/server.cbp index c15d3d96..28eda97a 100644 --- a/codeblocks/server.cbp +++ b/codeblocks/server.cbp @@ -76,6 +76,10 @@