]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
protocol: Change protocol_netmsg_t to contain the number of netmessages
authorCloudwalk <cloudwalk009@gmail.com>
Thu, 24 Sep 2020 14:56:16 +0000 (10:56 -0400)
committerCloudwalk <cloudwalk009@gmail.com>
Thu, 24 Sep 2020 14:56:16 +0000 (10:56 -0400)
cl_parse.c
cl_protocol_dpp7.c
cl_protocol_nq.c
cl_protocol_qw.c
protocol.c
protocol.h
sv_protocol.c
sv_user.c

index b89027eed17a1140af7253afbfff6d548b6e0f0c..87d027e7d7978489d70cc3a8c5c5499c36aa67c7 100644 (file)
@@ -3339,17 +3339,17 @@ void CL_ParseServerMessage(void)
                        }
                }
 
-               if(cmd <= protocol->max_svcmsg && protocol->svcmsg[cmd].func)
+               if(cmd <= protocol->svc->size && protocol->svc->msg[cmd].func)
                {
-                       SHOWNET(protocol->svcmsg[cmd].name);
-                       cmdlogname[cmdindex] = protocol->svcmsg[cmd].name;
+                       SHOWNET(protocol->svc->msg[cmd].name);
+                       cmdlogname[cmdindex] = protocol->svc->msg[cmd].name;
                        if (!cmdlogname[cmdindex])
                        {
                                // LadyHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
                                const char *d = "<unknown>";
                                cmdlogname[cmdindex] = d;
                        }
-                       protocol->svcmsg[cmd].func(protocol);
+                       protocol->svc->msg[cmd].func(protocol);
                }
                else
                {
index f019e014bb7929dc3ca081be8ce2b25d6b98e68b..c89459c2d822c8d6154d5356ab13ba239f530751 100644 (file)
@@ -1,7 +1,8 @@
 #include "quakedef.h"
 #include "cl_protocol_ext.h"
 
-protocol_netmsg_t netmsg_dpext_svc[] =
+protocol_netmsg_t netmsg_dpext_svc =
 {
-       NETMSG_DPEXT_SVC
+       .size = 62,
+       .msg = {NETMSG_DPEXT_SVC}
 };
\ No newline at end of file
index 8578d7cbeb69c79a8b46abb3195bd6305756dc76..50c07ca8be5a9c46f6dae992a3428c7741144ecd 100644 (file)
@@ -2,7 +2,8 @@
 #include "protocol.h"
 #include "cl_protocol_basenq.h"
 
-protocol_netmsg_t netmsg_nq_svc[] =
+protocol_netmsg_t netmsg_nq_svc =
 {
-       NETMSG_BASENQ_SVC
+       .size = 34,
+       .msg = {NETMSG_BASENQ_SVC}
 };
index 28f1cb65882aa034fd768d5cfbcd4f7ecb239fbd..77642cc5bdbdcc7fa918dd0db9a891aa099b5b6b 100644 (file)
@@ -1,59 +1,63 @@
 #include "cl_protocol_baseqw.h"
 
-protocol_netmsg_t netmsg_qw_svc[] =
+protocol_netmsg_t netmsg_qw_svc =
 {
-       {"svc_bad", NULL},                                      // 0
-       {"svc_nop", Netmsg_svc_nop},                                    // 1
-       {"svc_disconnect", Netmsg_svc_disconnect},                      // 2
-       {"svc_updatestat", Netmsg_svc_updatestat},                      // 3    // [byte] [byte]
-       {"", NULL},                                                             // 4
-       {"svc_setview", NULL},                          // 5    // [short] entity number
-       {"svc_sound", Netmsg_svc_sound},                                        // 6    // <see code>
-       {"", NULL},                                                             // 7
-       {"svc_print", Netmsg_svc_print},                                        // 8    // [byte] id [string] null terminated string
-       {"svc_stufftext", Netmsg_svc_stufftext},                                // 9    // [string] stuffed into client's console buffer
-       {"svc_setangle", Netmsg_svc_setangle},                          // 10   // [angle3] set the view angle to this absolute value
-       {"svc_serverdata", Netmsg_svc_serverdata},                      // 11   // [long] protocol ...
-       {"svc_lightstyle", Netmsg_svc_lightstyle},                      // 12   // [byte] [string]
-       {"", NULL},                                                             // 13
-       {"svc_updatefrags", Netmsg_svc_updatefrags},                    // 14   // [byte] [short]
-       {"", NULL},                                                             // 15
-       {"svc_stopsound", Netmsg_svc_stopsound},                                // 16   // <see code>
-       {"", NULL},                                                             // 17
-       {"", NULL},                                                             // 18
-       {"svc_damage", Netmsg_svc_damage},                              // 19
-       {"svc_spawnstatic", Netmsg_svc_spawnstatic},                    // 20
-       {"", NULL},                                                             // 21
-       {"svc_spawnbaseline", Netmsg_svc_spawnbaseline},                        // 22
-       {"svc_temp_entity", Netmsg_svc_temp_entity},                    // 23   // variable
-       {"svc_setpause", Netmsg_svc_setpause},                          // 24   // [byte] on / off
-       {"", NULL},                                                             // 25
-       {"svc_centerprint", Netmsg_svc_centerprint},                    // 26   // [string] to put in center of the screen
-       {"svc_killedmonster", Netmsg_svc_killedmonster},                        // 27
-       {"svc_foundsecret", Netmsg_svc_foundsecret},                    // 28
-       {"svc_spawnstaticsound", Netmsg_svc_spawnstaticsound},          // 29   // [coord3] [byte] samp [byte] vol [byte] aten
-       {"svc_intermission", Netmsg_svc_intermission},                  // 30           // [vec3_t] origin [vec3_t] angle
-       {"svc_finale", Netmsg_svc_finale},                              // 31           // [string] text
-       {"svc_cdtrack", Netmsg_svc_cdtrack},                            // 32           // [byte] track
-       {"svc_sellscreen", Netmsg_svc_sellscreen},                      // 33
-       {"svc_smallkick", Netmsg_svc_smallkick},                                // 34           // set client punchangle to 2
-       {"svc_bigkick", Netmsg_svc_bigkick},                            // 35           // set client punchangle to 4
-       {"svc_updateping", Netmsg_svc_updateping},                      // 36           // [byte] [short]
-       {"svc_updateentertime", Netmsg_svc_updateentertime},            // 37           // [byte] [float]
-       {"svc_updatestatlong", Netmsg_svc_updatestatlong},              // 38           // [byte] [long]
-       {"svc_muzzleflash", Netmsg_svc_muzzleflash},                    // 39           // [short] entity
-       {"svc_updateuserinfo", Netmsg_svc_updateuserinfo},              // 40           // [byte] slot [long] uid
-       {"svc_download", Netmsg_svc_download},                          // 41           // [short] size [size bytes]
-       {"svc_playerinfo", Netmsg_svc_playerinfo},                      // 42           // variable
-       {"svc_nails", Netmsg_svc_nails},                                        // 43           // [byte] num [48 bits] xyzpy 12 12 12 4 8
-       {"svc_chokecount", Netmsg_svc_chokecount},                      // 44           // [byte] packets choked
-       {"svc_modellist", Netmsg_svc_modellist},                                // 45           // [strings]
-       {"svc_soundlist", Netmsg_svc_soundlist},                                // 46           // [strings]
-       {"svc_packetentities", Netmsg_svc_packetentities},              // 47           // [...]
-       {"svc_deltapacketentities", Netmsg_svc_deltapacketentities},    // 48           // [...]
-       {"svc_maxspeed", Netmsg_svc_maxspeed},                          // 49           // maxspeed change, for prediction
-       {"svc_entgravity", Netmsg_svc_entgravity},                      // 50           // gravity change, for prediction
-       {"svc_setinfo", Netmsg_svc_setinfo},                            // 51           // setinfo on a client
-       {"svc_serverinfo", Netmsg_svc_serverinfo},                      // 52           // serverinfo
-       {"svc_updatepl", Netmsg_svc_updatepl}                           // 53           // [byte] [byte]
+       .size = 53,
+       .msg =
+       {
+               {"svc_bad", NULL},                                      // 0
+               {"svc_nop", Netmsg_svc_nop},                                    // 1
+               {"svc_disconnect", Netmsg_svc_disconnect},                      // 2
+               {"svc_updatestat", Netmsg_svc_updatestat},                      // 3    // [byte] [byte]
+               {"", NULL},                                                             // 4
+               {"svc_setview", NULL},                          // 5    // [short] entity number
+               {"svc_sound", Netmsg_svc_sound},                                        // 6    // <see code>
+               {"", NULL},                                                             // 7
+               {"svc_print", Netmsg_svc_print},                                        // 8    // [byte] id [string] null terminated string
+               {"svc_stufftext", Netmsg_svc_stufftext},                                // 9    // [string] stuffed into client's console buffer
+               {"svc_setangle", Netmsg_svc_setangle},                          // 10   // [angle3] set the view angle to this absolute value
+               {"svc_serverdata", Netmsg_svc_serverdata},                      // 11   // [long] protocol ...
+               {"svc_lightstyle", Netmsg_svc_lightstyle},                      // 12   // [byte] [string]
+               {"", NULL},                                                             // 13
+               {"svc_updatefrags", Netmsg_svc_updatefrags},                    // 14   // [byte] [short]
+               {"", NULL},                                                             // 15
+               {"svc_stopsound", Netmsg_svc_stopsound},                                // 16   // <see code>
+               {"", NULL},                                                             // 17
+               {"", NULL},                                                             // 18
+               {"svc_damage", Netmsg_svc_damage},                              // 19
+               {"svc_spawnstatic", Netmsg_svc_spawnstatic},                    // 20
+               {"", NULL},                                                             // 21
+               {"svc_spawnbaseline", Netmsg_svc_spawnbaseline},                        // 22
+               {"svc_temp_entity", Netmsg_svc_temp_entity},                    // 23   // variable
+               {"svc_setpause", Netmsg_svc_setpause},                          // 24   // [byte] on / off
+               {"", NULL},                                                             // 25
+               {"svc_centerprint", Netmsg_svc_centerprint},                    // 26   // [string] to put in center of the screen
+               {"svc_killedmonster", Netmsg_svc_killedmonster},                        // 27
+               {"svc_foundsecret", Netmsg_svc_foundsecret},                    // 28
+               {"svc_spawnstaticsound", Netmsg_svc_spawnstaticsound},          // 29   // [coord3] [byte] samp [byte] vol [byte] aten
+               {"svc_intermission", Netmsg_svc_intermission},                  // 30           // [vec3_t] origin [vec3_t] angle
+               {"svc_finale", Netmsg_svc_finale},                              // 31           // [string] text
+               {"svc_cdtrack", Netmsg_svc_cdtrack},                            // 32           // [byte] track
+               {"svc_sellscreen", Netmsg_svc_sellscreen},                      // 33
+               {"svc_smallkick", Netmsg_svc_smallkick},                                // 34           // set client punchangle to 2
+               {"svc_bigkick", Netmsg_svc_bigkick},                            // 35           // set client punchangle to 4
+               {"svc_updateping", Netmsg_svc_updateping},                      // 36           // [byte] [short]
+               {"svc_updateentertime", Netmsg_svc_updateentertime},            // 37           // [byte] [float]
+               {"svc_updatestatlong", Netmsg_svc_updatestatlong},              // 38           // [byte] [long]
+               {"svc_muzzleflash", Netmsg_svc_muzzleflash},                    // 39           // [short] entity
+               {"svc_updateuserinfo", Netmsg_svc_updateuserinfo},              // 40           // [byte] slot [long] uid
+               {"svc_download", Netmsg_svc_download},                          // 41           // [short] size [size bytes]
+               {"svc_playerinfo", Netmsg_svc_playerinfo},                      // 42           // variable
+               {"svc_nails", Netmsg_svc_nails},                                        // 43           // [byte] num [48 bits] xyzpy 12 12 12 4 8
+               {"svc_chokecount", Netmsg_svc_chokecount},                      // 44           // [byte] packets choked
+               {"svc_modellist", Netmsg_svc_modellist},                                // 45           // [strings]
+               {"svc_soundlist", Netmsg_svc_soundlist},                                // 46           // [strings]
+               {"svc_packetentities", Netmsg_svc_packetentities},              // 47           // [...]
+               {"svc_deltapacketentities", Netmsg_svc_deltapacketentities},    // 48           // [...]
+               {"svc_maxspeed", Netmsg_svc_maxspeed},                          // 49           // maxspeed change, for prediction
+               {"svc_entgravity", Netmsg_svc_entgravity},                      // 50           // gravity change, for prediction
+               {"svc_setinfo", Netmsg_svc_setinfo},                            // 51           // setinfo on a client
+               {"svc_serverinfo", Netmsg_svc_serverinfo},                      // 52           // serverinfo
+               {"svc_updatepl", Netmsg_svc_updatepl}                           // 53           // [byte] [byte]
+       }
 };
index 306761bc377e9fc6d6641b8da017f739e0332848..c1f72bf97fe19a3b3c8443eb6e4fb6bd5c470e16 100644 (file)
@@ -50,10 +50,8 @@ protocol_t protocol_netquake =
        .ReadCoord = MSG_ReadCoord13i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector13i,
-       .max_svcmsg = 34,
-       .svcmsg = netmsg_nq_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_nq_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_quakedp =
@@ -67,10 +65,8 @@ protocol_t protocol_quakedp =
        .ReadCoord = MSG_ReadCoord13i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector13i,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_quakeworld =
@@ -83,10 +79,8 @@ protocol_t protocol_quakeworld =
        .ReadCoord = MSG_ReadCoord13i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector13i,
-       .max_svcmsg = 53,
-       .svcmsg = netmsg_qw_svc,
-       .max_clcmsg = 59,
-       .clcmsg = NULL
+       .svc = &netmsg_qw_svc,
+       .clc = NULL
 };
 
 protocol_t protocol_dpp1 =
