[comp.sources.games] v12i046: tinymud2 - user-extendible multi-user adventure

billr@saab.tek.com (Bill Randle) (03/09/91)

Submitted-by: John Temples <jwt!john@uunet.UU.NET>
Posting-number: Volume 12, Issue 46
Archive-name: tinymud2/sysv_diffs
Patch-to: tinymud2: Volume 12, Issue 46-46
Environment: 

	[This is a set of patches to get tinymud2 running under
	 System V.  (Untested by me.)  -br]

#!/bin/sh
# This is a shell archive (shar 3.32)
# made 03/07/1991 05:00 UTC by john@jwt
#
# existing files WILL be overwritten
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#    972 -rw-r--r-- README.sysv
#   5017 -rw-r--r-- sysv.diffs
#    310 -rw-r--r-- fakeselect.h
#
if touch 2>&1 | fgrep 'amc' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
# ============= README.sysv ==============
echo "x - extracting README.sysv (Text)"
sed 's/^X//' << 'SHAR_EOF' > README.sysv &&
XThese diffs allow TinyMUD to be built on a System V machine without
Xnetworking by using named pipes for IPC.  They have been tested only
Xunder System V/386 Release 3.2 (ESIX and ISC).  They were developed
Xfor TinyMUD v1.5.4 as distributed in comp.sources.games, volume 11.
XAlso required is the file xenix_diffs from the same c.s.g volume.
X
XHow to install:
X
X1. Unpack all archives.
X2. Apply the Xenix diffs with "patch < xenix.diffs"
X3. Apply the System V diffs with "patch < sysv.diffs"
X4. Run "joinspl.sh".
X5. Run a make.
X6. The server is started by typing "fifonetmud dbfile dumpfile".
X   "small.db" is included in the distribution and can be used for "dbfile".
X7. The supplied client is "tinymud.sh"
X
XNotes:
X
XTinyMUD requires an ANSI C compiler.  gcc works fine.
X
XMy implementation of the FD_* macros in "fakeselect.h" will only
Xallow about 14 players in the game.  A better implementation would be
Xrequired to allow more players.
X--
XJohn W. Temples, III
Xjohn@jwt.UUCP
SHAR_EOF
$TOUCH -am 0304154191 README.sysv &&
chmod 0644 README.sysv ||
echo "restore of README.sysv failed"
set `wc -c README.sysv`;Wc_c=$1
if test "$Wc_c" != "972"; then
	echo original size 972, current size $Wc_c
