* Fixed bad merge (that's why sail was broken).

git-svn-id: file:///srv/svn/joey/bsdgames-trunk@5177 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
joey
2001-12-29 19:48:57 +00:00
parent b05333c9fe
commit 0a887df528
19 changed files with 420 additions and 440 deletions

17
NEWS
View File

@@ -11,6 +11,21 @@ changes in installation instructions. Packagers should also reread
the PACKAGING file each version (or do a diff between the old and new the PACKAGING file each version (or do a diff between the old and new
versions of the package and read that). versions of the package and read that).
Version 2.13 (2001-08-30)
============
* Warning now present in README about the inclusion of cryptographic
software (caesar and rot13).
* Various minor improvements and bugfixes, some from NetBSD, some from
OpenBSD, some from other contributors. Current with NetBSD CVS of
2001-08-29.
* Some fixes to avoid some warnings when compiling with current glibc
and GCC 3.
* May support GNU Hurd (untested).
Version 2.12 (2000-09-25) Version 2.12 (2000-09-25)
============ ============
@@ -346,7 +361,7 @@ Version 1.3.1beta (1997-05-01)
* Now works with libc 5 ;-). * Now works with libc 5 ;-).
* Debian patches from Joey Hess <joeyh@debian.org> mostly * Debian patches from Joey Hess <joeyh@master.debian.org> mostly
integrated up to Debian version 1.3-7. integrated up to Debian version 1.3-7.
* New ports of tetris and gomoku, thanks to David Frey * New ports of tetris and gomoku, thanks to David Frey

View File