@@ -100,10 +94,8 @@ protocol_t protocol_dpp1 =
        .ReadCoord = MSG_ReadCoord32f,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector32f,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_dpp2 =
@@ -117,10 +109,8 @@ protocol_t protocol_dpp2 =
        .ReadCoord = MSG_ReadCoord16i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector16i,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_dpp3 =
@@ -134,10 +124,8 @@ protocol_t protocol_dpp3 =
        .ReadCoord = MSG_ReadCoord16i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector16i,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_dpp4 =
@@ -151,10 +139,8 @@ protocol_t protocol_dpp4 =
        .ReadCoord = MSG_ReadCoord16i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector16i,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_dpp5 =
@@ -168,10 +154,8 @@ protocol_t protocol_dpp5 =
        .ReadCoord = MSG_ReadCoord32f,
        .ReadAngle = MSG_ReadAngle16i,
        .ReadVector = MSG_ReadVector32f,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_dpp6 =
@@ -185,10 +169,8 @@ protocol_t protocol_dpp6 =
        .ReadCoord = MSG_ReadCoord32f,
        .ReadAngle = MSG_ReadAngle16i,
        .ReadVector = MSG_ReadVector32f,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_dpp7 =
@@ -202,10 +184,8 @@ protocol_t protocol_dpp7 =
        .ReadCoord = MSG_ReadCoord32f,
        .ReadAngle = MSG_ReadAngle16i,
        .ReadVector = MSG_ReadVector32f,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 
 };
 
