From aa6a1db0a969f5816a3e863d9e7742d9aeebf9a3 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 1 Dec 2022 00:34:33 +0300 Subject: [PATCH] engine: remove duplicate svc_strings definition --- engine/client/cl_debug.c | 64 ----------------------------------- engine/common/dedicated.c | 68 -------------------------------------- engine/common/net_buffer.c | 64 ++++++++++++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 133 deletions(-) diff --git a/engine/client/cl_debug.c b/engine/client/cl_debug.c index 7b019daa..1467ebd2 100644 --- a/engine/client/cl_debug.c +++ b/engine/client/cl_debug.c @@ -25,70 +25,6 @@ GNU General Public License for more details. #define MSG_COUNT 32 // last 32 messages parsed #define MSG_MASK (MSG_COUNT - 1) -const char *svc_strings[svc_lastmsg+1] = -{ - "svc_bad", - "svc_nop", - "svc_disconnect", - "svc_event", - "svc_changing", - "svc_setview", - "svc_sound", - "svc_time", - "svc_print", - "svc_stufftext", - "svc_setangle", - "svc_serverdata", - "svc_lightstyle", - "svc_updateuserinfo", - "svc_deltatable", - "svc_clientdata", - "svc_resource", - "svc_pings", - "svc_particle", - "svc_restoresound", - "svc_spawnstatic", - "svc_event_reliable", - "svc_spawnbaseline", - "svc_temp_entity", - "svc_setpause", - "svc_signonnum", - "svc_centerprint", - "svc_unused27", - "svc_unused28", - "svc_unused29", - "svc_intermission", - "svc_finale", - "svc_cdtrack", - "svc_restore", - "svc_cutscene", - "svc_weaponanim", - "svc_bspdecal", - "svc_roomtype", - "svc_addangle", - "svc_usermessage", - "svc_packetentities", - "svc_deltapacketentities", - "svc_choke", - "svc_resourcelist", - "svc_deltamovevars", - "svc_resourcerequest", - "svc_customization", - "svc_crosshairangle", - "svc_soundfade", - "svc_filetxferfailed", - "svc_hltv", - "svc_director", - "svc_voiceinit", - "svc_voicedata", - "svc_deltapacketbones", - "svc_unused55", - "svc_resourcelocation", - "svc_querycvarvalue", - "svc_querycvarvalue2", - "svc_exec", -}; - typedef struct { int command; diff --git a/engine/common/dedicated.c b/engine/common/dedicated.c index 07b77a50..6f8ef3a5 100644 --- a/engine/common/dedicated.c +++ b/engine/common/dedicated.c @@ -19,74 +19,6 @@ GNU General Public License for more details. ref_globals_t refState; -const char *svc_strings[256] = -{ - "svc_bad", - "svc_nop", - "svc_disconnect", - "svc_changing", - "svc_version", - "svc_setview", - "svc_sound", - "svc_time", - "svc_print", - "svc_stufftext", - "svc_setangle", - "svc_serverdata", - "svc_lightstyle", - "svc_updateuserinfo", - "svc_deltatable", - "svc_clientdata", - "svc_stopsound", - "svc_updatepings", - "svc_particle", - "svc_restoresound", - "svc_spawnstatic", - "svc_event_reliable", - "svc_spawnbaseline", - "svc_temp_entity", - "svc_setpause", - "svc_signonnum", - "svc_centerprint", - "svc_event", - "svc_soundindex", - "svc_ambientsound", - "svc_intermission", - "svc_modelindex", - "svc_cdtrack", - "svc_serverinfo", - "svc_eventindex", - "svc_weaponanim", - "svc_bspdecal", - "svc_roomtype", - "svc_addangle", - "svc_usermessage", - "svc_packetentities", - "svc_deltapacketentities", - "svc_chokecount", - "svc_resourcelist", - "svc_deltamovevars", - "svc_customization", - "svc_unused46", - "svc_crosshairangle", - "svc_soundfade", - "svc_unused49", - "svc_unused50", - "svc_director", - "svc_studiodecal", - "svc_unused53", - "svc_unused54", - "svc_unused55", - "svc_unused56", - "svc_querycvarvalue", - "svc_querycvarvalue2", - "svc_exec", - "svc_unused60", - "svc_unused61", - "svc_unused62", - "svc_unused63", -}; - void CL_ProcessFile( qboolean successfully_received, const char *filename ) { diff --git a/engine/common/net_buffer.c b/engine/common/net_buffer.c index fbcd7a36..34483ab9 100644 --- a/engine/common/net_buffer.c +++ b/engine/common/net_buffer.c @@ -17,7 +17,6 @@ GNU General Public License for more details. #include "protocol.h" #include "net_buffer.h" #include "xash3d_mathlib.h" - //#define DEBUG_NET_MESSAGES_SEND //#define DEBUG_NET_MESSAGES_READ @@ -26,6 +25,69 @@ GNU General Public License for more details. // gives a 33% speedup in WriteUBitLong. static dword BitWriteMasks[32][33]; static dword ExtraMasks[32]; +const char *svc_strings[svc_lastmsg+1] = +{ + "svc_bad", + "svc_nop", + "svc_disconnect", + "svc_event", + "svc_changing", + "svc_setview", + "svc_sound", + "svc_time", + "svc_print", + "svc_stufftext", + "svc_setangle", + "svc_serverdata", + "svc_lightstyle", + "svc_updateuserinfo", + "svc_deltatable", + "svc_clientdata", + "svc_resource", + "svc_pings", + "svc_particle", + "svc_restoresound", + "svc_spawnstatic", + "svc_event_reliable", + "svc_spawnbaseline", + "svc_temp_entity", + "svc_setpause", + "svc_signonnum", + "svc_centerprint", + "svc_unused27", + "svc_unused28", + "svc_unused29", + "svc_intermission", + "svc_finale", + "svc_cdtrack", + "svc_restore", + "svc_cutscene", + "svc_weaponanim", + "svc_bspdecal", + "svc_roomtype", + "svc_addangle", + "svc_usermessage", + "svc_packetentities", + "svc_deltapacketentities", + "svc_choke", + "svc_resourcelist", + "svc_deltamovevars", + "svc_resourcerequest", + "svc_customization", + "svc_crosshairangle", + "svc_soundfade", + "svc_filetxferfailed", + "svc_hltv", + "svc_director", + "svc_voiceinit", + "svc_voicedata", + "svc_deltapacketbones", + "svc_unused55", + "svc_resourcelocation", + "svc_querycvarvalue", + "svc_querycvarvalue2", + "svc_exec", +}; unsigned short MSG_BigShort( unsigned short swap ) {