From 33cd841cfa0887355119cdf53b8d3115d3f6d762 Mon Sep 17 00:00:00 2001 From: Samual Date: Tue, 13 Dec 2011 04:36:05 -0500 Subject: [PATCH] Now make everything else compile too --- qcsrc/client/command/cl_cmd.qc | 11 ----------- qcsrc/client/command/cl_cmd.qh | 13 +++++++++++++ qcsrc/client/progs.src | 10 +++++++--- qcsrc/common/command/generic.qh | 1 + qcsrc/common/command/shared_defs.qh | 8 ++++++++ qcsrc/common/util.qc | 8 ++++++++ qcsrc/menu/progs.src | 8 +++++--- qcsrc/server/command/cmd.qc | 4 ++-- qcsrc/server/command/common.qc | 13 ++----------- qcsrc/server/command/common.qh | 4 +--- qcsrc/server/progs.src | 4 +++- 11 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 qcsrc/client/command/cl_cmd.qh create mode 100644 qcsrc/common/command/generic.qh create mode 100644 qcsrc/common/command/shared_defs.qh diff --git a/qcsrc/client/command/cl_cmd.qc b/qcsrc/client/command/cl_cmd.qc index a15626a71b..74b37e193a 100644 --- a/qcsrc/client/command/cl_cmd.qc +++ b/qcsrc/client/command/cl_cmd.qc @@ -55,17 +55,6 @@ } */ - -#define GC_REQUEST_COMMAND 1 -#define GC_REQUEST_USAGE 2 - -void Cmd_HUD_SetFields(float); -void Cmd_HUD_Help(float); - -.vector view_ofs; -entity debug_shotorg; - - // ============================ // Misc. Supporting Functions // ============================ diff --git a/qcsrc/client/command/cl_cmd.qh b/qcsrc/client/command/cl_cmd.qh new file mode 100644 index 0000000000..b55c866a10 --- /dev/null +++ b/qcsrc/client/command/cl_cmd.qh @@ -0,0 +1,13 @@ +// ============================================== +// CSQC client commands code, written by Samual +// Last updated: November 26th, 2011 +// ============================================== + +#define GC_REQUEST_COMMAND 1 +#define GC_REQUEST_USAGE 2 + +void Cmd_HUD_SetFields(float); +void Cmd_HUD_Help(float); + +.vector view_ofs; +entity debug_shotorg; \ No newline at end of file diff --git a/qcsrc/client/progs.src b/qcsrc/client/progs.src index f87bfb002c..7804ac4b81 100644 --- a/qcsrc/client/progs.src +++ b/qcsrc/client/progs.src @@ -17,8 +17,11 @@ Defs.qc ../common/util.qh ../common/items.qh ../common/explosion_equation.qh - ../common/mapinfo.qh +../common/command/generic.qh +../common/command/shared_defs.qh + +command/cl_cmd.qh autocvars.qh @@ -75,15 +78,16 @@ movetypes.qc prandom.qc bgmscript.qc noise.qc -gamecommand.qc ../common/util.qc -../common/gamecommand.qc +../common/command/generic.qc ../common/mapinfo.qc ../common/items.qc ../server/w_all.qc ../common/explosion_equation.qc +command/cl_cmd.qc + ../warpzonelib/anglestransform.qc ../warpzonelib/mathlib.qc ../warpzonelib/common.qc diff --git a/qcsrc/common/command/generic.qh b/qcsrc/common/command/generic.qh new file mode 100644 index 0000000000..3189d879dc --- /dev/null +++ b/qcsrc/common/command/generic.qh @@ -0,0 +1 @@ +// empty for now \ No newline at end of file diff --git a/qcsrc/common/command/shared_defs.qh b/qcsrc/common/command/shared_defs.qh new file mode 100644 index 0000000000..777608b880 --- /dev/null +++ b/qcsrc/common/command/shared_defs.qh @@ -0,0 +1,8 @@ +// ========================================================= +// Shared declarations for all commands, written by Samual +// Last updated: December 13th, 2011 +// ========================================================= + +// identifiers for subfunction requests by the command code structure +#define CMD_REQUEST_COMMAND 1 +#define CMD_REQUEST_USAGE 2 diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 10e4e345b2..5f648dd52a 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -2107,3 +2107,11 @@ float lowestbit(float f) f &~= f * 65536; return f; } + +string strlimitedlen(string input, string truncation, float strip_colors, float limit) +{ + if(strlen((strip_colors ? strdecolorize(input) : input)) <= limit) + return input; + else + return strcat(substring(input, 0, (strlen(input) - strlen(truncation))), truncation); +} diff --git a/qcsrc/menu/progs.src b/qcsrc/menu/progs.src index 979ae519f7..84b65e12f3 100644 --- a/qcsrc/menu/progs.src +++ b/qcsrc/menu/progs.src @@ -15,8 +15,10 @@ oo/base.h ../common/mapinfo.qh ../common/campaign_common.qh ../common/items.qh +../common/command/generic.qh +../common/command/shared_defs.qh -gamecommand.qh +command/menu_cmd.qh menu.qh draw.qh skin.qh @@ -28,8 +30,8 @@ oo/implementation.h classes.c ../common/util.qc -../common/gamecommand.qc -gamecommand.qc +../common/command/generic.qc +command/menu_cmd.qc menu.qc draw.qc xonotic/util.qc diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 9ed8aa78f0..15c03f5d24 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -857,14 +857,14 @@ void ClientCommand_who(float request) { float total_listed_players, tmp_hours, tmp_minutes, tmp_seconds; entity tmp_player; - string tmp_player_name; + //string tmp_player_name; sprint(self, strcat("List of client information", (autocvar_sv_status_privacy ? " (some data is hidden for privacy)" : string_null), ":\n")); sprint(self, sprintf(" %-4s %-20s %-5s %-3s %-9s %-16s %s\n", "ent", "nickname", "ping", "pl", "time", "ip", "crypto_id")); FOR_EACH_CLIENT(tmp_player) { - tmp_player_name = strlimitedlen(tmp_player.netname, TRUE, 20); + //tmp_player_name = strlimitedlen(tmp_player.netname, TRUE, 20); tmp_hours = tmp_minutes = tmp_seconds = 0; diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 8153505b55..67538cc945 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -3,15 +3,6 @@ // Last updated: December 13th, 2011 // ==================================================== -// TODO: move this to some util file? -string strlimitedlen(string input, float strip_colors, float limit) -{ - if(strlen((strip_colors ? strdecolorize(input) : input)) <= limit) - return input; - else - return strcat(substring(input, 0, (strlen(input) - 3)), "..."); -} - // find a player which matches the input string, and return their entity number float GetFilteredNumber(string input) { @@ -398,14 +389,14 @@ void CommonCommand_who(float request) { float total_listed_players, tmp_hours, tmp_minutes, tmp_seconds; entity tmp_player; - string tmp_player_name; + //string tmp_player_name; sprint(self, strcat("List of client information", (autocvar_sv_status_privacy ? " (some data is hidden for privacy)" : string_null), ":\n")); sprint(self, sprintf(" %-4s %-20s %-5s %-3s %-9s %-16s %s\n", "ent", "nickname", "ping", "pl", "time", "ip", "crypto_id")); FOR_EACH_CLIENT(tmp_player) { - tmp_player_name = strlimitedlen(tmp_player.netname, TRUE, 20); + //tmp_player_name = strlimitedlen(tmp_player.netname, "...", TRUE, 20); tmp_hours = tmp_minutes = tmp_seconds = 0; diff --git a/qcsrc/server/command/common.qh b/qcsrc/server/command/common.qh index 2f6ad02b87..10c4f9bfb7 100644 --- a/qcsrc/server/command/common.qh +++ b/qcsrc/server/command/common.qh @@ -3,6 +3,4 @@ // Last updated: December 13th, 2011 // ============================================================ -// identifiers for subfunction requests by the command code structure -#define CMD_REQUEST_COMMAND 1 -#define CMD_REQUEST_USAGE 2 +// nothing needed here \ No newline at end of file diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index 72fac171b7..46ed5dd82c 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -17,6 +17,8 @@ sys-post.qh ../common/items.qh ../common/explosion_equation.qh ../common/urllib.qh +../common/command/generic.qh +../common/command/shared_defs.qh autocvars.qh constants.qh @@ -141,7 +143,7 @@ campaign.qc ../common/campaign_setup.qc ../common/urllib.qc -../common/gamecommand.qc +../common/command/generic.qc command/common.qc command/radarmap.qc command/vote.qc -- 2.39.2