]> git.pond.sub.org Git - empserver/commitdiff
(hidd,peek): Rename hidden command to peek.
authorRon Koenderink <rkoenderink@yahoo.ca>
Wed, 1 Jun 2005 12:26:22 +0000 (12:26 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Wed, 1 Jun 2005 12:26:22 +0000 (12:26 +0000)
This prevents a conflict in the info files with
HIDDEN option.

include/prototypes.h
info/Commands/hidden.t [deleted file]
info/Commands/peek.t [new file with mode: 0644]
info/Commands/setsector.t
src/lib/commands/Makefile
src/lib/commands/hidd.c [deleted file]
src/lib/commands/peek.c [new file with mode: 0644]
src/lib/player/empmod.c

index b988d7f2489eb0c93f7e6d883d193c858c89a1a5..2cf822786da1f804322718a914e28413f1047c7d 100644 (file)
@@ -137,7 +137,6 @@ int give(void);
 int grin(void);
 int hard(void);
 int head(void);
-int hidd(void);
 int improve(void);
 int info(void);
 int land(void);
@@ -184,6 +183,7 @@ int path(void);
 int payo(void);
 int pboa(void);
 int pdump(void);
+int peek(void);
 int plan(void);
 int play(void);
 int powe(void);
diff --git a/info/Commands/hidden.t b/info/Commands/hidden.t
deleted file mode 100644 (file)
index 41edd3c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-.TH Command HIDDEN
-.NA hidden "Display some deity-only statistics for sectors"
-.LV Expert
-.SY "hidden <SECTS>"
-.SA "Deity"
diff --git a/info/Commands/peek.t b/info/Commands/peek.t
new file mode 100644 (file)
index 0000000..fb7ba77
--- /dev/null
@@ -0,0 +1,5 @@
+.TH Command PEEK
+.NA peek "Display some deity-only statistics for sectors"
+.LV Expert
+.SY "peek <SECTS>"
+.SA "Deity"
index 744fa7b5dce9d3938567a5f800f6cdbf32dfedbd..e8a35315cc45a48e93658a2735ffaf15afe37d57 100644 (file)
@@ -2,5 +2,5 @@
 .NA setsector "Change stats of a sector"
 .LV Expert
 .SY "setsector <TYPE> <SECTS> <NUM>"
-You can change anything that appears in dump or hidden (I think).
-.SA "give, setresource, edit, Deity"
+You can change anything that appears in dump or peek (I think).
+.SA "give, setresource, edit, dump, peek, Deity"
index 0205293ef042e682d56af8e4548b5093e6a954dc..15a6eee9eeaa3ea4a38e6d92316c95be08081520 100644 (file)
@@ -40,11 +40,11 @@ OBJS =  acce.o add.o anti.o arm.o army.o assa.o atta.o bdes.o best.o boar.o \
        coas.o coll.o comm.o cons.o conv.o coun.o cuto.o decl.o deli.o demo.o \
        desi.o disa.o dist.o drop.o dump.o echo.o edit.o enab.o enli.o \
        expl.o fina.o flash.o flee.o fly.o foll.o forc.o fort.o fuel.o give.o \
-       grin.o hard.o head.o hidd.o improve.o info.o land.o laun.o lboard.o \
-       ldump.o ledg.o leve.o load.o look.o lost.o lstat.o lten.o map.o \
-       marc.o mark.o mfir.o mine.o miss.o mobq.o mobu.o mora.o move.o \
-       name.o nati.o navi.o ndump.o new.o newe.o news.o nuke.o offe.o offs.o \
-       orde.o orig.o para.o path.o payo.o pboa.o pdump.o plan.o play.o \
+       grin.o hard.o head.o improve.o info.o land.o laun.o lboard.o ldump.o \
+       ledg.o leve.o load.o look.o lost.o lstat.o lten.o map.o marc.o mark.o \
+       mfir.o mine.o miss.o mobq.o mobu.o mora.o move.o name.o nati.o navi.o \
+       ndump.o new.o newe.o news.o nuke.o offe.o offs.o orde.o orig.o para.o \
+       path.o payo.o pboa.o peek.o pdump.o plan.o play.o \
        powe.o prod.o pstat.o rada.o rang.o rea.o real.o reco.o reje.o rela.o \
        repa.o repo.o rese.o reso.o retr.o rout.o sabo.o sail.o sate.o scra.o \
        scut.o sdump.o sect.o sell.o set.o setres.o setsect.o shar.o shark.o \
@@ -60,13 +60,13 @@ NTOBJS = acce.obj add.obj anti.obj arm.obj army.obj assa.obj atta.obj \
        deli.obj demo.obj desi.obj disa.obj dist.obj drop.obj \
        dump.obj echo.obj edit.obj enab.obj enli.obj expl.obj fina.obj \
        flash.obj flee.obj fly.obj foll.obj forc.obj fort.obj fuel.obj \
-       give.obj grin.obj hard.obj head.obj hidd.obj improve.obj info.obj \
+       give.obj grin.obj hard.obj head.obj improve.obj info.obj \
        land.obj laun.obj lboard.obj ldump.obj ledg.obj leve.obj load.obj \
        look.obj lost.obj lstat.obj lten.obj map.obj marc.obj mark.obj \
        mfir.obj mine.obj miss.obj mobq.obj mobu.obj mora.obj move.obj \
-       name.obj nati.obj navi.obj ndump.obj new.obj newe.obj \
-       news.obj nuke.obj offe.obj offs.obj orde.obj orig.obj para.obj \
-       path.obj payo.obj pboa.obj pdump.obj plan.obj play.obj powe.obj \
+       name.obj nati.obj navi.obj ndump.obj new.obj newe.obj news.obj \
+       nuke.obj offe.obj offs.obj orde.obj orig.obj para.obj path.obj \
+       payo.obj pboa.obj pdump.obj peek.obj plan.obj play.obj powe.obj \
        prod.obj pstat.obj rada.obj rang.obj rea.obj real.obj reco.obj \
        reje.obj rela.obj repa.obj repo.obj rese.obj reso.obj retr.obj \
        rout.obj sabo.obj sail.obj sate.obj scra.obj scut.obj sdump.obj \
diff --git a/src/lib/commands/hidd.c b/src/lib/commands/hidd.c
deleted file mode 100644 (file)
index f3a4c45..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
- *
- *  This program 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
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  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
- *
- *  ---
- *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
- *
- *  ---
- *
- *  hidd.c: Do a hidden values report (deity)
- * 
- *  Known contributors to this file:
- *     Jeff Wallace, 1989
- *     Pat Loney, 1998
- *     Steve McClure, 1998
- */
-
-#include "misc.h"
-#include "player.h"
-#include "sect.h"
-#include "xy.h"
-#include "nsc.h"
-#include "nat.h"
-#include "commands.h"
-
-int
-hidd(void)
-{
-    struct sctstr sect;
-    int nsect;
-    struct nstr_sect nstr;
-
-    if (!snxtsct(&nstr, player->argp[1]))
-       return RET_SYN;
-    prdate();
-    nsect = 0;
-    while (nxtsct(&nstr, &sect)) {
-       if (!player->owner)
-           continue;
-       if (nsect++ == 0) {
-           if (player->god)
-               pr("    ");
-           pr("HIDDEN VALUES     old        che-------  plague----\n");
-           if (player->god)
-               pr("own ");
-           pr("  sect        eff own  loyal cnum value  stage time mines\n");
-       }
-       if (player->god)
-           pr("%3d ", sect.sct_own);
-       prxy("%4d,%-4d", nstr.x, nstr.y, player->cnum);
-       pr(" %c  %3d%% %3d   %3d  %3d  %3d    %3d   %3d  %3d",
-          dchr[sect.sct_type].d_mnem, sect.sct_effic,
-          sect.sct_oldown, sect.sct_loyal,
-          sect.sct_che_target, sect.sct_che,
-          sect.sct_pstage, sect.sct_ptime, sect.sct_mines);
-       pr("\n");
-    }
-    if (nsect == 0) {
-       if (player->argp[1])
-           pr("%s: No sector(s)\n", player->argp[1]);
-       else
-           pr("%s: No sector(s)\n", "");
-       return RET_FAIL;
-    } else
-       pr("%d sector%s\n", nsect, splur(nsect));
-    return 0;
-}
diff --git a/src/lib/commands/peek.c b/src/lib/commands/peek.c
new file mode 100644 (file)
index 0000000..efaf74b
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ *  Empire - A multi-player, client/server Internet based war game.
+ *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *                           Ken Stevens, Steve McClure
+ *
+ *  This program 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
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  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
+ *
+ *  ---
+ *
+ *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
+ *  related information and legal notices. It is expected that any future
+ *  projects/authors will amend these files as needed.
+ *
+ *  ---
+ *
+ *  peek.c: Show hidden values report (deity)
+ * 
+ *  Known contributors to this file:
+ *     Jeff Wallace, 1989
+ *     Pat Loney, 1998
+ *     Steve McClure, 1998
+ */
+
+#include "misc.h"
+#include "player.h"
+#include "sect.h"
+#include "xy.h"
+#include "nsc.h"
+#include "nat.h"
+#include "commands.h"
+#include "version.h" /* need to OBSOLETE hidden command */
+
+int
+peek(void)
+{
+    struct sctstr sect;
+    int nsect;
+    struct nstr_sect nstr;
+
+#if EMP_VERS_MINOR == 2 && EMP_VERS_PATCH <= 22
+    /* 
+     * OBSOLETE
+     * Can be removed once hidden command is removed from empmod.c
+     */
+    if (player->argp[0][0] == 'h')
+       pr("The hidden command has been renamed to peek, use peek in the future\n");
+#endif
+    if (!snxtsct(&nstr, player->argp[1]))
+       return RET_SYN;
+    prdate();
+    nsect = 0;
+    while (nxtsct(&nstr, &sect)) {
+       if (!player->owner)
+           continue;
+       if (nsect++ == 0) {
+           if (player->god)
+               pr("    ");
+           pr("HIDDEN VALUES     old        che-------  plague----\n");
+           if (player->god)
+               pr("own ");
+           pr("  sect        eff own  loyal cnum value  stage time mines\n");
+       }
+       if (player->god)
+           pr("%3d ", sect.sct_own);
+       prxy("%4d,%-4d", nstr.x, nstr.y, player->cnum);
+       pr(" %c  %3d%% %3d   %3d  %3d  %3d    %3d   %3d  %3d",
+          dchr[sect.sct_type].d_mnem, sect.sct_effic,
+          sect.sct_oldown, sect.sct_loyal,
+          sect.sct_che_target, sect.sct_che,
+          sect.sct_pstage, sect.sct_ptime, sect.sct_mines);
+       pr("\n");
+    }
+    if (nsect == 0) {
+       if (player->argp[1])
+           pr("%s: No sector(s)\n", player->argp[1]);
+       else
+           pr("%s: No sector(s)\n", "");
+       return RET_FAIL;
+    } else
+       pr("%d sector%s\n", nsect, splur(nsect));
+    return 0;
+}
index d9e6bb58be94c3d71bf814432f999db54ae15005..019160f48be1b849b2263989599f0fd90f7f8f4f 100644 (file)
@@ -40,6 +40,8 @@
 #include "nat.h"
 #include "file.h"
 #include "commands.h"
+#include "version.h" /* need to OBSOLETE hidden command */
+
 
 struct cmndstr player_coms[] = {
 /*  command form                       cost    addr    permit */
@@ -118,7 +120,13 @@ struct cmndstr player_coms[] = {
     {"harden <PLANES> <NUM>", 2, hard, C_MOD, NORM + MONEY + CAP},
     {"help <topic>", 0, info, 0, VIS},
     {"headlines [days]", 0, head, C_MOD, VIS},
-    {"hidden <SECTS>", 0, hidd, 0, GOD},
+#if EMP_VERS_MINOR == 2 && EMP_VERS_PATCH <= 22
+    /* 
+     * OBSOLETE
+     * once hidden command is removed, also remove the hidden code in peek.c
+     */
+    {"hidden <SECTS>", 0, peek, 0, GOD},
+#endif
     {"improve <road|rail|defense> <SECTS> <NUM>", 1, improve, C_MOD,
      NORM + MONEY + CAP},
     {"info <topic>", 0, info, 0, VIS},
@@ -181,6 +189,7 @@ struct cmndstr player_coms[] = {
     {"pbmap <SECTS|UNIT> [s|l|p|r|t|*|h]", 0, map, C_MOD, NORM},
     {"pboard <PLANES>", 3, pboa, C_MOD, NORM + MONEY + CAP},
     {"pdump <PLANES> [<fields>]", 0, pdump, 0, NORM},
+    {"peek <SECTS>", 0, peek, 0, GOD},
     {"plane <SECTS>", 0, plan, 0, NORM},
     {"players", 0, play, 0, VIS},
     {"pmap <SECTS|UNIT> [s|l|p|*|h]", 0, map, C_MOD, NORM},