@@ -220,10 +200,8 @@ protocol_t protocol_nehahramovie =
        .ReadCoord = MSG_ReadCoord13i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector13i,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_nehahrabjp =
@@ -237,10 +215,8 @@ protocol_t protocol_nehahrabjp =
        .ReadCoord = MSG_ReadCoord13i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector13i,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_nehahrabjp2 =
@@ -254,10 +230,8 @@ protocol_t protocol_nehahrabjp2 =
        .ReadCoord = MSG_ReadCoord13i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector13i,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t protocol_nehahrabjp3 =
@@ -271,10 +245,8 @@ protocol_t protocol_nehahrabjp3 =
        .ReadCoord = MSG_ReadCoord13i,
        .ReadAngle = MSG_ReadAngle8i,
        .ReadVector = MSG_ReadVector13i,
-       .max_svcmsg = 62,
-       .svcmsg = netmsg_dpext_svc,
-       .max_clcmsg = 59,
-       .clcmsg = netmsg_base_clc
+       .svc = &netmsg_dpext_svc,
+       .clc = &netmsg_base_clc
 };
 
 protocol_t *protocols[] =
index 6e6730aab3ccbcf0828369e77de659d2964cbee9..623f813672ab6bbd083341491f03d101837482c7 100644 (file)
@@ -59,16 +59,18 @@ struct protocol_s
        void (*ReadVector)(sizebuf_t *, vec3_t);
 
        // TODO: Other info?
