Modularise commands
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 3 May 2015 02:06:55 +0000 (12:06 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 3 May 2015 02:06:55 +0000 (12:06 +1000)
31 files changed:
qcsrc/client/command/cl_cmd.qc
qcsrc/client/command/commands.qc [new file with mode: 0644]
qcsrc/client/command/commands.qh [new file with mode: 0644]
qcsrc/client/progs.src
qcsrc/common/command/command.qh [new file with mode: 0644]
qcsrc/common/command/commands.qc [new file with mode: 0644]
qcsrc/common/command/commands.qh [new file with mode: 0644]
qcsrc/common/command/generic.qc
qcsrc/common/command/generic.qh
qcsrc/common/command/markup.qc
qcsrc/common/command/markup.qh
qcsrc/common/command/rpn.qc
qcsrc/common/command/rpn.qh
qcsrc/common/command/shared_defs.qh [deleted file]
qcsrc/common/util.qh
qcsrc/menu/_.qh [new file with mode: 0644]
qcsrc/menu/command/commands.qc [new file with mode: 0644]
qcsrc/menu/command/commands.qh [new file with mode: 0644]
qcsrc/menu/progs.src
qcsrc/server/command/banning.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/commands.qc [new file with mode: 0644]
qcsrc/server/command/commands.qh [new file with mode: 0644]
qcsrc/server/command/common.qc
qcsrc/server/command/common.qh
qcsrc/server/command/getreplies.qc
qcsrc/server/command/radarmap.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/mutators/mutators_include.qc
qcsrc/server/progs.src

index d905ffc..18fcfd1 100644 (file)
@@ -3,6 +3,7 @@
 //  Last updated: December 28th, 2011
 // ==============================================
 
+#include "../../common/command/command.qh"
 #include "cl_cmd.qh"
 
 #include "../autocvars.qh"
@@ -16,7 +17,6 @@
 #include "../../common/mapinfo.qh"
 
 #include "../../common/command/generic.qh"
-#include "../../common/command/shared_defs.qh"
 
 void DrawDebugModel()
 {
diff --git a/qcsrc/client/command/commands.qc b/qcsrc/client/command/commands.qc
new file mode 100644 (file)
index 0000000..fc4fc52
--- /dev/null
@@ -0,0 +1,5 @@
+#include "../_.qh"
+
+#include "../../common/command/commands.qc"
+
+#include "cl_cmd.qc"
diff --git a/qcsrc/client/command/commands.qh b/qcsrc/client/command/commands.qh
new file mode 100644 (file)
index 0000000..65bf3da
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef CLIENT_COMMANDS_H
+#define CLIENT_COMMANDS_H
+
+#include "../../common/command/commands.qh"
+
+#include "cl_cmd.qh"
+
+#endif
index c66554a..36d159c 100644 (file)
@@ -37,7 +37,7 @@ view.qc
 wall.qc
 waypointsprites.qc
 
-command/cl_cmd.qc
+command/commands.qc
 
 vehicles/bumblebee.qc
 vehicles/vehicles.qc
@@ -55,10 +55,6 @@ weapons/projectile.qc // TODO
 ../common/urllib.qc
 ../common/util.qc
 
-../common/command/generic.qc
-../common/command/markup.qc
-../common/command/rpn.qc
-
 ../common/monsters/monsters.qc
 
 ../common/weapons/weapons.qc // TODO
diff --git a/qcsrc/common/command/command.qh b/qcsrc/common/command/command.qh
new file mode 100644 (file)
index 0000000..fa310fd
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef COMMAND_H
+#define COMMAND_H
+
+// =========================================================
+//  Shared declarations for all commands, written by Samual
+//  Last updated: December 13th, 2011
+// =========================================================
+
+// identifiers for subfunction requests by the command code structure
+const int CMD_REQUEST_COMMAND = 1;
+const int CMD_REQUEST_USAGE = 2;
+#endif
diff --git a/qcsrc/common/command/commands.qc b/qcsrc/common/command/commands.qc
new file mode 100644 (file)
index 0000000..dc1c044
--- /dev/null
@@ -0,0 +1,3 @@
+#include "generic.qc"
+#include "markup.qc"
+#include "rpn.qc"
diff --git a/qcsrc/common/command/commands.qh b/qcsrc/common/command/commands.qh
new file mode 100644 (file)
index 0000000..d434a86
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef COMMON_COMMANDS_H
+#define COMMON_COMMANDS_H
+
+#include "generic.qh"
+#include "markup.qh"
+#include "rpn.qh"
+
+#endif
index 7f302e0..dac268d 100644 (file)
@@ -1,5 +1,26 @@
+#include "command.qh"
 #include "generic.qh"
-#include "shared_defs.qh"
+
+#include "markup.qh"
+#include "rpn.qh"
+
+#include "../mapinfo.qh"
+#include "../test.qh"
+
+#ifndef MENUQC
+       #include "../notifications.qh"
+#endif
+
+#ifdef CSQC
+       #include "../../client/command/cl_cmd.qh"
+#endif
+
+#ifdef SVQC
+       #include "../../server/command/banning.qh"
+       #include "../../server/command/cmd.qh"
+       #include "../../server/command/common.qh"
+       #include "../../server/command/sv_cmd.qh"
+#endif
 
 // =========================================================
 //  Generic program common command code, written by Samual
index 02875f6..e419824 100644 (file)
@@ -1,9 +1,7 @@
-#ifndef GENERIC_H
-#define GENERIC_H
+#ifndef COMMAND_GENERIC_H
+#define COMMAND_GENERIC_H
 
 #include "../constants.qh"
-#include "markup.qh"
-#include "rpn.qh"
 
 // =========================================================
 //  Declarations for common command code, written by Samual
index 8030f9e..9f0883b 100644 (file)
@@ -1,3 +1,4 @@
+#include "command.qh"
 #include "markup.qh"
 
 // =========================================================
index e6ac7cf..bccc78d 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef MARKUP_H
-#define MARKUP_H
+#ifndef COMMAND_MARKUP_H
+#define COMMAND_MARKUP_H
 
 // ==========================================================
 //  Declarations for markup command code, reworked by Samual
index bb920d6..700ceb4 100644 (file)
@@ -1,5 +1,8 @@
+#include "command.qh"
 #include "rpn.qh"
 
+#include "../../warpzonelib/mathlib.qh"
+
 // ========================================
 //  RPN command code, written by divVerent
 //  Last updated: December 28th, 2011
index a28f294..3c5a801 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef RPN_H
-#define RPN_H
+#ifndef COMMAND_RPN_H
+#define COMMAND_RPN_H
 
 // =========================================================
 //  Declarations for RPN command code, written by divVerent
diff --git a/qcsrc/common/command/shared_defs.qh b/qcsrc/common/command/shared_defs.qh
deleted file mode 100644 (file)
index 0056565..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef SHARED_DEFS_H
-#define SHARED_DEFS_H
-
-// =========================================================
-//  Shared declarations for all commands, written by Samual
-//  Last updated: December 13th, 2011
-// =========================================================
-
-// identifiers for subfunction requests by the command code structure
-const int CMD_REQUEST_COMMAND = 1;
-const int CMD_REQUEST_USAGE = 2;
-#endif
index 7e601fd..2e41ce7 100644 (file)
@@ -385,12 +385,12 @@ string autocvar_hud_colorset_background = "7"; // BG - White // neutral/unimport
 string CCR(string input);
 
 #ifndef MENUQC
-#ifdef CSQC
-#define GENTLE (autocvar_cl_gentle || autocvar_cl_gentle_messages)
-#else
-#define GENTLE autocvar_sv_gentle
-#endif
-#define normal_or_gentle(normal,gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
+       #ifdef CSQC
+               #define GENTLE (autocvar_cl_gentle || autocvar_cl_gentle_messages)
+       #else
+               #define GENTLE autocvar_sv_gentle
+       #endif
+       #define normal_or_gentle(normal, gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
 #endif
 
 // allow writing to also pass through to spectators (like so spectators see the same centerprints as players for example)
diff --git a/qcsrc/menu/_.qh b/qcsrc/menu/_.qh
new file mode 100644 (file)
index 0000000..cc07017
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef CLIENT___H
+#define CLIENT___H
+
+#include "../dpdefs/menudefs.qh"
+#include "../dpdefs/keycodes.qh"
+
+#endif
diff --git a/qcsrc/menu/command/commands.qc b/qcsrc/menu/command/commands.qc
new file mode 100644 (file)
index 0000000..9d74fbb
--- /dev/null
@@ -0,0 +1,3 @@
+#include "../../common/command/commands.qc"
+
+#include "menu_cmd.qc"
diff --git a/qcsrc/menu/command/commands.qh b/qcsrc/menu/command/commands.qh
new file mode 100644 (file)
index 0000000..5ea3006
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef MENU_COMMANDS_H
+#define MENU_COMMANDS_H
+
+#include "../../common/command/commands.qh"
+
+#include "menu_cmd.qh"
+
+#endif
index 547a327..631b91f 100644 (file)
@@ -10,7 +10,7 @@ oo/implementation.qc
 draw.qc
 menu.qc
 
-command/menu_cmd.qc
+command/commands.qc
 
 xonotic/util.qc
 
@@ -22,10 +22,6 @@ xonotic/util.qc
 ../common/urllib.qc
 ../common/util.qc
 
-../common/command/generic.qc
-../common/command/markup.qc
-../common/command/rpn.qc
-
 ../common/monsters/monsters.qc
 
 ../common/weapons/weapons.qc // TODO
index b696651..b861f22 100644 (file)
@@ -1,14 +1,14 @@
+#include "../../common/command/command.qh"
+#include "banning.qh"
 #include "../_.qh"
-#include "../cl_player.qh"
 
-#include "banning.qh"
 #include "common.qh"
 
+#include "../cl_player.qh"
 #include "../ipban.qh"
 
-#include "../../common/command/shared_defs.qh"
-
 #include "../../common/util.qh"
+
 // =====================================================
 //  Banning and kicking command code, written by Samual
 //  Last updated: December 29th, 2011
index d091307..13bf15e 100644 (file)
@@ -1,3 +1,4 @@
+#include "../../common/command/command.qh"
 #include "cmd.qh"
 #include "../_.qh"
 
 #include "../../common/monsters/spawn.qh"
 #include "../../common/monsters/sv_monsters.qh"
 
-#include "../../common/command/shared_defs.qh"
-
-#include "../../dpdefs/dpextensions.qh"
-#include "../../dpdefs/progsdefs.qh"
-
 #include "../../warpzonelib/common.qh"
 
 void ClientKill_TeamChange (float targetteam); // 0 = don't change, -1 = auto, -2 = spec
diff --git a/qcsrc/server/command/commands.qc b/qcsrc/server/command/commands.qc
new file mode 100644 (file)
index 0000000..1db4db1
--- /dev/null
@@ -0,0 +1,10 @@
+#include "../../common/command/commands.qc"
+
+#include "sv_cmd.qc"
+
+#include "banning.qc"
+#include "cmd.qc"
+#include "common.qc"
+#include "getreplies.qc"
+#include "radarmap.qc"
+#include "vote.qc"
diff --git a/qcsrc/server/command/commands.qh b/qcsrc/server/command/commands.qh
new file mode 100644 (file)
index 0000000..d26468d
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef SERVER_COMMANDS_H
+#define SERVER_COMMANDS_H
+
+#include "../../common/command/commands.qh"
+
+#include "sv_cmd.qh"
+
+#include "banning.qh"
+#include "cmd.qh"
+#include "common.qh"
+#include "getreplies.qh"
+#include "radarmap.qh"
+#include "vote.qh"
+
+#endif
index 3fcb0a3..8923ae3 100644 (file)
@@ -1,3 +1,4 @@
+#include "../../common/command/command.qh"
 #include "common.qh"
 #include "../_.qh"
 
index ac99e32..0925d71 100644 (file)
@@ -4,7 +4,7 @@
 #include "vote.qh"
 
 #include "../../common/command/generic.qh"
-#include "../../common/command/shared_defs.qh"
+#include "../../common/command/command.qh"
 
 // ============================================================
 //  Shared declarations for server commands, written by Samual
index 38c4bf1..2950e97 100644 (file)
@@ -1,3 +1,4 @@
+#include "../../common/command/command.qh"
 #include "getreplies.qh"
 #include "../_.qh"
 
index 792aba1..a2dcebb 100644 (file)
@@ -1,3 +1,4 @@
+#include "../../common/command/command.qh"
 #include "radarmap.qh"
 #include "../_.qh"
 
index 910d3e6..5d9b5a6 100644 (file)
@@ -1,3 +1,4 @@
+#include "../../common/command/command.qh"
 #include "sv_cmd.qh"
 #include "../_.qh"
 
@@ -28,8 +29,6 @@
 #include "../../common/teams.qh"
 #include "../../common/util.qh"
 
-#include "../../common/command/shared_defs.qh"
-
 #include "../../common/monsters/sv_monsters.qh"
 
 #include "../../warpzonelib/mathlib.qh"
index 4e2d473..d9d1a30 100644 (file)
@@ -1,3 +1,4 @@
+#include "../../common/command/command.qh"
 #include "vote.qh"
 #include "../_.qh"
 
@@ -17,8 +18,6 @@
 #include "../../common/playerstats.qh"
 #include "../../common/util.qh"
 
-#include "../../common/command/shared_defs.qh"
-
 // =============================================
 //  Server side voting code, reworked by Samual
 //  Last updated: December 27th, 2011
index a0170e4..350f10a 100644 (file)
@@ -20,7 +20,7 @@
     #include "../../common/command/markup.qh"
     #include "../../common/command/rpn.qh"
     #include "../../common/command/generic.qh"
-    #include "../../common/command/shared_defs.qh"
+    #include "../../common/command/command.qh"
     #include "../../common/net_notice.qh"
     #include "../../common/animdecide.qh"
     #include "../../common/monsters/monsters.qh"
index f288934..6b93a92 100644 (file)
@@ -71,13 +71,7 @@ bot/havocbot/role_keyhunt.qc
 bot/havocbot/role_onslaught.qc
 bot/havocbot/roles.qc
 
-command/banning.qc
-command/cmd.qc
-command/common.qc
-command/getreplies.qc
-command/radarmap.qc
-command/sv_cmd.qc
-command/vote.qc
+command/commands.qc
 
 mutators/mutators_include.qc
 mutators/mutators.qc
@@ -104,9 +98,6 @@ weapons/weaponsystem.qc
 ../common/buffs.qc
 ../common/campaign_file.qc
 ../common/campaign_setup.qc
-../common/command/generic.qc
-../common/command/markup.qc
-../common/command/rpn.qc
 ../common/mapinfo.qc
 ../common/monsters/monsters.qc
 ../common/monsters/spawn.qc