]> git.pond.sub.org Git - empserver/blobdiff - src/lib/player/empmod.c
tests: New test-suite-only command __cmd
[empserver] / src / lib / player / empmod.c
index dc90860f161553c066ec3926a90dc25694cb60fd..c89896cd3449376e2d569462638c9fa274842dfd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2012, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2014, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -32,7 +32,7 @@
  *     Thomas Ruschak, 1992
  *     Ken Stevens, 1995
  *     Steve McClure, 1996-2000
- *     Markus Armbruster, 2004-2012
+ *     Markus Armbruster, 2004-2014
  */
 
 /*
 #include "com.h"
 #include "player.h"
 #include "prototypes.h"
+#include "testing.h"
 
 struct cmndstr player_coms[] = {
 /*  command form                       cost    addr    permit */
     {"accept  [as-COUNTRY]", 0, acce, C_MOD, NORM},
     {"add <NAT> <NAME> <REP> <STATUS>", 0, add, C_MOD, GOD},
     {"announce", 0, tele, C_MOD, 0},
-    {"anti <SECT>", 3, anti, C_MOD, NORM + MONEY + CAP},
+    {"anti <SECTS>", 3, anti, C_MOD, NORM + MONEY + CAP},
     {"apropos <topic>", 0, apro, 0, 0},
     {"arm <PLANE> <NUKE> <airburst?>", 3, arm, C_MOD, NORM + CAP},
     {"army <ARMY> <UNITS>", 0, army, C_MOD, NORM},
@@ -99,7 +100,7 @@ struct cmndstr player_coms[] = {
      1, drop, C_MOD, NORM + MONEY + CAP},
     {"dump <SECTS> [<fields>]", 0, dump, 0, NORM},
     {"echo [<string>]", 0, echo, 0, 0},
-    {"edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...",
+    {"edit <l|s|p|u|n|c> <SECTS|SHIPS|PLANES|LANDS|NUKES|NATS> [<KEY> <VALUE>]...",
      0, edit, C_MOD, GOD},
     {"enable", 0, enab, C_MOD, GOD},
     {"enlist <SECTS> <NUM>", 2, enli, C_MOD, NORM + MONEY + CAP},
@@ -116,8 +117,8 @@ struct cmndstr player_coms[] = {
     {"follow <leader> <SHIPS>", 1, foll, C_MOD, NORM + CAP},
     {"force", 0, force, C_MOD, GOD},
     {"fortify <UNITS> <MOB>", 1, fort, C_MOD, NORM + CAP},
-    {"give <COMM> <SECT> <NUM>", 0, give, C_MOD, GOD},
-    {"grind <SECT> <NUM>", 1, grin, C_MOD, NORM + MONEY + CAP},
+    {"give <COMM> <SECTS> <NUM>", 0, give, C_MOD, GOD},
+    {"grind <SECTS> <NUM>", 1, grin, C_MOD, NORM + MONEY + CAP},
     {"harden <PLANES> <NUM>", 2, hard, C_MOD, NORM + MONEY + CAP},
     {"headlines [days]", 0, head, 0, 0},
     {"help <topic>", 0, info, 0, 0},
@@ -166,15 +167,15 @@ struct cmndstr player_coms[] = {
     {"nation [as-COUNTRY]", 0, nati, 0, 0},
     {"navigate <SHIPS> <PATH|DESTINATION>", 1, navi, C_MOD, NORM + CAP},
     {"nbmap <SECTS|NUKE> [s|l|n|p|r|t|*|h]", 0, map, C_MOD, NORM},
-    {"ndump <SECTS>", 0, ndump, 0, NORM},
+    {"ndump <NUKES>", 0, ndump, 0, NORM},
     {"newcap <NAT> <SECTOR>", 0, new, C_MOD, GOD},
     {"neweff <SECTS>", 0, newe, 0, NORM},
     {"newspaper [days]", 0, news, 0, 0},
     {"nmap <SECTS|NUKE> [s|l|n|p|*|h]", 0, map, C_MOD, NORM},
-    {"nuke <SECTS>", 0, nuke, 0, NORM},
+    {"nuke <NUKES>", 0, nuke, 0, NORM},
     {"offer <loan|treaty> <NAT> [<NUM> <DAYS> <IRATE>]",
      1, offe, C_MOD, NORM + MONEY + CAP},
-    {"order <SHIPS> <c|s|r|d|l> ", 1, orde, C_MOD, NORM + CAP},
+    {"order <SHIPS> <c|s|r|d|l>", 1, orde, C_MOD, NORM + CAP},
     {"origin <SECT|COUNTRY|~>", 1, orig, C_MOD, NORM},
     {"paradrop <cargo-PLANES> <fighter-PLANES> <ap-SECT> <PATH|DESTINATION>",
      3, para, C_MOD, NORM + MONEY + CAP},
@@ -242,9 +243,10 @@ struct cmndstr player_coms[] = {
     {"sorder <SHIPS>", 0, sorde, 0, NORM},
     {"spy <SECTS>", 1, spy, C_MOD, NORM + CAP},
     {"sstat <SHIPS>", 0, sstat, 0, NORM},
-    {"start <TYPE> <SECTS|PLANES|SHIPS|UNITS>", 1, start, C_MOD, NORM},
+    {"start <TYPE> <SECTS|PLANES|SHIPS|UNITS|NUKES>", 1, start, C_MOD, NORM},
     {"starvation [<SECTS>|l <UNITS>|s <SHIPS>]", 0, starve, 0, NORM},
-    {"stop <TYPE> <SECTS|PLANES|SHIPS|UNITS>", 1, stop, C_MOD, NORM},
+    {"stockpile <STOCKPILE> <NUKES>", 0, stoc, C_MOD, NORM},
+    {"stop <TYPE> <SECTS|PLANES|SHIPS|UNITS|NUKES>", 1, stop, C_MOD, NORM},
     {"strength <SECTS>", 1, stre, C_MOD, NORM},
     {"supply <LAND UNITS>", 1, supp, C_MOD, NORM + CAP},
     {"survey <SELECTOR> <SECTS>", 0, surv, C_MOD, NORM},
@@ -275,11 +277,12 @@ struct cmndstr player_coms[] = {
      1, upgr, C_MOD, NORM + MONEY + CAP},
     {"version", 0, vers, 0, 0},
     {"wall [<message>]", 0, wall, 0, NORM},
-    {"wingadd <WING> <PLANES>", 1, wing, C_MOD, NORM},
+    {"wingadd <WING> <PLANES>", 0, wing, C_MOD, NORM},
     {"wipe <SECTS>", 1, wipe, C_MOD, NORM},
     {"wire [yes|no|<days>]", 0, rea, C_MOD, 0},
     {"work <LAND UNITS> <AMOUNT>", 1, work, C_MOD, NORM + MONEY + CAP},
     {"xdump [\"meta\"] <TYPE> [<RECORDS>]", 0, xdump, 0, 0},
     {"zdone <y|n|c>", 0, zdon, C_MOD, NORM},
+    {"__cmd \"added\" <NUM> <NUM> <NUM>", 0, testing_cmd, 0, TESTING},
     {NULL, 0, NULL, 0, 0}
 };