Debian Codegraph @

debian/scripts/openarena.in

raw
1 #!/bin/sh
2
3 # quake3 or quake3-server or whatever
4 IOQ3SELF=@IOQ3SELF@
5 # "server" or "client"
6 IOQ3ROLE=@IOQ3ROLE@
7 # ioquake3 or ioq3ded
8 IOQ3BINARY=@IOQ3BINARY@
9 # /usr/lib/openarena or /usr/lib/openarena-server
10 FS_BASEPATH=@FS_BASEPATH@
11
12 ENGINE="/usr/lib/ioquake3/${IOQ3BINARY}"
13
14 DEBUGGER="$OPENARENA_DEBUGGER"
15
16 # we're a standalone game
17 CVARS="+set com_basegame baseoa"
18 CVARS="$CVARS +set fs_basepath $FS_BASEPATH"
19 CVARS="$CVARS +set com_homepath .openarena"
20 CVARS="$CVARS +set fs_homepath $HOME/.openarena"
21
22 # OA uses a different protocol number to reflect incompatible game content.
23 # When it says "71", that's actually the legacy Quake III Arena 1.32c protocol,
24 # protocol 68.
25 CVARS="$CVARS +set com_legacyprotocol 71"
26 # For the moment, disable the modern protocol, by setting this cvar to the
27 # same thing. When OA upstream decide what value they'll use, we should
28 # catch up.
29 CVARS="$CVARS +set com_protocol 71"
30
31 # OA's default master server is different
32 CVARS="$CVARS +set sv_master1 dpmaster.deathmask.net"
33 # update.quake3arena.com is pretty irrelevant if you're playing OA
34 CVARS="$CVARS +set cl_motd 0"
35 # OA 0.8.5 sends QuakeArena-1 heartbeats, which dpmaster interprets as implying
36 # that it's a version of Quake III Arena from the future rather than a separate
37 # game. Remain compatible even in ioquake3 >= r2105, by leaving com_gamename
38 # set to the default, "Quake3Arena"; this will hopefully be fixed in a future
39 # OA version, but that's a compatibility break.
40 #CVARS="$CVARS +set com_gamename Quake3Arena"
41
42 QUIET=0
43
44 EXCUSE="\
45 OpenArena ${IOQ3ROLE} wrapper for Debian\n\
46 \n\
47 Usage: ${IOQ3SELF} [OPTION]...\n\
48 \n\
49 -h, --help\t\tDisplay this help\n\
50 -q, --quiet\t\tDisable console output\n\
51 +<internal command>\tPass commands to the engine\n"
52
53 while [ "$1" != "" ]; do
54 case "$1" in
55 -h|--help)
56 echo ${EXCUSE}
57 exit 0
58 ;;
59 -q|--quiet)
60 CVARS="$CVARS +set ttycon 0"
61 QUIET=1
62 ;;
63 *)
64 break
65 ;;
66 esac
67 shift
68 done
69
70 if test "z$QUIET" = z1; then
71 exec >/dev/null 2>&1;
72 fi
73
74 if test -n "$OPENARENA_BACKTRACE"; then
75 exec gdb -return-child-result -batch -ex run -ex 'thread apply all bt full' -ex kill -ex quit --args ${ENGINE} ${CVARS} "$@"
76 else
77 exec ${DEBUGGER} ${ENGINE} ${CVARS} "$@"
78 fi