@@ -1,4 +1,4 @@
/* $NetBSD: com2.c,v 1.21 2000/09/25 19:37:58 jsm Exp $ */ /* $NetBSD: com2.c,v 1.22 2001/06/02 17:30:28 christos Exp $ */
/* /*
* Copyright (c) 1983, 1993 * Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95"; static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95";
#else #else
__RCSID("$NetBSD: com2.c,v 1.21 2000/09/25 19:37:58 jsm Exp $"); __RCSID("$NetBSD: com2.c,v 1.22 2001/06/02 17:30:28 christos Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@@ -54,7 +54,7 @@ wearit()
while (wordnumber <= wordcount && (wordtype[wordnumber] == OBJECT || while (wordnumber <= wordcount && (wordtype[wordnumber] == OBJECT ||
wordtype[wordnumber] == NOUNS) && wordvalue[wordnumber] != DOOR) { wordtype[wordnumber] == NOUNS) && wordvalue[wordnumber] != DOOR) {
value = wordvalue[wordnumber]; value = wordvalue[wordnumber];
if (objsht[value] == NULL) if (value >= 0 && objsht[value] == NULL)
break; break;
switch (value) { switch (value) {

View File

@@ -1,4 +1,4 @@
.\" $NetBSD: bcd.6,v 1.11 1999/07/28 23:01:59 hubertf Exp $ .\" $NetBSD: bcd.6,v 1.12 2001/06/05 12:41:04 wiz Exp $
.\" .\"
.\" Copyright (c) 1988, 1991, 1993 .\" Copyright (c) 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@@ -34,7 +34,7 @@
.\" @(#)bcd.6 8.1 (Berkeley) 5/31/93 .\" @(#)bcd.6 8.1 (Berkeley) 5/31/93
.\" .\"
.Dd May 31, 1993 .Dd May 31, 1993
.Dt "BCD" 6 .Dt BCD 6
.Os .Os
.Sh NAME .Sh NAME
.Nm bcd , .Nm bcd ,
@@ -50,7 +50,7 @@
.Op Fl ds Ar string ... .Op Fl ds Ar string ...
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Nm "bcd" , .Nm bcd ,
.Nm ppt .Nm ppt
and and
.Nm morse .Nm morse

View File

@@ -1,3 +1,6 @@
# This file is read by configure and is used during the build of the
# Debian package.
# Don't run configure interactively. # Don't run configure interactively.
bsd_games_cfg_non_interactive=y bsd_games_cfg_non_interactive=y

2
configure vendored
View File

@@ -437,7 +437,7 @@ game_ask atc "Directory for atc static data" atc_dir "$sharedir/atc"
game_ask atc "Score file for atc" atc_scorefile "$varlibdir/atc_score" game_ask atc "Score file for atc" atc_scorefile "$varlibdir/atc_score"
game_ask battlestar "Score file for battlestar" battlestar_scorefile "$varlibdir/battlestar.log" game_ask battlestar "Score file for battlestar" battlestar_scorefile "$varlibdir/battlestar.log"
# Bog has some other configuration # Bog has some other configuration
game_ask boggle "Dictionary for boggle (CHECK ANSWER)" dictionary_src /usr/share/dict/american-english game_ask boggle "Dictionary for boggle (CHECK ANSWER)" dictionary_src /usr/share/dict/words
game_ask boggle "Directory for boggle static data" boggle_dir "$sharedir/boggle" game_ask boggle "Directory for boggle static data" boggle_dir "$sharedir/boggle"
game_ask canfield "Score file for canfield" canfield_scorefile "$varlibdir/cfscores" game_ask canfield "Score file for canfield" canfield_scorefile "$varlibdir/cfscores"
game_ask cribbage "File for cribbage instructions" cribbage_instrfile "$sharedir/cribbage.instr" game_ask cribbage "File for cribbage instructions" cribbage_instrfile "$sharedir/cribbage.instr"

6
debian/changelog vendored
View File

@@ -1,3 +1,9 @@
bsdgames (2.13-2) unstable; urgency=low
* Fixed bad merge (that's why sail was broken).
-- Joey Hess <joeyh@debian.org> Sat, 29 Dec 2001 13:37:00 -0500
bsdgames (2.13-1) unstable; urgency=low bsdgames (2.13-1) unstable; urgency=low
* New upstream release. * New upstream release.

View File

@@ -1,4 +1,4 @@
.\" $NetBSD: hunt.6,v 1.3 1997/10/10 16:32:30 lukem Exp $ .\" $NetBSD: hunt.6,v 1.4 2001/04/04 11:41:01 wiz Exp $
.\" .\"
.\" hunt .\" hunt
.\" Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold .\" Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
@@ -8,98 +8,105 @@
.\" All rights reserved. The Berkeley software License Agreement .\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution. .\" specifies the terms and conditions for redistribution.
.\" .\"
.TH HUNT 6 "21 August 1986" .Dd April 4, 2001
.UC 4 .Dt HUNT 6
.SH NAME .Sh NAME
hunt \- a multi-player multi-terminal game .Nm hunt
.SH SYNOPSIS .Nd a multi-player multi-terminal game
\fB@gamesdir@/hunt\fP [ \fB\-qmcsfbS\fP ] [ \fB\-n\fP name ] [ \fB\-t\fP team ] [ \fB\-p\fP port ] [ \fB\-w\fP message ] [ host ] .Sh SYNOPSIS
.SH DESCRIPTION .Nm
.Op Fl bcfmqSs
.Op Fl n Ar name
.Op Fl t Ar team
.Op Fl p Ar port
.Op Fl w Ar message
.Op Ar host
.Sh DESCRIPTION
The object of the game The object of the game
.I hunt .Nm
is to kill off the other players. is to kill off the other players.
There are no rooms, no treasures, and no monsters. There are no rooms, no treasures, and no monsters.
Instead, you wander around a maze, find grenades, trip mines, and shoot down Instead, you wander around a maze, find grenades, trip mines, and shoot down
walls and players. walls and players.
The more players you kill before you die, the better your score is. The more players you kill before you die, the better your score is.
If the If the
.B \-m .Fl m
flag is given, flag is given,
you enter the game as a monitor you enter the game as a monitor
(you can see the action but you cannot play). (you can see the action but you cannot play).
.PP .Pp
.I Hunt .Nm
normally looks for an active game on the local network; normally looks for an active game on the local network;
if none is found, it starts one up on the local host. if none is found, it starts one up on the local host.
The location of the game may be specified by giving the The location of the game may be specified by giving the
.I host .Ar host
argument. argument.
This presupposes that a hunt game is already running on that host, see This presupposes that a hunt game is already running on that host, see
.IR huntd (6) .Xr huntd 6
for details on how to setup a game on a specific host. for details on how to setup a game on a specific host.
If more than one game if found, If more than one game if found,
you may pick which game to play in. you may pick which game to play in.
.PP .Pp
If the If the
.B \-q .Fl q
flag is given, flag is given,
.I hunt .Nm
queries the local network (or specific host) queries the local network (or specific host)
and reports on all active games found. and reports on all active games found.
This is useful for shell startup scripts, \fIe.g.\fP csh's .login. This is useful for shell startup scripts, e.g.\&
.PP .Xr csh 1 Ns 's No .login .
.Pp
The player name may be specified on the command line by using the The player name may be specified on the command line by using the
.B \-n .Fl n
option. option.
.PP .Pp
The The
.BR \-c , .Fl c ,
.BR \-s , .Fl s ,
and and
.B \-f .Fl f
options are for entering the game cloaked, scanning, or flying respectively. options are for entering the game cloaked, scanning, or flying respectively.
.PP .Pp
The The
.B \-b .Fl b
option turns off beeping when you reach the typeahead limit. option turns off beeping when you reach the typeahead limit.
.PP .Pp
The The
.B \-t .Fl t
option aids team playing by making everyone else on one's team option aids team playing by making everyone else on one's team
appear as the team name. appear as the team name.
A team name is a single digit to avoid conflicting with other characters A team name is a single digit to avoid conflicting with other characters
used in the game. used in the game.
.PP .Pp
The The
.B \-p .Fl p Ar port
.I port
option allows the rendezvous port number to be set. option allows the rendezvous port number to be set.
This is a useful way for people playing on dialup lines to avoid playing This is a useful way for people playing on dialup lines to avoid playing
with people on 9600 baud terminals. with people on 9600 baud terminals.
.PP .Pp
The The
.B \-w .Fl w Ar message
.I message
option is the only way to send a message to everyone else's screen when option is the only way to send a message to everyone else's screen when
you start up. you start up.
It is most often used to say ``eat slime death - NickD's coming in''. It is most often used to say
.PP .Dq eat slime death - NickD's coming in .
.Pp
When you die and are asked if you wish to re-enter the game, When you die and are asked if you wish to re-enter the game,
there are other answers than just yes or no. there are other answers than just yes or no.
You can also reply with a You can also reply with a
.B w .Ic w
for write a message before continuing or for write a message before continuing or
.B o .Ic o
to change how you enter the game (cloaked, scanning, or flying). to change how you enter the game (cloaked, scanning, or flying).
.PP .Pp
To be notified automatically when a To be notified automatically when a
.I hunt .Nm
starts up, add your login to the starts up, add your login to the
.I hunt-players .Em hunt-players
mailing list (see mailing list (see
.IR huntd (6)). .Xr huntd 6 ) .
.SH "PLAYING HINTS" .Sh PLAYING HINTS
.I Hunt .Nm
only works on crt (vdt) terminals with at least 24 lines, 80 columns, and only works on crt (vdt) terminals with at least 24 lines, 80 columns, and
cursor addressing. cursor addressing.
The screen is divided in to 3 areas. The screen is divided in to 3 areas.
@@ -108,273 +115,288 @@ It shows damage sustained,
charges remaining, charges remaining,
who's in the game, who's in the game,
who's scanning (the who's scanning (the
.B ``*'' .Dq *
in front of the name), in front of the name),
who's cloaked (the who's cloaked (the
.B ``+'' .Dq +
in front of the name), in front of the name),
and other players' scores. and other players' scores.
The rest of the screen is taken up by your map of the maze. The rest of the screen is taken up by your map of the maze.
The 24th line The 24th line
is used for longer messages that don't fit in the status area. is used for longer messages that don't fit in the status area.
.PP .Pp
.I Hunt .Nm
uses the same keys to move as uses the same keys to move as
.IR vi (1) .Xr vi 1
does, does, i.e.,
.IR i.e. , .Ic h ,
.BR h , .Ic j ,
.BR j , .Ic k ,
.BR k ,
and and
.B l .Ic l
for left, down, up, right respectively. for left, down, up, right respectively.
To change which direction you're facing in the maze, To change which direction you're facing in the maze,
use the upper case version of the movement key (\c use the upper case version of the movement key (i.e.,
.IR i.e. , .Ic HJKL ) .
.BR HJKL ).
You can only fire or throw things in the direction you're facing. You can only fire or throw things in the direction you're facing.
.TP .Bl -tag -width xxxxxxx
Other commands are: Other commands are:
.sp .It Ic f No or Ic 1
.nf Fire a bullet (Takes 1 charge)
.ta .It Ic g No or Ic 2
.ta \w'>\|<\|^\|v\ \ 'u Throw grenade (Takes 9 charges)
f or 1 \- Fire a bullet (Takes 1 charge) .It Ic F No or Ic 3
g or 2 \- Throw grenade (Takes 9 charges) Throw satchel charge (Takes 25 charges)
F or 3 \- Throw satchel charge (Takes 25 charges) .It Ic G No or Ic 4
G or 4 \- Throw bomb (Takes 49 charges) Throw bomb (Takes 49 charges)
5 \- Throw big bomb (Takes 81 charges) .It Ic 5
6 \- Throw even bigger bomb (Takes 121 charges) Throw big bomb (Takes 81 charges)
7 \- Throw even more big bomb (Takes 169 charges) .It Ic 6
8 \- Throw even more bigger bomb (Takes 225 charges) Throw even bigger bomb (Takes 121 charges)
9 \- Throw very big bomb (Takes 289 charges) .It Ic 7
0 \- Throw very, very big bomb (Takes 361 charges) Throw even more big bomb (Takes 169 charges)
@ \- Throw biggest bomb (Takes 441 charges) .It Ic 8
o \- Throw small slime (Takes 5 charges) Throw even more bigger bomb (Takes 225 charges)
O \- Throw big slime (Takes 10 charges) .It Ic 9
p \- Throw bigger slime (Takes 15 charges) Throw very big bomb (Takes 289 charges)
P \- Throw biggest slime (Takes 20 charges) .It Ic 0
s \- Scan (show where other players are) (Takes 1 charge) Throw very, very big bomb (Takes 361 charges)
c \- Cloak (hide from scanners) (Takes 1 charge) .It Ic @
Throw biggest bomb (Takes 441 charges)
^L \- Redraw screen .It Ic o
q \- Quit Throw small slime (Takes 5 charges)
.fi .It Ic O
.TP Throw big slime (Takes 10 charges)
.It Ic p
Throw bigger slime (Takes 15 charges)
.It Ic P
Throw biggest slime (Takes 20 charges)
.It Ic s
Scan (show where other players are) (Takes 1 charge)
.It Ic c
Cloak (hide from scanners) (Takes 1 charge)
.It Ic ^L
Redraw screen
.It Ic q
Quit
.El
.Pp
The symbols on the screen are: The symbols on the screen are:
.sp .Bl -tag -width xxxxx -compact -offset indent
.nf .It -|+
.ta walls
.ta \w'>\|<\|^\|v\ \ 'u .It /\e
\-\||\|+ \- walls diagonal (deflecting) walls
/\|\\ \- diagonal (deflecting) walls .It #
# \- doors (dispersion walls) doors (dispersion walls)
; \- small mine .It ;
g \- large mine small mine
: \- bullet .It g
o \- grenade large mine
O \- satchel charge .It :
@ \- bomb bullet
s \- small slime .It o
$ \- big slime grenade
>\|<\|^\|v \- you facing right, left, up, or down .It O
}\|{\|i\|! \- other players facing right, left, up, or down satchel charge
\(** \- explosion .It @
.ne 3 bomb
.cs R 24 .It s
.cs I 24 small slime
\fR\\|/\fP .It $
.cs R big slime
\fI\-\(**\-\fP \- grenade and large mine explosion .It ><^v
.fl you facing right, left, up, or down
.cs R 24 .It }{i!
\fR/|\\\fP other players facing right, left, up, or down
.cs R .It *
.cs I explosion
.fi .It \e|/
.LP .It -*-
grenade and large mine explosion
.It /|\e
.El
.Pp
Other helpful hints: Other helpful hints:
.sp .Bl -bullet
.ie n .ds b [] .It
.el .ds b \(bu
.ta
.ta \w'\*b\ \|'u
.nr In \n(.i
.de MP
.br
.in \n(Inu+\w'\*b\ \|'u
.ti \n(Inu
\*b \c
..
.MP
You can only fire in the direction you are facing. You can only fire in the direction you are facing.
.MP .It
You can only fire three shots in a row, then the gun must cool off. You can only fire three shots in a row, then the gun must cool off.
.MP .It
Shots move 5 times faster than you do. Shots move 5 times faster than you do.
.MP .It
To stab someone, To stab someone,
you face that player and move at them. you face that player and move at them.
.MP .It
Stabbing does 2 points worth of damage and shooting does 5 points. Stabbing does 2 points worth of damage and shooting does 5 points.
.MP .It
Slime does 5 points of damage each time it hits. Slime does 5 points of damage each time it hits.
.MP .It
You start with 15 charges and get 5 more every time a player enters You start with 15 charges and get 5 more every time a player enters
or re-enters. or re-enters.
.MP .It
Grenade explosions cover a 3 by 3 area, each larger bomb cover a Grenade explosions cover a 3 by 3 area, each larger bomb cover a
correspondingly larger area (ranging from 5 by 5 to 21 by 21). correspondingly larger area (ranging from 5 by 5 to 21 by 21).
All explosions are centered around the square the shot hits and All explosions are centered around the square the shot hits and
do the most damage in the center. do the most damage in the center.
.MP .It
Slime affects all squares it oozes over. Slime affects all squares it oozes over.
The number of squares is equal to the number of charges used. The number of squares is equal to the number of charges used.
.MP .It
One small mine and one large mine is placed in the maze for every new player. One small mine and one large mine is placed in the maze for every new player.
A mine has a 2% probability of tripping when you walk forward on to it; A mine has a 2% probability of tripping when you walk forward on to it;
50% when going sideways; 50% when going sideways;
95% when backing up. 95% when backing up.
Tripping a mine costs you 5 points or 10 points respectively. Tripping a mine costs you 5 points or 10 points respectively.
Defusing a mine is worth 1 charge or 9 charges respectively. Defusing a mine is worth 1 charge or 9 charges respectively.
.MP .It
You cannot see behind you. You cannot see behind you.
.MP .It
Cloaking consumes 1 ammo charge per 20 of your moves. Cloaking consumes 1 ammo charge per 20 of your moves.
.MP .It
Scanning consumes 1 ammo charge per (20 \(mu the number of players) Scanning consumes 1 ammo charge per (20 \(mu the number of players)
of other player moves. of other player moves.
.MP .It
Turning on cloaking turns off scanning \(em turning on scanning turns off Turning on cloaking turns off scanning \(em turning on scanning turns off
cloaking. cloaking.
.MP .It
When you kill someone, When you kill someone,
you get 2 more damage capacity points and 2 damage points get taken away. you get 2 more damage capacity points and 2 damage points get taken away.
.MP .It
Maximum typeahead is 5 characters. Maximum typeahead is 5 characters.
.MP .It
A shot destroys normal (\c A shot destroys normal (i.e., non-diagonal, non-door) walls.
.IR i.e., .It
non-diagonal, non-door) walls.
.MP
Diagonal walls deflect shots and change orientation. Diagonal walls deflect shots and change orientation.
.MP .It
Doors disperse shots in random directions (up, down, left, right). Doors disperse shots in random directions (up, down, left, right).
.MP .It
Diagonal walls and doors cannot be destroyed by direct shots but may Diagonal walls and doors cannot be destroyed by direct shots but may
be destroyed by an adjacent grenade explosion. be destroyed by an adjacent grenade explosion.
.MP .It
Slime goes around walls, not through them. Slime goes around walls, not through them.
.MP .It
Walls regenerate, reappearing in the order they were destroyed. Walls regenerate, reappearing in the order they were destroyed.
One percent of the regenerated walls will be diagonal walls or doors. One percent of the regenerated walls will be diagonal walls or doors.
When a wall is generated directly beneath a player, he is thrown in When a wall is generated directly beneath a player, he is thrown in
a random direction for a random period of time. When he lands, he a random direction for a random period of time. When he lands, he
sustains damage (up to 20 percent of the amount of damage already sustains damage (up to 20 percent of the amount of damage already
sustained); sustained); i.e.,
.IR i.e. ,
the less damage he had, the more nimble he is and the less damage he had, the more nimble he is and
therefore less likely to hurt himself on landing. therefore less likely to hurt himself on landing.
.\"MP .\"MP
.\"There is a volcano close to the center of the maze which goes off .\"There is a volcano close to the center of the maze which goes off
.\"close to every 30 deaths. .\"close to every 30 deaths.
.MP .It
Every 30 deaths or so, a Every 30 deaths or so, a
.B ``?'' .Dq ?
will appear. will appear.
It is a wandering bomb which will explode when it hits someone, or It is a wandering bomb which will explode when it hits someone, or
when it is slimed. when it is slimed.
.MP .It
If no one moves, everything stands still. If no one moves, everything stands still.
.MP .It
The environment variable The environment variable
.B HUNT .Ev HUNT
is checked to get the player name. is checked to get the player name.
If you don't have this variable set, If you don't have this variable set,
.I hunt .Nm
will ask you what name you want to play under. will ask you what name you want to play under.
If you wish to set other options than just your name, If you wish to set other options than just your name,
you can enumerate the options as follows: you can enumerate the options as follows:
.br .Dl setenv HUNT "name=Sneaky,team=1,cloak,mapkey=zoFfGg1f2g3F4G"
.ti +1i
setenv HUNT "name=Sneaky,team=1,cloak,mapkey=zoFfGg1f2g3F4G"
.br
sets the player name to Sneaky, sets the player name to Sneaky,
sets the team to one, sets the team to one,
sets the enter game attribute to cloaked, sets the enter game attribute to cloaked,
and the maps \fBz\fP to \fBo\fP, \fBF\fP to \fBf\fP, \fBG\fP to \fBg\fP, and the maps
\fB1\fP to \fBf\fP, .Ic z
\fB2\fP to \fBg\fP, \fB3\fP to \fBF\fP, and \fB4\fP to \fBG\fP. to
The \fImapkey\fP option must be last. .Ic o , F
Other options are: scan, fly, nobeep, port=string, host=string, to
and message=string \(em which correspond to the command line options. .Ic f , G
to
.Ic g , 1
to
.Ic f , 2
to
.Ic g , 3
to
.Ic F ,
and
.Ic 4
to
.Ic G .
The
.Ar mapkey
option must be last.
Other options are:
.Ar scan , fly , nobeep , port=string , host=string ,
and
.Ar message=string
\(em which correspond to the command line options.
String options cannot contain commas since commas String options cannot contain commas since commas
are used to separate options. are used to separate options.
.MP .It
It's a boring game if you're the only one playing. It's a boring game if you're the only one playing.
.PP .El
.Pp
Your score is the decayed average of the ratio of number of kills to number Your score is the decayed average of the ratio of number of kills to number
of times you entered the game and is only kept for the duration of times you entered the game and is only kept for the duration
of a single session of \fIhunt\fP. of a single session of
.PP .Nm .
.I Hunt .Pp
.Nm
normally drives up the load average to be approximately normally drives up the load average to be approximately
(number_of_players + 0.5) greater than it would be without a (number_of_players + 0.5) greater than it would be without a
.I hunt .Nm
game executing. game executing.
.SH STATISTICS .Sh STATISTICS
The The
.B \-S .Fl S
option fetches the current game statistics. option fetches the current game statistics.
The meaning of the column headings are as follows: The meaning of the column headings are as follows:
.I score .Bl -tag -width ducked
\(em the player's last score; .It score
.I ducked the player's last score
\(em .It ducked
how many shots a player ducked; how many shots a player ducked
.I absorb .It absorb
\(em how many shots a player absorbed; how many shots a player absorbed
.I faced .It faced
\(em how many shots were fired at player's face; how many shots were fired at player's face
.I shot .It shot
\(em how many shots were fired at player; how many shots were fired at player
.I robbed .It robbed
\(em how many of player's shots were absorbed; how many of player's shots were absorbed
.I missed .It missed
\(em how many of player's shots were ducked; how many of player's shots were ducked
.I slimeK .It slimeK
\(em how many slime kills player had; how many slime kills player had
.I enemy .It enemy
\(em how many enemies were killed; how many enemies were killed
.I friend .tI friend
\(em how many friends were killed (self and same team); how many friends were killed (self and same team)
.I deaths .It deaths
\(em how many times player died; how many times player died
.I still .It still
\(em how many times player died without typing in any commands; how many times player died without typing in any commands
.I saved .It saved
\(em how many times a shot/bomb would have killed player if he hadn't how many times a shot/bomb would have killed player if he hadn't
ducked or absorbed it. ducked or absorbed it.
.SH FILES .El
.nf .Sh SEE ALSO
.ta .Xr huntd 6
.ta \w'@sbindir@/huntd\ \ \ 'u .Sh AUTHORS
@sbindir@/huntd game coordinator
.DT
.fi
.SH "SEE ALSO"
huntd(6)
.SH AUTHORS
Conrad Huang, Ken Arnold, and Greg Couch; Conrad Huang, Ken Arnold, and Greg Couch;
.br .br
University of California, San Francisco, Computer Graphics Lab University of California, San Francisco, Computer Graphics Lab
.SH ACKNOWLEDGEMENTS .Sh ACKNOWLEDGEMENTS
We thank Don Kneller, We thank Don Kneller,
John Thomason, Eric Pettersen, Mark Day, John Thomason, Eric Pettersen, Mark Day,
and Scott Weiner for providing and Scott Weiner for providing
endless hours of play-testing to improve the character of the game. endless hours of play-testing to improve the character of the game.
We hope their significant others will forgive them; We hope their significant others will forgive them;
we certainly don't. we certainly don't.
.SH BUGS .Sh BUGS
To keep up the pace, not everything is as realistic as possible. To keep up the pace, not everything is as realistic as possible.

View File

@@ -1,4 +1,4 @@
/* $NetBSD: hunt.c,v 1.11 2000/04/14 05:58:03 simonb Exp $ */ /* $NetBSD: hunt.c,v 1.12 2001/02/05 00:40:45 christos Exp $ */
/* /*
* Hunt * Hunt
* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
@@ -7,7 +7,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: hunt.c,v 1.11 2000/04/14 05:58:03 simonb Exp $"); __RCSID("$NetBSD: hunt.c,v 1.12 2001/02/05 00:40:45 christos Exp $");
#endif /* not lint */ #endif /* not lint */
# include <sys/param.h> # include <sys/param.h>
@@ -52,6 +52,10 @@ static struct termios saved_tty;
extern int _putchar(); extern int _putchar();
#endif #endif
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 256
#endif
FLAG Last_player = FALSE; FLAG Last_player = FALSE;
# ifdef MONITOR # ifdef MONITOR
FLAG Am_monitor = FALSE; FLAG Am_monitor = FALSE;
@@ -94,6 +98,7 @@ int main __P((int, char *[]));
SOCKET *list_drivers __P((void)); SOCKET *list_drivers __P((void));
# endif # endif
extern int Otto_mode;
/* /*
* main: * main:
* Main program for local process * Main program for local process
@@ -105,7 +110,6 @@ main(ac, av)
{ {
char *term; char *term;
int c; int c;
extern int Otto_mode;
long enter_status; long enter_status;
/* Revoke setgid privileges */ /* Revoke setgid privileges */
@@ -393,11 +397,7 @@ list_drivers()
static SOCKET test; static SOCKET test;
int test_socket; int test_socket;
int namelen; int namelen;
# ifdef MAXHOSTNAMELEN
char local_name[MAXHOSTNAMELEN + 1]; char local_name[MAXHOSTNAMELEN + 1];
# else
char local_name[] = "127.0.0.1";
# endif
static int initial = TRUE; static int initial = TRUE;
static struct in_addr local_address; static struct in_addr local_address;
struct hostent *hp; struct hostent *hp;
@@ -418,13 +418,11 @@ list_drivers()
# ifndef BROADCAST # ifndef BROADCAST
sethostent(1); /* don't bother to close host file */ sethostent(1); /* don't bother to close host file */
# endif # endif
# ifdef MAXHOSTNAMELEN
if (gethostname(local_name, sizeof local_name) < 0) { if (gethostname(local_name, sizeof local_name) < 0) {
leave(1, "Sorry, I have no name."); leave(1, "Sorry, I have no name.");
/* NOTREACHED */ /* NOTREACHED */
} }
local_name[sizeof(local_name) - 1] = '\0'; local_name[sizeof(local_name) - 1] = '\0';
# endif
if ((hp = gethostbyname(local_name)) == NULL) { if ((hp = gethostbyname(local_name)) == NULL) {
leave(1, "Can't find myself."); leave(1, "Can't find myself.");
/* NOTREACHED */ /* NOTREACHED */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: get_names.c,v 1.4 2000/07/03 03:57:41 matt Exp $ */ /* $NetBSD: get_names.c,v 1.6 2001/02/05 00:42:15 christos Exp $ */
/* /*
* Copyright (c) 1983 Regents of the University of California. * Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement * All rights reserved. The Berkeley software License Agreement
@@ -7,7 +7,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: get_names.c,v 1.4 2000/07/03 03:57:41 matt Exp $"); __RCSID("$NetBSD: get_names.c,v 1.6 2001/02/05 00:42:15 christos Exp $");
#endif /* not lint */ #endif /* not lint */
#include "bsd.h" #include "bsd.h"
@@ -23,10 +23,9 @@ __RCSID("$NetBSD: get_names.c,v 1.4 2000/07/03 03:57:41 matt Exp $");
# include "hunt.h" # include "hunt.h"
# include "talk_ctl.h" # include "talk_ctl.h"
extern CTL_MSG msg; #ifndef MAXHOSTNAMELEN
/* according to SUSv2, hostnames can't be longer then 256 characters */
#define MAXHOSTNAMELEN 256 #define MAXHOSTNAMELEN 256
#endif
static char hostname[MAXHOSTNAMELEN + 1]; static char hostname[MAXHOSTNAMELEN + 1];
char *my_machine_name; char *my_machine_name;
@@ -62,8 +61,13 @@ get_local_name(my_name)
/* look up the address of the local host */ /* look up the address of the local host */
hp = gethostbyname(my_machine_name); hp = gethostbyname(my_machine_name);
if (hp == (struct hostent *) 0) { if (hp == (struct hostent *) 0) {
printf("This machine doesn't exist. Boy, am I confused!\n"); # ifdef LOG
exit(-1); syslog(LOG_ERR,
"This machine doesn't exist. Boy, am I confused!");
# else
perror("This machine doesn't exist. Boy, am I confused!");
# endif
exit(1);
} }
memcpy(&my_machine_addr, hp->h_addr, hp->h_length); memcpy(&my_machine_addr, hp->h_addr, hp->h_length);
/* find the daemon portal */ /* find the daemon portal */
@@ -78,7 +82,7 @@ get_local_name(my_name)
# else # else
perror("This machine doesn't support talk"); perror("This machine doesn't support talk");
# endif # endif
exit(-1); exit(1);
} }
daemon_port = sp->s_port; daemon_port = sp->s_port;
} }

