]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - netconn.c
prvm_edict: Implement PRVM_ED_FindGlobalEval
[xonotic/darkplaces.git] / netconn.c
index a5235afa5600d6c7200b688d457bff59feed72c6..4425dfd5002cf74e57bbb3e0ecc52264279626ac 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -970,11 +970,11 @@ static void NetConn_OpenClientPort(const char *addressstring, lhnetaddresstype_t
                else
                {
                        LHNETADDRESS_ToString(&address, addressstring2, sizeof(addressstring2), true);
-                       Con_Errorf("Client failed to open a socket on address %s\n", addressstring2);
+                       Con_Printf(CON_ERROR "Client failed to open a socket on address %s\n", addressstring2);
                }
        }
        else
-               Con_Errorf("Client unable to parse address %s\n", addressstring);
+               Con_Printf(CON_ERROR "Client unable to parse address %s\n", addressstring);
 }
 
 void NetConn_OpenClientPorts(void)
@@ -1034,12 +1034,12 @@ static qboolean NetConn_OpenServerPort(const char *addressstring, lhnetaddressty
                        else
                        {
                                LHNETADDRESS_ToString(&address, addressstring2, sizeof(addressstring2), true);
-                               Con_Errorf("Server failed to open socket on address %s\n", addressstring2);
+                               Con_Printf(CON_ERROR "Server failed to open socket on address %s\n", addressstring2);
                        }
                }
                else
                {
-                       Con_Errorf("Server unable to parse address %s\n", addressstring);
+                       Con_Printf(CON_ERROR "Server unable to parse address %s\n", addressstring);
                        // if it cant parse one address, it wont be able to parse another for sure
                        return false;
                }
@@ -1060,7 +1060,6 @@ void NetConn_OpenServerPorts(int opennetports)
        port = bound(0, sv_netport.integer, 65535);
        if (port == 0)
                port = 26000;
-       Con_Printf("Server using port %i\n", port);
        if (sv_netport.integer != port)
                Cvar_SetValueQuick(&sv_netport, port);
        if (cls.state != ca_dedicated)
@@ -1265,7 +1264,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s
                conn->incoming_netgraph[conn->incoming_packetcounter].unreliablebytes = originallength + 28;
                conn->incoming_netgraph[conn->incoming_packetcounter].reliablebytes   = NETGRAPH_NOPACKET;
                conn->incoming_netgraph[conn->incoming_packetcounter].ackbytes        = NETGRAPH_NOPACKET;
-               NetConn_UpdateCleartime(&conn->incoming_cleartime, rate.integer, rate_burstsize.integer, originallength + 28);
+               NetConn_UpdateCleartime(&conn->incoming_cleartime, cl_rate.integer, cl_rate_burstsize.integer, originallength + 28);
 
                // limit bursts to one packet in size ("dialup mode" emulating old behaviour)
                if (net_test.integer)
@@ -1361,7 +1360,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s
                                        conn->incoming_netgraph[conn->incoming_packetcounter].unreliablebytes = originallength + 28;
                                        conn->incoming_netgraph[conn->incoming_packetcounter].reliablebytes   = NETGRAPH_NOPACKET;
                                        conn->incoming_netgraph[conn->incoming_packetcounter].ackbytes        = NETGRAPH_NOPACKET;
-                                       NetConn_UpdateCleartime(&conn->incoming_cleartime, rate.integer, rate_burstsize.integer, originallength + 28);
+                                       NetConn_UpdateCleartime(&conn->incoming_cleartime, cl_rate.integer, cl_rate_burstsize.integer, originallength + 28);
 
                                        conn->nq.unreliableReceiveSequence = sequence + 1;
                                        conn->lastMessageTime = host.realtime;