-       const int max_svcmsg;
-       struct protocol_netmsg_s *svcmsg;
-       const int max_clcmsg;
-       struct protocol_netmsg_s *clcmsg;
+       struct protocol_netmsg_s *svc;
+       struct protocol_netmsg_s *clc;
 };
 
 struct protocol_netmsg_s
 {
-       const char *name;
-       void (*func)(struct protocol_s *);
+       const int size;
+       struct
+       {
+               const char *name;
+               void (*func)(struct protocol_s *);
+       } msg[256];
 };
 
 typedef struct protocol_s protocol_t;
@@ -89,10 +91,10 @@ extern protocol_t protocol_nehahrabjp;
 extern protocol_t protocol_nehahrabjp2;
 extern protocol_t protocol_nehahrabjp3;
 
-extern protocol_netmsg_t netmsg_nq_svc[];
-extern protocol_netmsg_t netmsg_qw_svc[];
-extern protocol_netmsg_t netmsg_dpext_svc[];
-extern protocol_netmsg_t netmsg_base_clc[];
+extern protocol_netmsg_t netmsg_nq_svc;
+extern protocol_netmsg_t netmsg_qw_svc;
+extern protocol_netmsg_t netmsg_dpext_svc;
+extern protocol_netmsg_t netmsg_base_clc;
 
 #define PF_PREDICTION (1<<0)
 #define PF_MOVE_CROUCH (1<<1)
