Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jul 2019 19:32:52 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r507066 - in head/games/ioquake3: . files
Message-ID:  <201907211932.x6LJWqJR012756@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pi
Date: Sun Jul 21 19:32:52 2019
New Revision: 507066
URL: https://svnweb.freebsd.org/changeset/ports/507066

Log:
  games/ioquake3: add rc file and example server.cfg file
  
  The port games/ioquake3-server can be used to build a dedicated
  server for Quake 3 and derivative games.  However, it doesn't come
  with an rc script to launch at system boot or on demand.  This makes
  it a bit tricky to run the dedicated server.
  
  ioquake3-server is a "slave port" that depends on the master port
  games/ioquake3 to actually retrieve the source and build everything.
  
  This patch adds an rc script plus example server.cfg to the master port,
  which is installed when the slave port is installed.
  
  PR:		239180
  Submitted by:	kennedy.greg@gmail.com

Added:
  head/games/ioquake3/files/ioq3ded.in   (contents, props changed)
  head/games/ioquake3/files/server.cfg   (contents, props changed)
Modified:
  head/games/ioquake3/Makefile

Modified: head/games/ioquake3/Makefile
==============================================================================
--- head/games/ioquake3/Makefile	Sun Jul 21 19:28:10 2019	(r507065)
+++ head/games/ioquake3/Makefile	Sun Jul 21 19:32:52 2019	(r507066)
@@ -116,6 +116,10 @@ SMP_MAKE_ARGS_OFF=	BUILD_CLIENT_SMP=0
 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 <bsd.port.options.mk>
 
 .if !defined(DESKTOP_ENTRIES)
@@ -140,6 +144,8 @@ MAKE_ARGS+=	BUILD_CLIENT=0
 .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 @@ IOQ3_INST+=	DATA;../../${doc};${DOCSDIR}/${doc}
 .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 @@ do-install: ${Q3INSTALL}
 	${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 <bsd.port.mk>

Added: head/games/ioquake3/files/ioq3ded.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/ioquake3/files/ioq3ded.in	Sun Jul 21 19:32:52 2019	(r507066)
@@ -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"

Added: head/games/ioquake3/files/server.cfg
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/ioquake3/files/server.cfg	Sun Jul 21 19:32:52 2019	(r507066)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907211932.x6LJWqJR012756>