View File

@@ -6,3 +6,12 @@ a.out
phantasia phantasia
setup setup
pathnames.h pathnames.h
gold
lastdead
mess
monsters
motd
void
scoreboard
characs
scorefiles.stamp

View File

@@ -1,6 +1,6 @@
# Makefrag - makefile fragment for phantasia # Makefrag - makefile fragment for phantasia
# #
# Copyright (c) 1997, 1998 Joseph Samuel Myers. # Copyright (c) 1997, 1998, 1999, 2001 Joseph Samuel Myers.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -27,16 +27,25 @@
# SUCH DAMAGE. # SUCH DAMAGE.
phantasia_DIRS := $(GAMESDIR) $(MAN6DIR) $(PHANTASIA_DIR) phantasia_DIRS := $(GAMESDIR) $(MAN6DIR) $(PHANTASIA_DIR)
phantasia_VFILES := gold lastdead mess monsters motd scoreboard void phantasia_VFILES1 := gold lastdead mess monsters motd void
phantasia_DEFS := -D_GNU_SOURCE phantasia_VFILES2 := scoreboard characs
phantasia_CLEANFILES := $(phantasia_VFILES1) $(phantasia_VFILES2) scorefiles.stamp
phantasia_all: phantasia/phantasia phantasia/setup phantasia/monsters.asc phantasia/phantasia.6 phantasia_all: phantasia/phantasia phantasia/phantasia.6 phantasia/scorefiles.stamp
phantasia/scorefiles.stamp: phantasia/setup phantasia/monsters.asc
cd phantasia && ./setup -m monsters.asc
touch phantasia/scorefiles.stamp
phantasia_install: phantasia_all phantasia_install: phantasia_all
$(INSTALL_SCORE_GAME) phantasia/phantasia $(INSTALL_PREFIX)$(GAMESDIR)/phantasia $(INSTALL_SCORE_GAME) phantasia/phantasia $(INSTALL_PREFIX)$(GAMESDIR)/phantasia
$(HIDE_GAME) phantasia $(HIDE_GAME) phantasia
DESTDIR=$(INSTALL_PREFIX) phantasia/setup -m phantasia/monsters.asc (set -e; for f in $(phantasia_VFILES1); do \
(set -e; for f in $(phantasia_VFILES); do $(INSTALL_SCORE_FILE) \ cp phantasia/$$f $(INSTALL_PREFIX)$(PHANTASIA_DIR)/$$f; \
$(PHANTASIA_DIR)/$$f; done; \ $(INSTALL_SCORE_FILE) $(PHANTASIA_DIR)/$$f; done)
(set -e; for f in $(phantasia_VFILES2); do \
if [ ! -e $(PHANTASIA_DIR)/$$f ]; then \
cp phantasia/$$f $(INSTALL_PREFIX)$(PHANTASIA_DIR)/$$f; fi; done; \
$(INSTALL_SCORE_FILE) $(PHANTASIA_DIR)/scoreboard; \
$(INSTALL_SCORE_FILE) -p $(PHANTASIA_DIR)/characs) $(INSTALL_SCORE_FILE) -p $(PHANTASIA_DIR)/characs)
$(INSTALL_MANUAL) phantasia/phantasia.6 $(INSTALL_MANUAL) phantasia/phantasia.6

