]> git.pond.sub.org Git - empserver/blobdiff - src/lib/player/empmod.c
Make market command unavailable to visitors, and set C_MOD flag
[empserver] / src / lib / player / empmod.c
index ff32fcaa96721b3285096fae95a35a210901d35f..0022ef906a8d4425d41072273955ed0e5e15487a 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
+ *  Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *                Ken Stevens, Steve McClure, Markus Armbruster
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  Empire is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  *  ---
  *
@@ -33,7 +32,7 @@
  *     Thomas Ruschak, 1992
  *     Ken Stevens, 1995
  *     Steve McClure, 1996-2000
- *     Markus Armbruster, 2004-2009
+ *     Markus Armbruster, 2004-2011
  */
 
 #include <config.h>
@@ -45,7 +44,7 @@
 struct cmndstr player_coms[] = {
 /*  command form                       cost    addr    permit */
     {"accept  [as-COUNTRY]", 0, acce, C_MOD, NORM},
-    {"add <NAT> <NAME> <REP> <STATUS> <c|w|i>", 0, add, C_MOD, GOD},
+    {"add <NAT> <NAME> <REP> <STATUS>", 0, add, C_MOD, GOD},
     {"announce", 0, tele, C_MOD, VIS},
     {"anti <SECT>", 3, anti, C_MOD, NORM + MONEY + CAP},
     {"apropos <topic>", 0, apro, 0, VIS},
@@ -71,9 +70,6 @@ struct cmndstr player_coms[] = {
     {"bye", 0, quit, 0, VIS},
     {"capital <SECT>", 0, capi, C_MOD, NORM},
     {"cargo <SHIPS>", 0, carg, 0, NORM},
-#ifdef CEDE_IS_ALLOWED
-    {"cede <SECTS|SHIPS> <COUNTRY> [se|sh]", 639, cede, C_MOD, NORM},
-#endif /* CEDE_IS_ALLOWED */
     {"census <SECTS>", 0, cens, 0, VIS},
     {"change <country|representative> <NAME>", 0, chan, C_MOD, VIS},
     {"coastwatch <SECTS>", 1, coas, C_MOD, NORM + CAP},
@@ -89,7 +85,7 @@ struct cmndstr player_coms[] = {
     {"deliver <COMM> <SECTS> [q|<THRESH>] [<DIR>]", 1, deli, C_MOD, NORM},
     {"demobilize <SECTS> <NUM> <active-reserve?>", 1, demo, C_MOD,
      NORM + MONEY + CAP},
-    {"designate <SECTS> <type> [sure?]", 1, desi, C_MOD, NORM},
+    {"designate <SECTS> <type>", 1, desi, C_MOD, NORM},
     {"disable", 0, disa, C_MOD, GOD},
     {"disarm <PLANE>", 2, disarm, C_MOD, NORM + MONEY + CAP},
     {"distribute <SECTS> <DISTSECT|.|h>", 1, dist, C_MOD, NORM},
@@ -101,7 +97,7 @@ struct cmndstr player_coms[] = {
      0, edit, C_MOD, GOD},
     {"enable", 0, enab, C_MOD, GOD},
     {"enlist <SECTS> <NUM>", 2, enli, C_MOD, NORM + MONEY + CAP},
-    {"execute <INPUT FILE>", 0, execute, 0, VIS + EXEC },
+    {"execute <INPUT FILE>", 0, execute, 0, VIS + EXEC},
     {"explore <c|m> <SECT> <NUM> <PATH|DESTINATION>",
      1, explore, C_MOD, NORM + MONEY + CAP},
     {"financial", 0, fina, 0, NORM},
@@ -141,7 +137,7 @@ struct cmndstr player_coms[] = {
      1, load, C_MOD, NORM + CAP},
     {"lookout <SHIPS>", 1, look, 0, NORM + CAP},
     {"lost", 0, lost, 0, NORM},
-    {"lradar <UNITS | SECTS>", 1, lrad, 0, NORM + CAP},
+    {"lradar <UNITS | SECTS>", 1, lrad, C_MOD, NORM + CAP},
     {"lretreat <UNITS|ARMY> <PATH> [i|h|b|c]",
      1, lretr, C_MOD, NORM + CAP},
     {"lstat <UNITS>", 0, lsta, C_MOD, NORM},
@@ -151,7 +147,7 @@ struct cmndstr player_coms[] = {
      1, lload, C_MOD, NORM + CAP},
     {"map <SECTS|SHIP> [s|l|n|p|*|h]", 0, map, C_MOD, VIS},
     {"march <UNITS> <PATH|DESTINATION>", 1, march, C_MOD, NORM + CAP},
-    {"market <COMM|\"all\">", 0, mark, 0, VIS},
+    {"market <COMM|\"all\">", 0, mark, C_MOD, NORM},
     {"mine <SHIPS>", 2, mine, C_MOD, NORM + MONEY + CAP},
     {"mission <TYPE> <PLANES|SHIPS|UNITS> <mission type> <op sect> [<radius>]",
      2, mission, C_MOD, NORM + CAP},
@@ -176,7 +172,7 @@ struct cmndstr player_coms[] = {
     {"origin <SECT|COUNTRY|~>", 1, orig, C_MOD, NORM},
     {"paradrop <cargo-PLANES> <fighter-PLANES> <ap-SECT> <PATH|DESTINATION>",
      3, para, C_MOD, NORM + MONEY + CAP},
-    {"path <SECT>", 0, path, 0, NORM},
+    {"path <SECT>", 0, path, C_MOD, NORM},
     {"payoff <SHIPS>", 0, payo, C_MOD, NORM},
     {"pbmap <SECTS|PLANE> [s|l|n|p|r|t|*|h]", 0, map, C_MOD, NORM},
     {"pboard <PLANES>", 3, pboa, C_MOD, NORM + MONEY + CAP},
@@ -192,7 +188,7 @@ struct cmndstr player_coms[] = {
     {"pstat <PLANES>", 0, pstat, 0, NORM},
     {"qorder <SHIPS>", 0, qorde, C_MOD, NORM + CAP},
     {"quit", 0, quit, 0, VIS},
-    {"radar <SHIPS | SECTS>", 1, rada, 0, NORM + CAP},
+    {"radar <SHIPS | SECTS>", 1, rada, C_MOD, NORM + CAP},
     {"range <PLANES> <range>", 1, range, C_MOD, NORM + CAP},
     {"read [yes|no|<CNUM/CNAME>]", 0, rea, C_MOD, VIS},
     {"realm <number> [<SECTS>]", 0, real, C_MOD, NORM},
@@ -208,17 +204,17 @@ struct cmndstr player_coms[] = {
     {"resource <SECTS>", 0, reso, 0, NORM},
     {"retreat <SHIPS|FLEET> <PATH> [i|t|s|h|b|d|u|c]",
      1, retr, C_MOD, NORM + CAP},
-    {"route <COMM> <SECTS>", 1, rout, 0, NORM},
+    {"route <COMM> <SECTS>", 1, rout, C_MOD, NORM},
     {"sabotage <UNITS>", 1, sabo, C_MOD, NORM + MONEY + CAP},
     {"sail <SHIPS> <PATH>", 1, sail, C_MOD, NORM + CAP},
     {"satellite <PLANE> [<se|sh|l> [?cond&cond&...]]",
-     1, sate, 0, NORM + MONEY + CAP},
+     1, sate, C_MOD, NORM + MONEY + CAP},
     {"sbmap <SECTS|SHIP> [s|l|n|p|r|t|*|h]", 0, map, C_MOD, NORM},
     {"scrap <s|p|l> <SHIPS|PLANES|UNITS>",
      2, scra, C_MOD, NORM + MONEY + CAP},
     {"scuttle <s|p|l> <SHIPS|PLANES|UNITS>", 5, scut, C_MOD, NORM + CAP},
     {"sdump <SHIPS> [<fields>]", 0, sdump, 0, NORM},
-    {"sect <SECTS>", 0, sct, 0, NORM},
+    {"sect <SECTS>", 0, sct, C_MOD, NORM},
     {"sell <COMM> <SECTS> <NUM> <NUM>", 1, sell, C_MOD, NORM + CAP},
     {"set <TYPE> <SHIPS|PLANES|UNITS|NUKES> <PRICE>",
      1, set, C_MOD, NORM + CAP},
@@ -245,7 +241,7 @@ struct cmndstr player_coms[] = {
     {"stop <TYPE> <SECTS|PLANES|SHIPS|UNITS>", 1, stop, C_MOD, NORM + CAP},
     {"strength <SECTS>", 1, stre, C_MOD, NORM},
     {"supply <LAND UNITS>", 1, supp, C_MOD, NORM + CAP},
-    {"survey <SELECTOR> <SECTS>", 0, surv, 0, NORM + CAP},
+    {"survey <SELECTOR> <SECTS>", 0, surv, C_MOD, NORM + CAP},
     {"swapsector <SECT> <SECT>", 0, swaps, C_MOD, GOD},
     {"sweep <sweep-PLANES> <fighter-PLANES> <ap-SECT> <PATH|DESTINATION>",
      3, reco, C_MOD, NORM + MONEY + CAP},