Tomaz renamed cl_fake* networking cvars to cl_net*
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 21 May 2004 18:55:30 +0000 (18:55 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 21 May 2004 18:55:30 +0000 (18:55 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4217 d7cf8633-e32d-0410-b094-e92efae38249

lhnet.c
netconn.c
netconn.h

diff --git a/lhnet.c b/lhnet.c
index 3af27a3..48a2c2c 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -674,8 +674,8 @@ int LHNET_Write(lhnetsocket_t *lhnetsocket, const void *content, int contentleng
                p->next->prev = p;
                p->prev->next = p;
 #ifndef STANDALONETEST
-               if (cl_fakelocalping_min.value || cl_fakelocalping_max.value)
-                       p->sentdoubletime = Sys_DoubleTime() + lhrandom(cl_fakelocalping_min.value, cl_fakelocalping_max.value) * (0.5 / 1000.0);
+               if (cl_netlocalping_min.value || cl_netlocalping_max.value)
+                       p->sentdoubletime = Sys_DoubleTime() + lhrandom(cl_netlocalping_min.value, cl_netlocalping_max.value) * (0.5 / 1000.0);
 #endif
                value = contentlength;
        }
index 3980258..12c97a2 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -49,12 +49,12 @@ cvar_t net_connecttimeout = {0, "net_connecttimeout","10"};
 cvar_t hostname = {CVAR_SAVE, "hostname", "UNNAMED"};
 cvar_t developer_networking = {0, "developer_networking", "0"};
 
-cvar_t cl_fakelocalping_min = {0, "cl_fakelocalping_min","0"};
-cvar_t cl_fakelocalping_max = {0, "cl_fakelocalping_max","0"};
-static cvar_t cl_fakepacketloss_receive = {0, "cl_fakepacketloss_receive","0"};
-static cvar_t cl_fakepacketloss_send = {0, "cl_fakepacketloss_send","0"};
-static cvar_t sv_fakepacketloss_receive = {0, "sv_fakepacketloss_receive","0"};
-static cvar_t sv_fakepacketloss_send = {0, "sv_fakepacketloss_send","0"};
+cvar_t cl_netlocalping_min = {0, "cl_netlocalping_min","0"};
+cvar_t cl_netlocalping_max = {0, "cl_netlocalping_max","0"};
+static cvar_t cl_netpacketloss_receive = {0, "cl_netpacketloss_receive","0"};
+static cvar_t cl_netpacketloss_send = {0, "cl_netpacketloss_send","0"};
+static cvar_t sv_netpacketloss_receive = {0, "sv_netpacketloss_receive","0"};
+static cvar_t sv_netpacketloss_send = {0, "sv_netpacketloss_send","0"};
 
 
 /* statistic counters */
@@ -98,13 +98,13 @@ int NetConn_Read(lhnetsocket_t *mysocket, void *data, int maxlength, lhnetaddres
 {
        int length = LHNET_Read(mysocket, data, maxlength, peeraddress);
        int i;
-       if (cl_fakepacketloss_receive.integer)
+       if (cl_netpacketloss_receive.integer)
                for (i = 0;i < cl_numsockets;i++)
-                       if (cl_sockets[i] == mysocket && (rand() % 100) < cl_fakepacketloss_receive.integer)
+                       if (cl_sockets[i] == mysocket && (rand() % 100) < cl_netpacketloss_receive.integer)
                                return 0;
-       if (sv_fakepacketloss_receive.integer)
+       if (sv_netpacketloss_receive.integer)
                for (i = 0;i < cl_numsockets;i++)
-                       if (sv_sockets[i] == mysocket && (rand() % 100) < sv_fakepacketloss_receive.integer)
+                       if (sv_sockets[i] == mysocket && (rand() % 100) < sv_netpacketloss_receive.integer)
                                return 0;
        if (developer_networking.integer && length != 0)
        {
@@ -126,13 +126,13 @@ int NetConn_Write(lhnetsocket_t *mysocket, const void *data, int length, const l
 {
        int ret;
        int i;
-       if (cl_fakepacketloss_send.integer)
+       if (cl_netpacketloss_send.integer)
                for (i = 0;i < cl_numsockets;i++)
-                       if (cl_sockets[i] == mysocket && (rand() % 100) < cl_fakepacketloss_send.integer)
+                       if (cl_sockets[i] == mysocket && (rand() % 100) < cl_netpacketloss_send.integer)
                                return length;
-       if (sv_fakepacketloss_send.integer)
+       if (sv_netpacketloss_send.integer)
                for (i = 0;i < cl_numsockets;i++)
-                       if (sv_sockets[i] == mysocket && (rand() % 100) < sv_fakepacketloss_send.integer)
+                       if (sv_sockets[i] == mysocket && (rand() % 100) < sv_netpacketloss_send.integer)
                                return length;
        ret = LHNET_Write(mysocket, data, length, peeraddress);
        if (developer_networking.integer)
@@ -1600,12 +1600,12 @@ void NetConn_Init(void)
        Cvar_RegisterVariable(&net_messagetimeout);
        Cvar_RegisterVariable(&net_messagerejointimeout);
        Cvar_RegisterVariable(&net_connecttimeout);
-       Cvar_RegisterVariable(&cl_fakelocalping_min);
-       Cvar_RegisterVariable(&cl_fakelocalping_max);
-       Cvar_RegisterVariable(&cl_fakepacketloss_receive);
-       Cvar_RegisterVariable(&cl_fakepacketloss_send);
-       Cvar_RegisterVariable(&sv_fakepacketloss_receive);
-       Cvar_RegisterVariable(&sv_fakepacketloss_send);
+       Cvar_RegisterVariable(&cl_netlocalping_min);
+       Cvar_RegisterVariable(&cl_netlocalping_max);
+       Cvar_RegisterVariable(&cl_netpacketloss_receive);
+       Cvar_RegisterVariable(&cl_netpacketloss_send);
+       Cvar_RegisterVariable(&sv_netpacketloss_receive);
+       Cvar_RegisterVariable(&sv_netpacketloss_send);
        Cvar_RegisterVariable(&hostname);
        Cvar_RegisterVariable(&developer_networking);
        Cvar_RegisterVariable(&cl_netport);
index a2ab98f..7d35b38 100755 (executable)
--- a/netconn.h
+++ b/netconn.h
@@ -200,8 +200,8 @@ extern int serverreplycount;
 
 extern sizebuf_t net_message;
 
-extern cvar_t cl_fakelocalping_min;
-extern cvar_t cl_fakelocalping_max;
+extern cvar_t cl_netlocalping_min;
+extern cvar_t cl_netlocalping_max;
 
 int NetConn_SendReliableMessage(netconn_t *conn, sizebuf_t *data);
 //void NetConn_SendMessageNext(netconn_t *conn);