From a0c8aa69aa1602589a6a0dde1d0eb623918751ec Mon Sep 17 00:00:00 2001 From: Cloudwalk Date: Thu, 24 Sep 2020 10:56:16 -0400 Subject: [PATCH] protocol: Change protocol_netmsg_t to contain the number of netmessages --- cl_parse.c | 8 +-- cl_protocol_dpp7.c | 5 +- cl_protocol_nq.c | 5 +- cl_protocol_qw.c | 114 ++++++++++++++++++++-------------------- protocol.c | 84 ++++++++++-------------------- protocol.h | 22 ++++---- sv_protocol.c | 126 +++++++++++++++++++++++---------------------- sv_user.c | 4 +- 8 files changed, 176 insertions(+), 192 deletions(-) diff --git a/cl_parse.c b/cl_parse.c index b89027ee..87d027e7 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -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 = ""; cmdlogname[cmdindex] = d; } - protocol->svcmsg[cmd].func(protocol); + protocol->svc->msg[cmd].func(protocol); } else { diff --git a/cl_protocol_dpp7.c b/cl_protocol_dpp7.c index f019e014..c89459c2 100644 --- a/cl_protocol_dpp7.c +++ b/cl_protocol_dpp7.c @@ -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 diff --git a/cl_protocol_nq.c b/cl_protocol_nq.c index 8578d7cb..50c07ca8 100644 --- a/cl_protocol_nq.c +++ b/cl_protocol_nq.c @@ -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} }; diff --git a/cl_protocol_qw.c b/cl_protocol_qw.c index 28f1cb65..77642cc5 100644 --- a/cl_protocol_qw.c +++ b/cl_protocol_qw.c @@ -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 // - {"", 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 // - {"", 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 // + {"", 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 // + {"", 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] + } }; diff --git a/protocol.c b/protocol.c index 306761bc..c1f72bf9 100644 --- a/protocol.c +++ b/protocol.c @@ -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[] = diff --git a/protocol.h b/protocol.h index 6e6730aa..623f8136 100644 --- a/protocol.h +++ b/protocol.h @@ -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) diff --git a/sv_protocol.c b/sv_protocol.c index 13cae8ce..6a687e79 100644 --- a/sv_protocol.c +++ b/sv_protocol.c @@ -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 diff --git a/sv_user.c b/sv_user.c index fd6759d7..b8f69b39 100644 --- 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); } } -- 2.39.2