From 8da4459b59336acc54dd028e44177756cbfa48cd Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 6 Aug 2003 16:33:26 +0000 Subject: [PATCH] working code is better than broken code code that compiles is good too... (fix bugs/unfinished code in the DPPROTOCOL_VERSION4 commit) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3368 d7cf8633-e32d-0410-b094-e92efae38249 --- host.c | 6 +++++- netconn.c | 4 +--- netconn.h | 1 - protocol.c | 3 +++ server.h | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/host.c b/host.c index 2ca9ade9..50392158 100644 --- a/host.c +++ b/host.c @@ -96,6 +96,8 @@ cvar_t temp1 = {0, "temp1","0"}; cvar_t timestamps = {CVAR_SAVE, "timestamps", "0"}; cvar_t timeformat = {CVAR_SAVE, "timeformat", "[%b %e %X] "}; +cvar_t sv_maxplayers = {0, "maxplayers", "8"}; + /* ================ Host_EndGame @@ -213,7 +215,7 @@ void Host_ServerOptions (void) else { // default players in some games, singleplayer in most - if (gamemode != GAME_TRANSFUSION && gamemode != GAME_GOODVSBAD2 && gamemode != GAME_NEXUIZ || gamemode == GAME_BATTLEMECH) + if (gamemode != GAME_TRANSFUSION && gamemode != GAME_GOODVSBAD2 && gamemode != GAME_NEXUIZ && gamemode != GAME_BATTLEMECH) numplayers = 1; } } @@ -286,6 +288,8 @@ void Host_InitLocal (void) Cvar_RegisterVariable (×tamps); Cvar_RegisterVariable (&timeformat); + Cvar_RegisterVariable(&sv_maxplayers); + Host_ServerOptions (); } diff --git a/netconn.c b/netconn.c index 559203ec..c4bd8acc 100755 --- a/netconn.c +++ b/netconn.c @@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MASTER_PORT 27950 -cvar_t sv_maxplayers = {0, "maxplayers", "8"}; cvar_t sv_public = {0, "sv_public", "0"}; static cvar_t sv_heartbeatperiod = {CVAR_SAVE, "sv_heartbeatperiod", "180"}; @@ -918,7 +917,7 @@ static void NetConn_BuildChallengeString(char *buffer, int bufferlength) extern void SV_ConnectClient(int clientnum, netconn_t *netconnection); int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length, lhnetaddress_t *peeraddress) { - int i, n, ret, clientnum, responselength, best; + int i, n, ret, clientnum, responselength, best, clientcount; double besttime; client_t *client; netconn_t *conn; @@ -1511,7 +1510,6 @@ void NetConn_Init(void) Cvar_RegisterVariable(&sv_netport); Cvar_RegisterVariable(&sv_netaddress); Cvar_RegisterVariable(&sv_netaddress_ipv6); - Cvar_RegisterVariable(&sv_maxplayers); Cvar_RegisterVariable(&sv_public); Cvar_RegisterVariable(&sv_heartbeatperiod); for (masternum = 0;sv_masters[masternum].name;masternum++) diff --git a/netconn.h b/netconn.h index 2e9d9234..9586fdcd 100755 --- a/netconn.h +++ b/netconn.h @@ -191,7 +191,6 @@ extern unsigned short ntohs (unsigned short netshort); // //============================================================================ -extern cvar_t sv_maxplayers; extern sizebuf_t net_message; int NetConn_SendReliableMessage(netconn_t *conn, sizebuf_t *data); diff --git a/protocol.c b/protocol.c index c2078357..e773b2f8 100644 --- a/protocol.c +++ b/protocol.c @@ -793,6 +793,8 @@ void EntityFrame4_CL_ReadFrame(entity_database4_t *d) } } cl_entities[enumber].state_current.number = enumber; +#if 0 + // debugging code if (cl_entities[enumber].state_current.active != cl_entities[enumber].state_previous.active) { if (cl_entities[enumber].state_current.active) @@ -800,6 +802,7 @@ void EntityFrame4_CL_ReadFrame(entity_database4_t *d) else if (cl_entities[enumber].state_current.active) Con_Printf("entity #%i has become inactive\n"); } +#endif CL_MoveLerpEntityStates(&cl_entities[enumber]); cl_entities_active[enumber] = true; if (d->currentcommit) diff --git a/server.h b/server.h index ed1c89f2..490dd52c 100644 --- a/server.h +++ b/server.h @@ -247,6 +247,7 @@ extern cvar_t sv_idealpitchscale; extern cvar_t sv_aim; extern cvar_t sv_stepheight; extern cvar_t sv_jumpstep; +extern cvar_t sv_maxplayers; extern mempool_t *sv_clients_mempool; extern mempool_t *sv_edicts_mempool; -- 2.39.2