index 13cae8ceb706a1d2d213964e297cd12a82367779..6a687e79d2dcc3a9587ca2d1c293cfa6cd4043b3 100644 (file)
@@ -1,66 +1,70 @@
 #include "quakedef.h"
 #include "sv_protocol_base.h"
 
-protocol_netmsg_t netmsg_base_clc[] =
+protocol_netmsg_t netmsg_base_clc =
 {
-       {"clc_bad", NULL},
-       {"clc_nop", Netmsg_clc_nop},
-       {"clc_disconnect", Netmsg_clc_disconnect},
-       {"clc_move", Netmsg_clc_move},
-       {"clc_stringcmd", Netmsg_clc_stringcmd},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {NULL, NULL},
-       {"clc_ackframe", Netmsg_clc_ackframe},
-       {"clc_ackdownloaddata", Netmsg_clc_ackdownloaddata},
-       {"clc_unusedlh2", NULL},
-       {"clc_unusedlh3", NULL},
-       {"clc_unusedlh4", NULL},
-       {"clc_unusedlh5", NULL},
-       {"clc_unusedlh6", NULL},
-       {"clc_unusedlh7", NULL},
-       {"clc_unusedlh8", NULL},
-       {"clc_unusedlh9", NULL}
+       .size = 59,
+       .msg =
+       {
+               {"clc_bad", NULL},
+               {"clc_nop", Netmsg_clc_nop},
+               {"clc_disconnect", Netmsg_clc_disconnect},
+               {"clc_move", Netmsg_clc_move},
+               {"clc_stringcmd", Netmsg_clc_stringcmd},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {NULL, NULL},
+               {"clc_ackframe", Netmsg_clc_ackframe},
+               {"clc_ackdownloaddata", Netmsg_clc_ackdownloaddata},
+               {"clc_unusedlh2", NULL},
+               {"clc_unusedlh3", NULL},
+               {"clc_unusedlh4", NULL},
+               {"clc_unusedlh5", NULL},
+               {"clc_unusedlh6", NULL},
+               {"clc_unusedlh7", NULL},
+               {"clc_unusedlh8", NULL},
+               {"clc_unusedlh9", NULL}
+       }
 };
\ No newline at end of file
index fd6759d7baa6b10417603a4bfd66cbaf2c698fd6..b8f69b392bdfbfd4d17483a8423e43af6bf0e8a0 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -1038,7 +1038,7 @@ void SV_ReadClientMessage(void)
                        SV_ExecuteClientMoves();
                        break;
                }
-               if(!netcmd || netcmd >= protocol->max_clcmsg || !protocol->clcmsg[netcmd].func)
+               if(!netcmd || netcmd >= protocol->clc->size || !protocol->clc->msg[netcmd].func)
                {
                        Con_Printf("SV_ReadClientMessage: unknown command char %i (at offset 0x%x)\n", netcmd, sv_message.readcount);
                        if (developer_networking.integer)
@@ -1047,7 +1047,7 @@ void SV_ReadClientMessage(void)
                        return;
                }
                else
-                       protocol->clcmsg[netcmd].func(protocol);
+                       protocol->clc->msg[netcmd].func(protocol);
        }
 }