]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - netconn.c
changed sbar stats (Monsters/Secrets/Time/map title) around a bit, inspired by a...
[xonotic/darkplaces.git] / netconn.c
index 598199beb15aeeaa0c395de4dee548cb29833ecf..1ade12c331a31c390ae00667a88d7bbada744888 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -126,6 +126,10 @@ cvar_t sv_netport = {0, "port", "26000", "server port for players to connect to"
 cvar_t net_address = {0, "net_address", "0.0.0.0", "network address to open ports on"};
 //cvar_t net_netaddress_ipv6 = {0, "net_address_ipv6", "[0:0:0:0:0:0:0:0]", "network address to open ipv6 ports on"};
 
+char net_extresponse[NET_EXTRESPONSE_MAX][1400];
+int net_extresponse_count = 0;
+int net_extresponse_last = 0;
+
 // ServerList interface
 serverlist_mask_t serverlist_andmasks[SERVERLIST_ANDMASKCOUNT];
 serverlist_mask_t serverlist_ormasks[SERVERLIST_ORMASKCOUNT];
@@ -576,7 +580,7 @@ int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolvers
                {
                        if (conn->message.cursize > (int)sizeof(conn->sendMessage))
                        {
-                               Con_Printf("NetConn_SendUnreliableMessage: reliable message too big (%u > %u)\n", conn->message.cursize, sizeof(conn->sendMessage));
+                               Con_Printf("NetConn_SendUnreliableMessage: reliable message too big (%u > %u)\n", conn->message.cursize, (int)sizeof(conn->sendMessage));
                                conn->message.overflowed = true;
                                return -1;
                        }
@@ -1343,6 +1347,15 @@ static int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, unsigned char *dat
                        serverlist_querywaittime = realtime + 3;
                        return true;
                }
+               if (!strncmp(string, "extResponse ", 12))
+               {
+                       ++net_extresponse_count;
+                       if(net_extresponse_count > NET_EXTRESPONSE_MAX)
+                               net_extresponse_count = NET_EXTRESPONSE_MAX;
+                       net_extresponse_last = (net_extresponse_last + 1) % NET_EXTRESPONSE_MAX;
+                       dpsnprintf(net_extresponse[net_extresponse_last], sizeof(net_extresponse[net_extresponse_last]), "'%s' %s", addressstring2, string + 12);
+                       return true;
+               }
                if (!strncmp(string, "ping", 4))
                {
                        if (developer.integer >= 10)
@@ -2491,7 +2504,7 @@ void NetConn_Init(void)
        {
                if (LHNETADDRESS_FromString(&tempaddress, com_argv[i + 1], 0) == 1)
                {
-                       Con_Printf("-ip option used, setting net_address to \"%s\"\n");
+                       Con_Printf("-ip option used, setting net_address to \"%s\"\n", com_argv[i + 1]);
                        Cvar_SetQuick(&net_address, com_argv[i + 1]);
                }
                else