View File

@@ -1,9 +1,8 @@
/* $NetBSD: setup.c,v 1.10 1999/09/19 18:14:52 jsm Exp $ */ /* $NetBSD: setup.c,v 1.11 2001/03/27 02:23:28 simonb Exp $ */
/* /*
* setup.c - set up all files for Phantasia * setup.c - set up all files for Phantasia
*/ */
#include <stdio.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
@@ -64,16 +63,12 @@ main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
{ {
register const char *const *filename; /* for pointing to file names */ const char *const *filename; /* for pointing to file names */
register int fd; /* file descriptor */ int fd; /* file descriptor */
FILE *fp; /* for opening files */ FILE *fp; /* for opening files */
struct stat fbuf; /* for getting files statistics */ struct stat fbuf; /* for getting files statistics */
int ch; int ch;
#if defined(__GLIBC__) char *path;
char *path, *prefix;
#else
char path[MAXPATHLEN], *prefix;
#endif
while ((ch = getopt(argc, argv, "m:")) != -1) while ((ch = getopt(argc, argv, "m:")) != -1)
switch(ch) { switch(ch) {
@@ -91,39 +86,15 @@ main(argc, argv)
umask(0117); /* only owner can read/write created files */ umask(0117); /* only owner can read/write created files */
prefix = getenv("DESTDIR");
/* try to create data files */ /* try to create data files */
filename = &files[0]; filename = &files[0];
while (*filename != NULL) while (*filename != NULL)
/* create each file */ /* create each file */
{ {
#if defined(__GLIBC__) path = strrchr(*filename, '/') + 1;
path = NULL;
asprintf(&path, "%s%s", prefix?prefix:"", *filename);
if (!path)
Error ("Not enough memory to store filename.", "");
/*NOTREACHED*/
#else
snprintf(path, sizeof(path), "%s%s", prefix?prefix:"", *filename);
#endif
if (stat(path, &fbuf) == 0) if (stat(path, &fbuf) == 0)
/* file exists; remove it */ /* file exists; remove it */
{ {
if (!strcmp(*filename, _PATH_PEOPLE))
/* do not reset character file if it already exists */
{
++filename;
continue;
}
if (!strcmp(*filename, _PATH_SCORE))
/* do not reset score file if it already exists */
{
++filename;
continue;
}
if (unlink(path) < 0) if (unlink(path) < 0)
Error("Cannot unlink %s.\n", path); Error("Cannot unlink %s.\n", path);
/*NOTREACHED*/ /*NOTREACHED*/
@@ -136,24 +107,13 @@ main(argc, argv)
close(fd); /* close newly created file */ close(fd); /* close newly created file */
++filename; /* process next file */ ++filename; /* process next file */
#if defined(__GLIBC__)
free (path);
#endif
} }
/* put holy grail info into energy void file */ /* put holy grail info into energy void file */
Enrgyvoid.ev_active = TRUE; Enrgyvoid.ev_active = TRUE;
Enrgyvoid.ev_x = ROLL(-1.0e6, 2.0e6); Enrgyvoid.ev_x = ROLL(-1.0e6, 2.0e6);
Enrgyvoid.ev_y = ROLL(-1.0e6, 2.0e6); Enrgyvoid.ev_y = ROLL(-1.0e6, 2.0e6);
#if defined(__GLIBC__) path = strrchr(_PATH_VOID, '/') + 1;
path = NULL;
asprintf (&path, "%s%s", prefix?prefix:"", _PATH_VOID);
if (!path)
Error ("Not enough memory to store filename.", "");
/*NOTREACHED*/
#else
snprintf(path, sizeof(path), "%s%s", prefix?prefix:"", _PATH_VOID);
#endif
if ((fp = fopen(path, "w")) == NULL) if ((fp = fopen(path, "w")) == NULL)
Error("Cannot update %s.\n", path); Error("Cannot update %s.\n", path);
else else
@@ -164,20 +124,9 @@ main(argc, argv)
Error("Writing %s.\n", path); Error("Writing %s.\n", path);
fclose(fp); fclose(fp);
} }
#if defined(__GLIBC__)
free (path);
#endif
/* create binary monster data base */ /* create binary monster data base */
#if defined(__GLIBC__) path = strrchr(_PATH_MONST, '/') + 1;
path = NULL;
asprintf (&path, "%s%s", prefix?prefix:"", _PATH_MONST);
if (!path)
Error ("Not enough memory to store filename.", "");
/*NOTREACHED*/
#else
snprintf(path, sizeof(path), "%s%s", prefix?prefix:"", _PATH_MONST);
#endif
if ((Monstfp = fopen(path, "w")) == NULL) if ((Monstfp = fopen(path, "w")) == NULL)
Error("Cannot update %s.\n", path); Error("Cannot update %s.\n", path);
else else
@@ -215,24 +164,13 @@ main(argc, argv)
fclose(Monstfp); fclose(Monstfp);
} }
} }
#if defined(__GLIBC__)
free (path);
#endif
#ifdef MAKE_INSTALLS_THIS_AND_DOESNT_WANT_TO_HEAR_ABOUT_IT #ifdef MAKE_INSTALLS_THIS_AND_DOESNT_WANT_TO_HEAR_ABOUT_IT
/* write to motd file */ /* write to motd file */
printf("One line 'motd' ? "); printf("One line 'motd' ? ");
if (fgets(Databuf, SZ_DATABUF, stdin) == NULL) if (fgets(Databuf, SZ_DATABUF, stdin) == NULL)
Databuf[0] = '\0'; Databuf[0] = '\0';
#if defined(__GLIBC__) path = strrchr(_PATH_MOTD, '/') + 1;
path = NULL;
asprintf (&path, "%s%s", prefix?prefix:"", _PATH_MOTD);
if (!path)
Error ("Not enough memory to store filename.", "");
/*NOTREACHED*/
#else
snprintf(path, sizeof(path), "%s%s", prefix?prefix:"", _PATH_MOTD);
#endif
if ((fp = fopen(path, "w")) == NULL) if ((fp = fopen(path, "w")) == NULL)
Error("Cannot update %s.\n", path); Error("Cannot update %s.\n", path);
else else
@@ -240,9 +178,6 @@ main(argc, argv)
fwrite(Databuf, sizeof(char), strlen(Databuf), fp); fwrite(Databuf, sizeof(char), strlen(Databuf), fp);
fclose(fp); fclose(fp);
} }
#if defined(__GLIBC__)
free (path);
#endif
/* report compile-time options */ /* report compile-time options */
printf("Compiled options:\n\n"); printf("Compiled options:\n\n");

