Urban Terror Forums: xqf quake3 script for PB and BE. - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

xqf quake3 script for PB and BE. Rate Topic: -----

#1 User is offline   undead Icon

  • Account: undead
  • Joined: 06-June 10
  • Posts: 199

Posted 02 April 2007 - 07:03 PM

I updated the script to allow for checking PB and BE server cvars.  By the way, I used revived the version posted here earlier and I noticed a problem either in the script or the way the forum encodes it.

Setup xqf to execute this rather than pointing to a specific engine.  I like ioquake3 the best so I use that when I can.


#!/bin/sh

#
# Script for XQF to choose which engine to use.  Requires qstat.
#
# If the server is running PB, use idsoftware's engine.
# If the server is running BE, use ioUrbanTerror engine.
# If the server is running neither, use my local compile of ioUrbanTerror.
#
# Note: On debian, qstat has been renamed to quakestat.  Replace
# that below if you are not using Debian.
#
# To use this, change the paths to your quake3 locations (idsoftware and ioquake3).
# Then setup xqf to execute this instead of quake3.
#

set -e

# Set these paths and executable names for your system.
ID_QUAKE=/srv/games/engines/quake3/idsoftware/quake3.x86
IO_OFFICIAL=/srv/games/engines/quake3/ioUrbanTerror/Linux-i386/ioUrbanTerror.i386
IO_LOCAL=/srv/games/engines/quake3/ioUrbanTerrorLocal/ioUrbanTerror.x86_64
QSTAT=quakestat

# Example command issued by xqf:
# /bin/sh /srv/games/engines/quake3/idsoftware/quake3 +connect IP:PORT +set cl_punkbuster 1 +set fs_game q3ut3 +set com_hunkmegs 208 +set com_zonemegs 32 +set com_soundmegs 20 +set cg_precachedmodels 20

# Check the arguments (go until $# = 1 because there must be at least 2 arguments)
SERVER="";
SAVED_ARGS="$*";
while (($# > 1)); do
  if [ X"$1" = X"+connect" ]; then
    # Right after +connect is the IP:PORT.
    SERVER="$2";
  fi
  shift;
done

if [ X"$SERVER" = "X" ]; then
  echo "Error!  You must provide a command with +connect IP:PORT to this script";
  echo "Usage: $0 <quake3 commands> +connect IP:PORT <more q3 commands>"
  exit 1;
fi

# Get the rules from the server
echo "Requesting rules from server $SERVER"
SETTINGS="`$QSTAT -R -q3s $SERVER | tail -1`";

# Search for the server variable that enables punkbuster
PUNKBUSTER="`echo $SETTINGS | sed -e 's/.*,?sv_punkbuster=([0-9]),?.*/1/i'`"
BATTLEYE="`echo $SETTINGS | sed -e 's/.*,?sv_battleye=([0-9]),?.*/1/i'`"

# Choose the right engine.
if [ X"$PUNKBUSTER" = X"1" ]; then
  echo "This server runs punkbuster.  Executing idsoftware quake3"
  EXE="$ID_QUAKE";
elif [ X"$BATTLEYE" = X"1" ]; then
  echo "This server runs battleye.  Executing official ioUrbanTerror"
  EXE="$IO_OFFICIAL";
else
  echo "This server doesn't run either anti-cheat.  Use locally compiled 64-bit version"
  EXE="$IO_LOCAL";
fi

if [ X"$EXE" = "X" ]; then
  echo "Error!  Script must define EXE"
  exit 1;
fi

EXE_PATH="`dirname $EXE`";
EXE_NAME="`basename $EXE`";

cd "$EXE_PATH";
./${EXE_NAME} $SAVED_ARGS;

exit $?



#2 User is offline   mitsubishi Icon

  • Account: mitsubishi
  • Country:
  • Joined: 28-February 10
  • Posts: 13,481

Posted 02 April 2007 - 07:35 PM

thx.

#3 User is offline   Riotta (old) Icon

  • Joined: 03-April 07
  • Posts: 133
  • LocationPoland

Posted 06 April 2007 - 04:38 AM

Great work man, I was looking for something like this :)

Regards

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Sponsored link
https://www.urbanterror.info/members/donate/


Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942