annotate bin/ntstart @ 13:ed82a42ba89d

Added code to cause missiles, fighters and plasmas to get confused in nebulous terrain. If it gets confused then it picks a random direction to go.
author darius
date Sat, 06 Dec 1997 06:27:03 +0000
parents 4d6502ffaa5e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
1 #!/bin/sh
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
2 #
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
3 # Server startup script for NetrekII (Paradise)
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
4 #
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
5 # If args1 exists it is assumed it is NETREKDIR, and will be used
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
6 # in place of whatever NETREKDIR was before. If NETREKDIR is not
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
7 # found it will attempt to find it in ../etc/conf.netrekdir
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
8 #
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
9
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
10 if [ X$1 != X ]; then
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
11 NETREKDIR=$1
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
12 elif [ X${NETREKDIR} = X ]; then
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
13 if [ -f "../etc/conf.netrekdir" ]; then
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
14 NETREKDIR=`cat "../etc/conf.netrekdir"`
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
15 else
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
16 echo "No NETREKDIR variable found, exiting."
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
17 exit 1
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
18 fi
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
19 fi
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
20
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
21 PORT=2592
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
22 PLPORT=2591
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
23 LOGS="${NETREKDIR}/logs"
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
24
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
25 if [ ! -f "${NETREKDIR}/bin/listen" ]; then
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
26 echo "$0: ${NETREKDIR}/bin/listen not found, exiting."
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
27 exit 1
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
28 fi
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
29
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
30 if [ -f "${LOGS}/server.log" ]; then
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
31 echo "$0: Moving server logfile to server.log.old"
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
32 mv ${LOGS}/server.log ${LOGS}/server.log.old
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
33 fi
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
34
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
35 if [ -f ${LOGS}/startup.log ]; then
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
36 echo "$0: Moving startup.log to startup.log.old"
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
37 mv ${LOGS}/startup.log ${LOGS}/startup.log.old
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
38 fi
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
39
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
40 echo "Netrek Server Startup at `date` by ${USER}" >> "${LOGS}/startup.log"
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
41 echo "NETREKDIR=${NETREKDIR}" >> "${LOGS}/startup.log"
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
42 echo "PORT=${PORT}" >> "${LOGS}/startup.log"
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
43 echo "PLPORT=${PLPORT}" >> "${LOGS}/startup.log"
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
44
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
45 # Startup listen
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
46 ${NETREKDIR}/bin/listen -p ${PLPORT}
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
47 ${NETREKDIR}/bin/listen -p ${PORT}
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
48
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
49 # Startup the connected players port
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
50 if [ -f ${NETREKDIR}/faucet -a -f ${NETREKDIR}/pl ]; then
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
51 echo "$0: Starting player listing on port ${PLPORT}" >> ${LOGS}/startup.log
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
52 ${NETREKDIR}/faucet ${PLPORT} -out pl &
4d6502ffaa5e Initial revision
darius
parents:
diff changeset
53 fi