]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 d905ffc7f1c97ec959e52000935bc8aea0cd6ec7..18fcfd1271cfeb9c273349cadf47e1f7331bdb63 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 c66554aa46a781762ccd08051dc1f56f0826bb0e..36d159c75e4df54202d7e5c4db0533e5c614f622 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 7f302e0a27e3e25eff4a196eca39d71bfd7179f5..dac268d7ed0ea1cdd8f56ebae4ae584245b6d682 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 02875f6eab9fa0ba920e4b25a4a22dd6856d035f..e419824ec8eb8d0aadf82735805bf1193c5bc713 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 8030f9e0076d9a7f128cabdb2c672d4a02f5152b..9f0883bd61ba0ea6696dc9a9e443f1f1e733addb 100644 (file)
@@ -1,3 +1,4 @@
+#include "command.qh"
 #include "markup.qh"
 
 // =========================================================
index e6ac7cfbd3c810eb6e0aa5f40ba3095b567da606..bccc78d0bcd3537d43c4aaa1c91410d47fad7a26 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 bb920d697e91ce9e2dfc10b1bc4f4fd2e1a2c4a5..700ceb46ea02dc5fa5c210b5fc3e3a5074f98a28 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 a28f2946a904250f5c46dac92d609bb9194f8fce..3c5a8019b2a0cfee52c3ab8e9c500edde24563fa 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 7e601fdd4e7934037a5a233b771fd47c088231dc..2e41ce76ca796a1868b06085ff6dc197e06e7c86 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 547a32708c390157e2dc4f2e1a1f604fef9be1b3..631b91f558366515391756b65b83d76b4c088cc1 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 b696651171a61cc5e3f11f8dadcf4b647feec319..b861f22a9249f14a4283e2a36189366c45f1b72c 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 d0913074344a0946da74a8348f5f0adeeb968343..13bf15e88a8c5d3df4601280a3dddef44e40b76f 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 3fcb0a3f7e8ad7dff39748280833e22567ee230b..8923ae3111bd3ef426b0aa5464d01760e039602b 100644 (file)
@@ -1,3 +1,4 @@
+#include "../../common/command/command.qh"
 #include "common.qh"
 #include "../_.qh"
 
index ac99e32dc46d2583a677e3d687d6a067dde510ee..0925d7137855c000e51017f720f057e2ded902c3 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 38c4bf16cac33e11779ad0d85219267e4b869a36..2950e975b49099e44e95487994012b915aa1df83 100644 (file)
@@ -1,3 +1,4 @@
+#include "../../common/command/command.qh"
 #include "getreplies.qh"
 #include "../_.qh"
 
index 792aba112ecb49e3d3dceddb4b6371b102b99a2b..a2dcebb93ac51920bc71854c7fbb29df913ec2d3 100644 (file)
@@ -1,3 +1,4 @@
+#include "../../common/command/command.qh"
 #include "radarmap.qh"
 #include "../_.qh"
 
index 910d3e68e4e77fb34c2bd4e54836331044750024..5d9b5a616ad276195afb8b44ef3213b88f3152ba 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 4e2d4732d234fb4f2a41938bad53a223ff0b567a..d9d1a30300ff32ac7ba4a0654e2aa66f1355ead9 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 a0170e4803f04ae82fad8c363f97f3fa5f27d454..350f10a72a65019d728b07909eb1fe018b16948d 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 f288934a278f9bdc131fc36922e86cfa5e1e0667..6b93a92b726154f727b03ab40db698662e108976 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