Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please help




| I am reviewing the Crossfire FAQ.
| 
| If there is anything you feel should be there, please let me know.
| I need more playing tips / neat places to go etc
| 
| Also I need some more volunteers to answer queries on compiling
| Crossfire on their platform. It seems many people get put
| off because compiling Crossfire can be too daunting. If
| there is someone that gone though this process already
| this could be a big help. I am looking for people using
| the following platforms
| 
Then DONT BOTHER....

I use the script given below to contact a crossfire server.

All that is required is
  1/ a program to do a `telnet' to the server without the interactive
     nature of most telnet programs. You can easly get a perl telnet up
     in just a few lines.

     Sun provides a program called `mconnect' which can do the job.

  2/ The site and port of a crossfire server with X windows capability
     (All of them untill the client parts are finished)

     Example:
        crossfire.csua.berkeley.edu   port 13326  (the default)

  3/ This is the tricky part. The X font appropriate for the server
     you are running and the ability to add a font directory to your
     X server.

     If you are running on a console of a machine the script below will
     take care of the problem itself, just tell it which font directory to
     mount. Otherwise you make the font available to the X server you are
     using and the script will set it already available.

     The following X magic will download the font for the  berkley
     server (given above). and create the font directory to use.

        mkdirhier $HOME/games/lib/crossfire/fonts.berkeley
        cd $HOME/games/lib/crossfire/fonts.berkeley
        echo "1" > fonts.dir
        echo "crossfire.bdf crossfire" >> fonts.dir
        fstobdf -server tcp/crossfire.csua.berkeley.edu:13325 \
            -fn crossfire > crossfire.bdf

     Other servers are not so simple as many do not make the font publicly
     available.

At this point you should be able to run the script, which
assumes that berkeley server as default.  I store this in my games
directory and just run it to start crossfire.

#=======8<------CUT HERE--------axes/crowbars permitted---------------
#!/bin/sh
#
# start crossfire (ANY version)
#
# Modify the server and font settings to suit your
# requirements and font locations.
#
option=${1:-"-b"} # set the default server to berkeley
#
# Where your font directories are located
font=$HOME/games/lib/crossfire/fonts
# The default port for crossfire servers
port=13326
#
# ---------------
# Modify or Set the following variables
#  server=    the server to use
#  port=      the port of the server (if not the default)
#  version=   the servers version (printed only)
#  font=      the directory to get the crossfire font from
#
if [ "X$option" = "X-a" ]; then          # australian (-a)
  server=clubx.anu.edu.au
  version=0.91.0
  # standard font -- from sources
elif [ "X$option" = "X-b" ]; then        # berkley (-b)
  server=crossfire.csua.berkeley.edu
  version=0.91.5
  #font=tcp/crossfire.csua.berkeley.edu:13325
  font=$font.berkeley
elif [ "X$option" = "X-f" ]; then        # french (-f)
  server=yoko.ens-cachan.fr
  version=0.91.3
  # Unable to locate font for this server
else
  echo >&2 "Unknown option $option"
  exit 10
fi

# ---------------------------------------------------
echo ""
echo "Crossfire at $server:$port (version $version)"
echo ""

# Set the DISPLAY correctly (asking name server)
oldIFS=$IFS; IFS=:; set -- $DISPLAY; IFS=$oldIFS;
case $# in
0) echo "DISPLAY Error -- aborting"; exit 10;;
1) Machine="`hostname`"; Screen="$1";;
2) Machine="$1"; Screen="$2";;
*) echo "DISPLAY Error -- aborting"; exit 10;;
esac
Machine="`/usr/etc/nslookup $Machine | sed -n 's/Name: *//p'`"
display="$Machine:$Screen"

# Set the font is crossfire font not available
if [ "$font" -a "`xlsfonts -fn crossfire 2>/dev/null`" != 'crossfire' ]; then
  echo "seting font..."
  xset fp+ $font
  if [ "`xlsfonts -fn crossfire 2>/dev/null`" != 'crossfire' ]; then
    echo "UNABLE TO SET CROSSFIRE FONT -- ABORTING"
    exit 10
  fi
fi

echo "xhosting..."
xhost +$server

echo "telneting..."
( sleep 12
  sleep 1
  echo "who"
  sleep 1
  echo "add $display"
  sleep 1
  echo "motd"
  sleep 1
  echo >&2 "you can now type - ^D to exit"
  cat -
) | mconnect -p $port $server   # this is a non-interactive telnet command

echo "removing xhost"
xhost -$server
echo "removing font"
xset fp- $font

echo "finished - exiting"
kill 0 # insure cat is killed
exit

#=======8<------CUT HERE--------axes/crowbars permitted---------------


  Anthony Thyssen ( System Programmer )   http://www.cit.gu.edu.au/~anthony/
-------------------------------------------------------------------------------
     Kernal PANIC: Unable to mount /dev/coffie.machine -- Operator Halted.
-------------------------------------------------------------------------------