--- Makefile (revision 505216) +++ Makefile (working copy) @@ -116,6 +116,10 @@ DLRENDERER_MAKE_ARGS= USE_RENDERER_DLOPEN=1 DLRENDERER_MAKE_ARGS_OFF= USE_RENDERER_DLOPEN=0 +.if !defined(Q3TOTALCONV) +.include "${.CURDIR}/../quake3-data/Makefile.include" +.endif + .include .if !defined(DESKTOP_ENTRIES) @@ -140,6 +144,8 @@ .if ${IOQ3:MSERVER} MAKE_ARGS+= BUILD_SERVER=1 Q3BIN+= ${Q3SERVER} +USE_RC_SUBR+= ioq3ded +SUB_LIST+= Q3DIR=${Q3DIR} .else MAKE_ARGS+= BUILD_SERVER=0 .endif @@ -189,6 +195,10 @@ .for inst in ${IOQ3_INST} PLIST_FILES+= ${inst:C/.*;//} .endfor +# additional rules for our custom server.cfg from filesdir +.if ${IOQ3:MSERVER} +PLIST_FILES+= ${Q3DIR}/server.cfg +.endif # Generate install target do-install: ${Q3INSTALL} @@ -199,9 +209,11 @@ ${INSTALL_${inst:C/;.*//}} ${BUILDDIR}/${inst:C/[^;]*;//:C/;.*//} \ ${STAGEDIR}${PREFIX}/${inst:C/.*;//} .endfor - -.if !defined(Q3TOTALCONV) -.include "${.CURDIR}/../quake3-data/Makefile.include" +# additional rules for our custom server.cfg from filesdir +.if ${IOQ3:MSERVER} + ${MKDIR} ${STAGEDIR}${Q3DIR} + ${INSTALL_DATA} ${FILESDIR}/server.cfg \ + ${STAGEDIR}${Q3DIR}/server.cfg .endif .include --- files/ioq3ded.in (nonexistent) +++ files/ioq3ded.in (working copy) @@ -0,0 +1,54 @@ +#!/bin/sh +# +# $FreeBSD$ + +# PROVIDE: ioq3ded +# REQUIRE: LOGIN + +#### +# Add the following line to /etc/rc.conf to enable ioq3ded +# +# ioq3ded_enable="YES" +# # optional +# ioq3ded_args="+set dedicated 1 +set com_hunkmegs 32 +exec server.cfg" +# ioq3ded_home="/var/run/ioq3ded" +# ioq3ded_data="%%Q3DIR%%" +# ioq3ded_user="games" +# ioq3ded_group="games" +# +# Note: +# This script is set to execute server.cfg from the system baseq3 +# folder at launch. Most server config can be placed there. +# Some options MUST go on command-line and should be placed in +# "ioq3ded_args" instead - these include "dedicated", +# "com_hunkmegs", etc. +#### + +. /etc/rc.subr + +name=ioq3ded +rcvar=ioq3ded_enable + +load_rc_config $name + +: ${ioq3ded_enable:="NO"} +: ${ioq3ded_args="+set dedicated 1 +set com_hunkmegs 32 +exec server.cfg"} +: ${ioq3ded_home:="/var/run/ioq3ded"} +: ${ioq3ded_data:="%%Q3DIR%%"} +: ${ioq3ded_user:="games"} +: ${ioq3ded_group:="games"} + +start_precmd="ioq3ded_precmd" + +ioq3ded_precmd() +{ + install -d -o ${ioq3ded_user} -g ${ioq3ded_group} ${ioq3ded_home} +} + +pidfile="${ioq3ded_home}/ioq3ded-daemon.pid" +child_pidfile="${ioq3ded_home}/ioq3ded.pid" + +command="/usr/sbin/daemon" +command_args="-c -f -P ${pidfile} -p ${child_pidfile} %%PREFIX%%/bin/ioq3ded +set fs_basepath ${ioq3ded_data} +set fs_homepath ${ioq3ded_home} ${ioq3ded_args}" + +run_rc_command "$1" --- files/server.cfg (nonexistent) +++ files/server.cfg (working copy) @@ -0,0 +1,59 @@ +// SAMPLE SERVER CONFIG FILE +// This file will launch a standard DM server with up to 8 players, +// three bots. + +// +// GENERAL SERVER CONFIG +// +set sv_hostname "ioquake3 Server" // name that appears in server list +set g_motd "ioq3ded on FreeBSD" // message that appears when connecting +set g_log "" // disables writing gamestats to log file + +set sv_maxclients 8 // max number of clients than can connect +set sv_pure 1 // pure server, no altered pak files + +set g_allowvote 0 // disallow voting (players might ruin the map rotation) + +//set rconpassword "secret" // sets RCON password for remote console + +// +// GAME RULE CONFIG +// +set g_gametype 0 // 0:FFA, 1:Tourney, 2:FFA, 3:TD, 4:CTF +set timelimit 10 // Time limit in minutes +set fraglimit 15 // Frag limit + +set g_doWarmup 1 // 20sec warmup time before each map start +set g_inactivity 300 // kick players after being inactive for x seconds +set g_forcerespawn 0 // player has to press primary button to respawn + +// +// BOT CONFIG +// +set bot_enable 1 // Allow bots on the server +set g_spskill 3 // Default skill of bots [1-5] +set bot_minplayers 3 // This fills the server with bots to satisfy the minimum + +// +// MAP CONFIG +// +set dm1 "map q3dm1; set nextmap vstr dm2" +set dm2 "map q3dm2; set nextmap vstr dm3" +set dm3 "map q3dm3; set nextmap vstr dm4" +set dm4 "map q3dm4; set nextmap vstr dm5" +set dm5 "map q3dm5; set nextmap vstr dm6" +set dm6 "map q3dm6; set nextmap vstr dm7" +set dm7 "map q3dm7; set nextmap vstr dm8" +set dm8 "map q3dm8; set nextmap vstr dm9" +set dm9 "map q3dm9; set nextmap vstr dm10" +set dm10 "map q3dm10; set nextmap vstr dm11" +set dm11 "map q3dm11; set nextmap vstr dm12" +set dm12 "map q3dm12; set nextmap vstr dm13" +set dm13 "map q3dm13; set nextmap vstr dm14" +set dm14 "map q3dm14; set nextmap vstr dm15" +set dm15 "map q3dm15; set nextmap vstr dm16" +set dm16 "map q3dm16; set nextmap vstr dm17" +set dm17 "map q3dm17; set nextmap vstr dm18" +set dm18 "map q3dm18; set nextmap vstr dm19" +set dm19 "map q3dm19; set nextmap vstr dm1" +vstr dm1