fi
# ============= sysv.diffs ==============
echo "x - extracting sysv.diffs (Text)"
sed 's/^X//' << 'SHAR_EOF' > sysv.diffs &&
X*** joinspl.sh	Mon Mar  4 14:42:29 1991
X--- joinspl.sh	Mon Jan 28 09:56:47 1991
X***************
X*** 10,15 ****
X  #
X  # build tinymud.ps from its three parts
X  #
X! creating tinymud.ps
X  cat tinymud.ps.xa? >tinymud.ps
X  rm tinymud.ps.xa?
X--- 10,15 ----
X  #
X  # build tinymud.ps from its three parts
X  #
X! echo creating tinymud.ps
X  cat tinymud.ps.xa? >tinymud.ps
X  rm tinymud.ps.xa?
X*** fifoiface.c	Mon Mar  4 14:50:01 1991
X--- fifoiface.c	Mon Mar  4 14:50:45 1991
X***************
X*** 16,22 ****
X  #include <sys/types.h>
X  #include <sys/file.h>
X  #include <sys/stat.h>
X! #include <sys/select.h>
X  #include <signal.h>
X  #include <sys/ioctl.h>
X  #include <fcntl.h>
X--- 16,22 ----
X  #include <sys/types.h>
X  #include <sys/file.h>
X  #include <sys/stat.h>
X! #include "fakeselect.h"
X  #include <signal.h>
X  #include <sys/ioctl.h>
X  #include <fcntl.h>
X***************
X*** 178,187 ****
X  	fd_set r, w, x;
X  
X  	if (timeout) sec=timeout->tv_sec+(timeout->tv_usec+500)/1000;
X! 	r= *rfds; w= *wfds; x= *xfds;
X  
X  	while(1) {
X! 		*rfds=r; *wfds=w; *xfds=x;
X  		for(maxfd=fd=0;fd<maxd;++fd) {
X  			if(FD_ISSET(fd,rfds)) {
X  				if (stat(fifonames[fd],&sbuf) != 0)
X--- 178,187 ----
X  	fd_set r, w, x;
X  
X  	if (timeout) sec=timeout->tv_sec+(timeout->tv_usec+500)/1000;
X! 	r= *rfds; w= *wfds;
X  
X  	while(1) {
X! 		*rfds=r; *wfds=w;
X  		for(maxfd=fd=0;fd<maxd;++fd) {
X  			if(FD_ISSET(fd,rfds)) {
X  				if (stat(fifonames[fd],&sbuf) != 0)
X*** rename.c	Mon Mar  4 14:43:45 1991
X--- rename.c	Mon Feb  4 09:51:21 1991
X***************
X*** 8,14 ****
X  	char buf[1024];
X  	int n;
X  	(void)unlink(new);
X! 	if (link(old, new) == -1 && errno != EXDEV)
X  		return(-1);
X  	if((fd1=open(old,0)) == -1)
X  		return(-1);
X--- 8,18 ----
X  	char buf[1024];
X  	int n;
X  	(void)unlink(new);
X! 	if (link(old, new) == 0) {
X! 		unlink(old);
X! 		return 0;
X! 	}
X! 	else if (errno != EXDEV)
X  		return(-1);
X  	if((fd1=open(old,0)) == -1)
X  		return(-1);
X*** Makefile	Mon Mar  4 14:44:17 1991
X--- Makefile	Wed Feb  6 09:54:21 1991
X***************
X*** 9,16 ****
X  
X  # GCC:
X  CC=gcc
X! OPTIM= -g -W -Wreturn-type -Wunused -Wcomment -Wwrite-strings
X! OPTIM= -W -Wreturn-type -Wunused -Wcomment -Wwrite-strings
X  
X  # Systems with 'cc' built from GCC (IBM RT, NeXT):
X  #CC=cc
X--- 9,17 ----
X  
X  # GCC:
X  CC=gcc
X! #OPTIM= -g -W -Wreturn-type -Wunused -Wcomment -Wwrite-strings
X! OPTIM= -O -W -Wreturn-type -Wunused -Wcomment -Wwrite-strings -s
X! LIBS= -lc_s
X  
X  # Systems with 'cc' built from GCC (IBM RT, NeXT):
X  #CC=cc
X***************
X*** 74,80 ****
X  
X  DEFS= -DGOD_PRIV -DCOMPRESS -DQUIET_WHISPER -DGENDER -UHOST_NAME \
X        -DCONNECT_MESSAGES -DPLAYER_LIST -DDETACH -DROBOT_MODE \
X!       -DRECYCLE -DTINKER -DNOFAKES -UISLANDIA -DDEBUG
X  
X  CFLAGS= $(OPTIM) $(DEFS)
X  
X--- 75,82 ----
X  
X  DEFS= -DGOD_PRIV -DCOMPRESS -DQUIET_WHISPER -DGENDER -UHOST_NAME \
X        -DCONNECT_MESSAGES -DPLAYER_LIST -DDETACH -DROBOT_MODE \
X!       -DRECYCLE -DTINKER -DNOFAKES -UISLANDIA -DDEBUG -DDB_DOUBLING \
X! 	  -DDB_INITIAL_SIZE=1000
X  
X  CFLAGS= $(OPTIM) $(DEFS)
X  
X***************
X*** 119,125 ****
X  	$(CC) $(CFLAGS) -o netmud.conc interface.o $(OFILES)
X  
X  fifonetmud: $P fifoiface.o $(OFILES)
X! 	$(CC) $(CFLAGS) -o $@ fifoiface.o $(OFILES)
X  match.h: copyright.h db.h
X  netmud: $P oldinterface.o $(OFILES)
X  	-mv -f netmud netmud~
X--- 121,127 ----
X  	$(CC) $(CFLAGS) -o netmud.conc interface.o $(OFILES)
X  
X  fifonetmud: $P fifoiface.o $(OFILES)
X! 	$(CC) $(CFLAGS) -o $@ fifoiface.o $(OFILES) $(LIBS)
X  match.h: copyright.h db.h
X  netmud: $P oldinterface.o $(OFILES)
X  	-mv -f netmud netmud~
X***************
X*** 131,153 ****
X  
X  dump: $P dump.o unparse.o $(DBOFILES)
X  	-rm -f dump
X! 	$(CC) $(CFLAGS) -o dump dump.o unparse.o $(DBOFILES) 
X  
X  sanity-check: $P sanity-check.o utils.o $(DBOFILES) 
X  	-rm -f sanity-check
X! 	$(CC) $(CFLAGS) -o sanity-check sanity-check.o utils.o $(DBOFILES)
X  
X  extract: $P extract.o utils.o $(DBOFILES) 
X  	-rm -f extract
X! 	$(CC) $(CFLAGS) -o extract extract.o utils.o $(DBOFILES)
X  
X  paths: $P paths.o unparse.o $(DBOFILES)
X  	-rm -f paths
X! 	$(CC) $(CFLAGS) -o paths paths.o unparse.o $(DBOFILES)
X  
X  decompress: $P decompress.o compress.o
X  	-rm -f decompress
X! 	$(CC) $(CFLAGS) -o decompress decompress.o compress.o
X  
X  clean:
X  	-rm -f *.o a.out core gmon.out $(OUTFILES)
X--- 133,155 ----
X  
X  dump: $P dump.o unparse.o $(DBOFILES)
X  	-rm -f dump
X! 	$(CC) $(CFLAGS) -o dump dump.o unparse.o $(DBOFILES) $(LIBS)
X  
X  sanity-check: $P sanity-check.o utils.o $(DBOFILES) 
X  	-rm -f sanity-check
X! 	$(CC) $(CFLAGS) -o sanity-check sanity-check.o utils.o $(DBOFILES) $(LIBS)
X  
X  extract: $P extract.o utils.o $(DBOFILES) 
X  	-rm -f extract
X! 	$(CC) $(CFLAGS) -o extract extract.o utils.o $(DBOFILES) $(LIBS)
X  
X  paths: $P paths.o unparse.o $(DBOFILES)
X  	-rm -f paths
X! 	$(CC) $(CFLAGS) -o paths paths.o unparse.o $(DBOFILES) $(LIBS)
X  
X  decompress: $P decompress.o compress.o
X  	-rm -f decompress
X! 	$(CC) $(CFLAGS) -o decompress decompress.o compress.o $(LIBS)
X  
X  clean:
X  	-rm -f *.o a.out core gmon.out $(OUTFILES)
SHAR_EOF
$TOUCH -am 0304153191 sysv.diffs &&
chmod 0644 sysv.diffs ||
echo "restore of sysv.diffs failed"
set `wc -c sysv.diffs`;Wc_c=$1
if test "$Wc_c" != "5017"; then
	echo original size 5017, current size $Wc_c
fi
# ============= fakeselect.h ==============
echo "x - extracting fakeselect.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > fakeselect.h &&
Xtypedef	long	fd_set;
X
Xstruct	timeval	{
X	long	tv_sec;
X	long	tv_usec;
X};
X
X#define FD_SETSIZE (sizeof(fd_set) * 8)
X#define FD_SET(fd, maskptr) (*maskptr |= (1 << fd))
X#define FD_CLR(fd, maskptr) (*maskptr &= ~(1 << fd))
X#define FD_ZERO(maskptr) (*maskptr = 0)
X#define FD_ISSET(fd, maskptr) (*maskptr & (1 << fd))
SHAR_EOF
$TOUCH -am 0304150691 fakeselect.h &&
chmod 0644 fakeselect.h ||
echo "restore of fakeselect.h failed"
set `wc -c fakeselect.h`;Wc_c=$1
if test "$Wc_c" != "310"; then
	echo original size 310, current size $Wc_c
fi
exit 0