@@ -1391,7 +1390,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s
                        else if (flags & NETFLAG_ACK)
                        {
                                conn->incoming_netgraph[conn->incoming_packetcounter].ackbytes += originallength + 28;
-                               NetConn_UpdateCleartime(&conn->incoming_cleartime, rate.integer, rate_burstsize.integer, originallength + 28);
+                               NetConn_UpdateCleartime(&conn->incoming_cleartime, cl_rate.integer, cl_rate_burstsize.integer, originallength + 28);
 
                                if (sequence == (conn->nq.sendSequence - 1))
                                {
@@ -1451,7 +1450,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s
                        {
                                unsigned char temppacket[8];
                                conn->incoming_netgraph[conn->incoming_packetcounter].reliablebytes   += originallength + 28;
-                               NetConn_UpdateCleartime(&conn->incoming_cleartime, rate.integer, rate_burstsize.integer, originallength + 28);
+                               NetConn_UpdateCleartime(&conn->incoming_cleartime, cl_rate.integer, cl_rate_burstsize.integer, originallength + 28);
 
                                conn->outgoing_netgraph[conn->outgoing_packetcounter].ackbytes        += 8 + 28;
 
@@ -1549,7 +1548,7 @@ static void NetConn_ConnectionEstablished(lhnetsocket_t *mysocket, lhnetaddress_
        // reset move sequence numbering on this new connection
        cls.servermovesequence = 0;
        if (cls.protocol == PROTOCOL_QUAKEWORLD)
-               Cmd_ForwardStringToServer("new");
+               CL_ForwardToServer("new");
        if (cls.protocol == PROTOCOL_QUAKE)
        {
                // write a keepalive (clc_nop) as it seems to greatly improve the
@@ -2740,7 +2739,7 @@ static qboolean hmac_mdfour_time_matching(lhnetaddress_t *peeraddress, const cha
        long t1, t2;
 
        if (!password[0]) {
-               Con_Error("LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
+               Con_Print(CON_ERROR "LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
                return false;
        }
 
@@ -2761,7 +2760,7 @@ static qboolean hmac_mdfour_challenge_matching(lhnetaddress_t *peeraddress, cons
        int i;
 
        if (!password[0]) {
-               Con_Error("LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
+               Con_Print(CON_ERROR "LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
                return false;
        }
 
@@ -2792,7 +2791,7 @@ static qboolean hmac_mdfour_challenge_matching(lhnetaddress_t *peeraddress, cons
 static qboolean plaintext_matching(lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen)
 {
        if (!password[0]) {
-               Con_Error("LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
+               Con_Print(CON_ERROR "LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
                return false;
        }
 
@@ -3757,7 +3756,7 @@ void NetConn_QueryMasters(qboolean querydp, qboolean queryqw)
        }
        if (!masterquerycount)
        {
-               Con_Error("Unable to query master servers, no suitable network sockets active.\n");
+               Con_Print(CON_ERROR "Unable to query master servers, no suitable network sockets active.\n");
                M_Update_Return_Reason("No network");
        }
 }
@@ -3930,7 +3929,7 @@ void NetConn_Init(void)
                        Cvar_SetQuick(&net_address, sys.argv[i + 1]);
                }
                else
-                       Con_Errorf("-ip option used, but unable to parse the address \"%s\"\n", sys.argv[i + 1]);
+                       Con_Printf(CON_ERROR "-ip option used, but unable to parse the address \"%s\"\n", sys.argv[i + 1]);
        }
 // COMMANDLINEOPTION: Server: -port <portnumber> sets the port to use for a server (default 26000, the same port as QUAKE itself), useful if you host multiple servers on your machine
        if (((i = COM_CheckParm("-port")) || (i = COM_CheckParm("-ipport")) || (i = COM_CheckParm("-udpport"))) && i + 1 < sys.argc)
@@ -3942,7 +3941,7 @@ void NetConn_Init(void)
                        Cvar_SetValueQuick(&sv_netport, i);
                }
                else
-                       Con_Errorf("-port option used, but %i is not a valid port number\n", i);
+                       Con_Printf(CON_ERROR "-port option used, but %i is not a valid port number\n", i);
        }
        cl_numsockets = 0;
        sv_numsockets = 0;