]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
working code is better than broken code
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 6 Aug 2003 16:33:26 +0000 (16:33 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 6 Aug 2003 16:33:26 +0000 (16:33 +0000)
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
netconn.c
netconn.h
protocol.c
server.h

diff --git a/host.c b/host.c
index 2ca9ade91f9753160b26b7590a828498e6b9a7a7..50392158c3804dc13056d8ac0dcc35d0fa908443 100644 (file)
--- 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 (&timestamps);
        Cvar_RegisterVariable (&timeformat);
 
+       Cvar_RegisterVariable(&sv_maxplayers);
+
        Host_ServerOptions ();
 }
 
index 559203ecb263bcac5105bda1f8c405805996eabb..c4bd8acc2d2a29a8b910487d94043b622337b9e2 100755 (executable)
--- 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++)
index 2e9d92341c1e6acd8c06122ec59c8db407adfebf..9586fdcd65ba0abc54d8a328d7202f2963b46e6e 100755 (executable)
--- 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);
index c207835709cac3c738a0d49230d80a6dbaf5cb62..e773b2f8948200a5b57792936f6273b19538de47 100644 (file)
@@ -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)
index ed1c89f2b963c950695fb00945996c465b18a2b9..490dd52c648080a5d17e7be2f6359cd7fb9a8eb0 100644 (file)
--- 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;