]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
reordered the protocolversion_t values to have preferred protocols first
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 24 May 2005 23:58:04 +0000 (23:58 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 24 May 2005 23:58:04 +0000 (23:58 +0000)
changed client connect message to list all supported protocols
shortened PROTOCOL_DARKPLACES* names to "DP1" and such to make connect message shorter

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5330 d7cf8633-e32d-0410-b094-e92efae38249

common.h
netconn.c
protocol.c

index 419ae22cbc7ab5493e29e12a315b567228121566..4cc520e34c12a571da720379bfdb463bed51a46c 100644 (file)
--- a/common.h
+++ b/common.h
@@ -117,16 +117,16 @@ unsigned short BuffLittleShort (const qbyte *buffer);
 typedef enum protocolversion_e
 {
        PROTOCOL_UNKNOWN,
-       PROTOCOL_QUAKE, // quake (aka netquake/normalquake/nq) protocol
+       PROTOCOL_DARKPLACES7, // added QuakeWorld-style movement protocol to allow more consistent prediction
+       PROTOCOL_DARKPLACES6, // various changes
+       PROTOCOL_DARKPLACES5, // uses EntityFrame5 entity snapshot encoder/decoder which is based on a Tribes networking article at http://www.garagegames.com/articles/networking1/
+       PROTOCOL_DARKPLACES4, // various changes
+       PROTOCOL_DARKPLACES3, // uses EntityFrame4 entity snapshot encoder/decoder which is broken, this attempted to do partial snapshot updates on a QuakeWorld-like protocol, but it is broken and impossible to fix
+       PROTOCOL_DARKPLACES2, // various changes
+       PROTOCOL_DARKPLACES1, // uses EntityFrame entity snapshot encoder/decoder which is a QuakeWorld-like entity snapshot delta compression method
        PROTOCOL_QUAKEDP, // darkplaces extended quake protocol (used by TomazQuake and others), backwards compatible as long as no extended features are used
        PROTOCOL_NEHAHRAMOVIE, // Nehahra movie protocol, a big nasty hack dating back to early days of the Quake Standards Group (but only ever used by neh_gl.exe), this is potentially backwards compatible with quake protocol as long as no extended features are used (but in actuality the neh_gl.exe which wrote this protocol ALWAYS wrote the extended information)
-       PROTOCOL_DARKPLACES1, // uses EntityFrame_ entity snapshot encoder/decoder which is a QuakeWorld-like entity snapshot delta compression method
-       PROTOCOL_DARKPLACES2, // various changes
-       PROTOCOL_DARKPLACES3, // uses EntityFrame4 entity snapshot encoder/decoder which is broken, this attempted to do partial snapshot updates on a QuakeWorld-like protocol, but it is broken and impossible to fix
-       PROTOCOL_DARKPLACES4, // various changes
-       PROTOCOL_DARKPLACES5, // uses EntityFrame5 entity snapshot encoder/decoder which is based on a Tribes networking article at http://www.garagegames.com/articles/networking1/
-       PROTOCOL_DARKPLACES6, // various changes
-       PROTOCOL_DARKPLACES7, // added QuakeWorld-style movement protocol to allow more consistent prediction
+       PROTOCOL_QUAKE, // quake (aka netquake/normalquake/nq) protocol
 }
 protocolversion_t;
 
index 2061a86523eb9f91c99d78c2d8bb9724bc4a8f3a..e5fe3d8845ae52498c022300d1a04fdf9bbc0b6d 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -927,10 +927,12 @@ int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length,
 
                if (length > 10 && !memcmp(string, "challenge ", 10) && cls.connect_trying)
                {
+                       char protocolnames[1400];
+                       Protocol_Names(protocolnames, sizeof(protocolnames));
                        LHNETADDRESS_ToString(peeraddress, addressstring2, sizeof(addressstring2), true);
                        Con_Printf("\"%s\" received, sending connect request back to %s\n", string, addressstring2);
                        M_Update_Return_Reason("Got challenge response");
-                       NetConn_WriteString(mysocket, va("\377\377\377\377connect\\protocol\\darkplaces 3\\challenge\\%s", string + 10), peeraddress);
+                       NetConn_WriteString(mysocket, va("\377\377\377\377connect\\protocol\\darkplaces 3\\protocols\\%s\\challenge\\%s", protocolnames, string + 10), peeraddress);
                        return true;
                }
                if (length == 6 && !memcmp(string, "accept", 6) && cls.connect_trying)
@@ -964,12 +966,12 @@ int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length,
                                if( !strcmp( cname, serverlist_cache[n].info.cname ) )
                                        break;
                        if( n == serverlist_cachecount ) {
-                               // LAN search doesnt require an answer from the master server so we wont 
+                               // LAN search doesnt require an answer from the master server so we wont
                                // know the ping nor will it be initialized already...
 
                                // find a slot
                                if( serverlist_cachecount == SERVERLIST_TOTALSIZE )
-                                       return true;                            
+                                       return true;
                                serverquerycount++;
 
                                memset(&serverlist_cache[serverlist_cachecount], 0, sizeof(serverlist_cache[serverlist_cachecount]));
@@ -983,7 +985,7 @@ int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length,
                                }
 
                                ++serverlist_cachecount;
-                       
+
                        }
                        info = &serverlist_cache[n].info;
                        if ((s = SearchInfostring(string, "gamename"     )) != NULL) strlcpy(info->game, s, sizeof (info->game));else info->game[0] = 0;
index cb7fda68e3bec8f254eef5ec4779eeef022e7f56..0c047113786c64c175eb50c2d7fcae42ebf1128b 100644 (file)
@@ -45,16 +45,16 @@ struct
 protocolversioninfo[] =
 {
        {0, "UNKNOWN"},
-       {15, "QUAKE"},
+       {3504, "DP7"},
+       {3503, "DP6"},
+       {3502, "DP5"},
+       {3501, "DP4"},
+       {3500, "DP3"},
+       {97, "DP2"},
+       {96, "DP1"},
        {15, "QUAKEDP"},
        {250, "NEHAHRAMOVIE"},
-       {96, "DARKPLACES1"},
-       {97, "DARKPLACES2"},
-       {3500, "DARKPLACES3"},
-       {3501, "DARKPLACES4"},
-       {3502, "DARKPLACES5"},
-       {3503, "DARKPLACES6"},
-       {3504, "DARKPLACES7"},
+       {15, "QUAKE"},
        {0, NULL}
 };