View File

@@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.16 2000/05/08 07:56:05 mycroft Exp $ */ /* $NetBSD: main.c,v 1.17 2001/02/05 01:02:45 christos Exp $ */
/* /*
* Copyright (c) 1980, 1993 * Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0 #if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: main.c,v 1.16 2000/05/08 07:56:05 mycroft Exp $"); __RCSID("$NetBSD: main.c,v 1.17 2001/02/05 01:02:45 christos Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@@ -51,6 +51,9 @@ __RCSID("$NetBSD: main.c,v 1.16 2000/05/08 07:56:05 mycroft Exp $");
int main __P((int, char **)); int main __P((int, char **));
extern const char *Scorefile;
extern int Max_per_uid;
int int
main(ac, av) main(ac, av)
int ac; int ac;
@@ -59,8 +62,6 @@ main(ac, av)
const char *sp; const char *sp;
bool bad_arg; bool bad_arg;
bool show_only; bool show_only;
extern const char *Scorefile;
extern int Max_per_uid;
int score_wfd; /* high score writable file descriptor */ int score_wfd; /* high score writable file descriptor */
int score_err = 0; /* hold errno from score file open */ int score_err = 0; /* hold errno from score file open */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: sync.c,v 1.14 2000/02/09 22:27:56 jsm Exp $ */ /* $NetBSD: sync.c,v 1.20 2001/02/05 01:10:11 christos Exp $ */
/* /*
* Copyright (c) 1983, 1993 * Copyright (c) 1983, 1993
@@ -38,31 +38,28 @@
#if 0 #if 0
static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95"; static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95";
#else #else
__RCSID("$NetBSD: sync.c,v 1.14 2000/02/09 22:27:56 jsm Exp $"); __RCSID("$NetBSD: sync.c,v sync.c,v 1.20 2001/02/05 01:10:11 christos Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#ifdef __STDC__ #include <signal.h>
#include <stdarg.h> #include <stdarg.h>
#else #include <stdio.h>
#include <varargs.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <string.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <time.h> #include <time.h>
#include <unistd.h>
#include "extern.h" #include "extern.h"
#include "pathnames.h" #include "pathnames.h"
#include <stdio.h>
#include <signal.h>
#define BUFSIZE 4096 #define BUFSIZE 4096
int sync_update(type, ship, astr, a, b, c, d); static int sync_update(int, struct ship *, const char *, long, long, long, long);
static const char SF[] = _PATH_SYNC; static const char SF[] = _PATH_SYNC;
static const char LF[] = _PATH_LOCK; static const char LF[] = _PATH_LOCK;
@@ -74,11 +71,7 @@ static long sync_seek;
static FILE *sync_fp; static FILE *sync_fp;
void void
fmtship(buf, len, fmt, ship) fmtship(char *buf, size_t len, const char *fmt, struct ship *ship)
char *buf;
size_t len;
const char *fmt;
struct ship *ship;
{ {
while (*fmt) { while (*fmt) {
if (len-- == 0) { if (len-- == 0) {
@@ -103,78 +96,50 @@ fmtship(buf, len, fmt, ship)
/*VARARGS3*/ /*VARARGS3*/
void void
#ifdef __STDC__
makesignal(struct ship *from, const char *fmt, struct ship *ship, ...) makesignal(struct ship *from, const char *fmt, struct ship *ship, ...)
#else
makesignal(va_alias)
va_dcl
#endif
{ {
char message[BUFSIZ]; char message[BUFSIZ];
char format[BUFSIZ]; char format[BUFSIZ];
va_list ap; va_list ap;
#ifndef __STDC__
struct ship *from;
const char *fmt;
struct ship *ship;
va_start(ap);
from = va_arg(ap, struct ship *);
fmt = va_arg(ap, const char *);
ship = va_arg(ap, struct ship *);
#else
va_start(ap, ship); va_start(ap, ship);
#endif
fmtship(format, sizeof(format), fmt, ship); fmtship(format, sizeof(format), fmt, ship);
(void) vsprintf(message, format, ap); vsprintf(message, format, ap);
va_end(ap); va_end(ap);
Writestr(W_SIGNAL, from, message); Writestr(W_SIGNAL, from, message);
} }
/*VARARGS2*/
void void
#ifdef __STDC__
makemsg(struct ship *from, const char *fmt, ...) makemsg(struct ship *from, const char *fmt, ...)
#else
makemsg(va_alias)
va_dcl
#endif
{ {
char message[BUFSIZ]; char message[BUFSIZ];
va_list ap; va_list ap;
#ifndef __STDC__
struct ship *from;
const char *fmt;
va_start(ap);
from = va_arg(ap, struct ship *);
fmt = va_arg(ap, const char *);
#else
va_start(ap, fmt); va_start(ap, fmt);
#endif vsprintf(message, fmt, ap);
(void) vsprintf(message, fmt, ap);
va_end(ap); va_end(ap);
Writestr(W_SIGNAL, from, message); Writestr(W_SIGNAL, from, message);
} }
int int
sync_exists(game) sync_exists(int game)
int game;
{ {
char buf[sizeof sync_file]; char buf[sizeof sync_file];
struct stat s; struct stat s;
time_t t; time_t t;
(void) sprintf(buf, SF, game); sprintf(buf, SF, game);
(void) time(&t); time(&t);
setegid(egid); setegid(egid);
if (stat(buf, &s) < 0) { if (stat(buf, &s) < 0) {
setegid(gid); setegid(gid);
return 0; return 0;
} }
if (s.st_mtime < t - 60*60*2) { /* 2 hours */ if (s.st_mtime < t - 60*60*2) { /* 2 hours */
(void) unlink(buf); unlink(buf);
(void) sprintf(buf, LF, game); sprintf(buf, LF, game);
(void) unlink(buf); unlink(buf);
setegid(gid); setegid(gid);
return 0; return 0;
} else { } else {
@@ -184,18 +149,18 @@ sync_exists(game)
} }
int int
sync_open() sync_open(void)
{ {
struct stat tmp; struct stat tmp;
if (sync_fp != NULL) if (sync_fp != NULL)
(void) fclose(sync_fp); fclose(sync_fp);
(void) sprintf(sync_lock, LF, game); sprintf(sync_lock, LF, game);
(void) sprintf(sync_file, SF, game); sprintf(sync_file, SF, game);
setegid(egid); setegid(egid);
if (stat(sync_file, &tmp) < 0) { if (stat(sync_file, &tmp) < 0) {
mode_t omask = umask(002); mode_t omask = umask(002);
sync_fp = fopen(sync_file, "w+"); sync_fp = fopen(sync_file, "w+");
(void) umask(omask); umask(omask);
} else } else
sync_fp = fopen(sync_file, "r+"); sync_fp = fopen(sync_file, "r+");
setegid(gid); setegid(gid);
@@ -206,54 +171,45 @@ sync_open()
} }
void void
sync_close(remove) sync_close(int remove)
char remove;
{ {
if (sync_fp != 0) if (sync_fp != 0)
(void) fclose(sync_fp); fclose(sync_fp);
if (remove) { if (remove) {
setegid(egid); setegid(egid);
(void) unlink(sync_file); unlink(sync_file);
setegid(gid); setegid(gid);
} }
} }
void void
Write(type, ship, a, b, c, d) Write(int type, struct ship *ship, long a, long b, long c, long d)
int type;
struct ship *ship;
long a, b, c, d;
{ {
(void) sprintf(sync_bp, "%d %d 0 %ld %ld %ld %ld\n", sprintf(sync_bp, "%d %d 0 %ld %ld %ld %ld\n",
type, ship->file->index, a, b, c, d); type, ship->file->index, a, b, c, d);
while (*sync_bp++) while (*sync_bp++)
; ;
sync_bp--; sync_bp--;
if (sync_bp >= &sync_buf[sizeof sync_buf]) if (sync_bp >= &sync_buf[sizeof sync_buf])
abort(); abort();
(void) sync_update(type, ship, NULL, a, b, c, d); sync_update(type, ship, NULL, a, b, c, d);
} }
void void
Writestr(type, ship, a) Writestr(int type, struct ship *ship, const char *a)
int type;
struct ship *ship;
const char *a;
{ {
sprintf(sync_bp, "%d %d 1 %s\n", type, ship->file->index, a);
(void) sprintf(sync_bp, "%d %d 1 %s\n",
type, ship->file->index, a);
while (*sync_bp++) while (*sync_bp++)
; ;
sync_bp--; sync_bp--;
if (sync_bp >= &sync_buf[sizeof sync_buf]) if (sync_bp >= &sync_buf[sizeof sync_buf])
abort(); abort();
(void) sync_update(type, ship, a, 0, 0, 0, 0); sync_update(type, ship, a, 0, 0, 0, 0);
} }
int int
Sync() Sync(void)
{ {
sig_t sighup, sigint; sig_t sighup, sigint;
int n; int n;
@@ -285,7 +241,7 @@ Sync()
} }
if (n <= 0) if (n <= 0)
return -1; return -1;
(void) fseek(sync_fp, sync_seek, SEEK_SET); fseek(sync_fp, sync_seek, SEEK_SET);
for (;;) { for (;;) {
switch (fscanf(sync_fp, "%d%d%d", &type, &shipnum, &isstr)) { switch (fscanf(sync_fp, "%d%d%d", &type, &shipnum, &isstr)) {
case 3: case 3:
@@ -331,31 +287,27 @@ bad:
erred++; erred++;
out: out:
if (!erred && sync_bp != sync_buf) { if (!erred && sync_bp != sync_buf) {
(void) fseek(sync_fp, 0L, SEEK_END); fseek(sync_fp, 0L, SEEK_END);
(void) fwrite(sync_buf, sizeof *sync_buf, sync_bp - sync_buf, fwrite(sync_buf, sizeof *sync_buf, sync_bp - sync_buf,
sync_fp); sync_fp);
(void) fflush(sync_fp); fflush(sync_fp);
sync_bp = sync_buf; sync_bp = sync_buf;
} }
sync_seek = ftell(sync_fp); sync_seek = ftell(sync_fp);
#ifdef LOCK_EX #ifdef LOCK_EX
(void) flock(fileno(sync_fp), LOCK_UN); flock(fileno(sync_fp), LOCK_UN);
#else #else
setegid(egid); setegid(egid);
(void) unlink(sync_lock); unlink(sync_lock);
setegid(gid); setegid(gid);
#endif #endif
(void) signal(SIGHUP, sighup); signal(SIGHUP, sighup);
(void) signal(SIGINT, sigint); signal(SIGINT, sigint);
return erred ? -1 : 0; return erred ? -1 : 0;
} }
int static int
sync_update(type, ship, astr, a, b, c, d) sync_update(int type, struct ship *ship, const char *astr, long a, long b, long c, long d)
int type;
struct ship *ship;
const char *astr;
long a, b, c, d;
{ {
switch (type) { switch (type) {
case W_DBP: { case W_DBP: {
@@ -432,7 +384,7 @@ sync_update(type, ship, astr, a, b, c, d)
break; break;
} }
case W_CAPTAIN: case W_CAPTAIN:
(void) strncpy(ship->file->captain, astr, strncpy(ship->file->captain, astr,
sizeof ship->file->captain - 1); sizeof ship->file->captain - 1);
ship->file->captain[sizeof ship->file->captain - 1] = 0; ship->file->captain[sizeof ship->file->captain - 1] = 0;
break; break;
@@ -471,7 +423,7 @@ sync_update(type, ship, astr, a, b, c, d)
ship->specs->hull = a; ship->specs->hull = a;
break; break;
case W_MOVE: case W_MOVE:
(void) strncpy(ship->file->movebuf, astr, strncpy(ship->file->movebuf, astr,
sizeof ship->file->movebuf - 1); sizeof ship->file->movebuf - 1);
ship->file->movebuf[sizeof ship->file->movebuf - 1] = 0; ship->file->movebuf[sizeof ship->file->movebuf - 1] = 0;
break; break;
@@ -534,7 +486,7 @@ sync_update(type, ship, astr, a, b, c, d)
windspeed = b; windspeed = b;
break; break;
case W_BEGIN: case W_BEGIN:
(void) strcpy(ship->file->captain, "begin"); strcpy(ship->file->captain, "begin");
people++; people++;
break; break;
case W_END: case W_END:

View File

@@ -169,7 +169,7 @@ main(argc, argv)
while ((ch = getopt(argc, argv, "l:w:t")) != -1) while ((ch = getopt(argc, argv, "l:w:t")) != -1)
switch ((char) ch) { switch ((char) ch) {
#if 0 #ifdef DEBUG
case 'd': case 'd':
tv = atol(optarg); tv = atol(optarg);
break; break;
@@ -185,7 +185,11 @@ main(argc, argv)
break; break;
case '?': case '?':
default: default:
#ifdef DEBUG
fputs("usage: snake [-d seed] [-w width] [-l length] [-t]\n", stderr);
#else
fputs("usage: snake [-w width] [-l length] [-t]\n", stderr); fputs("usage: snake [-w width] [-l length] [-t]\n", stderr);
#endif
exit(1); exit(1);
} }

View File

@@ -292,8 +292,8 @@ scr_set()
newtt = oldtt; newtt = oldtt;
newtt.c_lflag &= ~(ICANON|ECHO); newtt.c_lflag &= ~(ICANON|ECHO);
newtt.c_oflag &= ~OXTABS; newtt.c_oflag &= ~OXTABS;
newtt.c_cc[VMIN] = 1; newtt.c_cc[VMIN] = 1; /* don't lag behind 3 keystrokes on sun */
newtt.c_cc[VTIME] = 0; newtt.c_cc[VTIME] = 0; /* systems -- JEH */
if (tcsetattr(0, TCSADRAIN, &newtt) < 0) if (tcsetattr(0, TCSADRAIN, &newtt) < 0)
stop("tcsetattr() fails"); stop("tcsetattr() fails");
ospeed = cfgetospeed(&newtt); ospeed = cfgetospeed(&newtt);

View File

@@ -1,4 +1,4 @@
.\" $NetBSD: trek.6,v 1.7 2000/03/02 13:27:53 enami Exp $ .\" $NetBSD: trek.6,v 1.8 2001/04/02 22:42:39 wiz Exp $
.\" .\"
.\" Copyright (c) 1980, 1993 .\" Copyright (c) 1980, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@@ -81,7 +81,7 @@ the game will tell you what it expects if you just type in a question mark.
.Sh AUTHOR .Sh AUTHOR
Eric Allman Eric Allman
.Sh SEE ALSO .Sh SEE ALSO
.Pa /usr/share/doc/trek/trek.me.gz .Pa /usr/share/doc/bsdgames/trek.me.gz
.Sh COMMAND SUMMARY .Sh COMMAND SUMMARY
.Bl -item -compact .Bl -item -compact
.It .It

View File

@@ -1,4 +1,4 @@
$NetBSD: acronyms,v 1.68 2000/09/10 20:49:20 wiz Exp $ $NetBSD: acronyms,v 1.89 2001/08/11 11:57:35 wennmach Exp $
AFAICR as far as I can recall AFAICR as far as I can recall
AFAICT as far as I can tell AFAICT as far as I can tell
@@ -8,14 +8,19 @@ AFK away from keyboard
AIUI as I understand it AIUI as I understand it
AKA also known as AKA also known as
ASAP as soon as possible ASAP as soon as possible
AWOL absent without official leave
AYBABTU all your base are belong to us
BBL [I'll] be back later BBL [I'll] be back later
BBS be back soon BBS be back soon
BBT be back tomorrow BBT be back tomorrow
BFD big fucking deal BFD big fucking deal
BIAB back in a bit BIAB back in a bit
BIAF back in a few BIAF back in a few
BIALW back in a little while
BIAS back in a second BIAS back in a second
BIAW back in a while BIAW back in a while
BOFH bastard operator from hell
BOHICA bend over here it comes again
BRB [I'll] be right back BRB [I'll] be right back
BTDT been there, done that BTDT been there, done that
BTTH butt to the head BTTH butt to the head
@@ -30,10 +35,13 @@ DWIM do what I mean
EG evil grin EG evil grin
EMSG email message EMSG email message
ETLA extended three letter acronym ETLA extended three letter acronym
EWAG experienced wild-ass guess
FAQ frequently asked question FAQ frequently asked question
FIIK fuck if I know FIIK fuck[ed] if I know
FIIR fuck[ed] if I remember
FOAD fall over and die FOAD fall over and die
FSDO for some definition of FSDO for some definition of
FSVO for some value of
FUBAR fucked up beyond all recognition FUBAR fucked up beyond all recognition
FUD fear, uncertainty and doubt FUD fear, uncertainty and doubt
FWIW for what it's worth FWIW for what it's worth
@@ -57,6 +65,7 @@ IRL in real life
ISTM it seems to me ISTM it seems to me
ISTR I seem to recall ISTR I seem to recall
ITYM I think you mean ITYM I think you mean
JIC just in case
JK just kidding JK just kidding
JMO just my opinion JMO just my opinion
JTLYK just to let you know JTLYK just to let you know
@@ -64,6 +73,8 @@ KISS keep it simple, stupid
KITA kick in the ass KITA kick in the ass
KNF kernel normal form KNF kernel normal form
L8R later L8R later
LART luser attitude readjustment tool (ie, hammer)
LJBF let's just be friends
LMSO laughing my socks off LMSO laughing my socks off
LOL laughing out loud LOL laughing out loud
LTNS long time no see LTNS long time no see
@@ -75,6 +86,7 @@ MYOB mind your own business
NBD no big deal NBD no big deal
NFC no fucking clue NFC no fucking clue
NFI no fucking idea NFI no fucking idea
NFW no fucking way
NIH not invented here NIH not invented here
NP no problem NP no problem
NRFPT not ready for prime time NRFPT not ready for prime time
@@ -83,6 +95,7 @@ OIC oh, I see
OTL out to lunch OTL out to lunch
OTOH on the other hand OTOH on the other hand
OTTOMH off the top of my head OTTOMH off the top of my head
PFY pimply faced youth
PITA pain in the ass PITA pain in the ass
PNG persona non grata PNG persona non grata
POC point of contact POC point of contact
@@ -91,13 +104,14 @@ PPL pretty please
QED quod erat demonstrandum QED quod erat demonstrandum
RFC request for comments RFC request for comments
RL real life RL real life
RLC rod length check
ROTFL rolling on the floor laughing ROTFL rolling on the floor laughing
RP responsible person RP responsible person
RSN real soon now RSN real soon now
RTFB read the fine book RTFB read the fine/fucking book
RTFM read the fine manual RTFM read the fine/fucking manual
RTFMP read the fine man page RTFMP read the fine/fucking man page
RTFS read the fine source RTFS read the fine/fucking source
SCNR sorry, could not resist SCNR sorry, could not resist
SEP someone else's problem SEP someone else's problem
SFA sweet fuck all SFA sweet fuck all
@@ -107,18 +121,26 @@ SMOP simple matter of programming
SNAFU situation normal, all fucked up SNAFU situation normal, all fucked up
SNERT snot-nosed egotistical rude teenager SNERT snot-nosed egotistical rude teenager
SO significant other SO significant other
SOB son of [a] bitch
SOL shit out [of] luck SOL shit out [of] luck
SUS stupid user syndrome
SWAG silly, wild-assed guess SWAG silly, wild-assed guess
SWAHBI silly, wild-assed hare-brained idea SWAHBI silly, wild-assed hare-brained idea
TANSTAAFL there ain't no such thing as a free lunch
TBD to be {decided,determined,done}
TIA thanks in advance TIA thanks in advance
TLA three letter acronym TLA three letter acronym
TMA too many abbreviations
TMI too much information TMI too much information
TTFN ta ta for now TTFN ta ta for now
TTYL talk to you later TTYL talk to you later
TYVM thank you very much TYVM thank you very much
UTSL use the source, Luke UTSL use the source, Luke
VEG very evil grin VEG very evil grin
WAG wild-ass guess
WIBNI wouldn't it be nice if
WOFTAM waste of fucking time and money WOFTAM waste of fucking time and money
WOMBAT waste of money, brain, and time
WTF {what,where,who,why} the fuck WTF {what,where,who,why} the fuck
WTH {what,where,who,why} the hell WTH {what,where,who,why} the hell
WYSIWYG what you see is what you get WYSIWYG what you see is what you get