Compare commits
4 Commits
704173b165
...
da31ae4dc9
Author | SHA1 | Date | |
---|---|---|---|
da31ae4dc9 | |||
d826909066 | |||
17cb07a366 | |||
ce35eb4122 |
@ -254,6 +254,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function core.formspec_escape(text)
|
function core.formspec_escape(text)
|
||||||
|
text = tostring(text)
|
||||||
if text ~= nil then
|
if text ~= nil then
|
||||||
text = text:gsub("\\", "\\\\")
|
text = text:gsub("\\", "\\\\")
|
||||||
text = text:gsub("%]", "\\]")
|
text = text:gsub("%]", "\\]")
|
||||||
|
@ -994,7 +994,7 @@ max_out_chat_queue_size (Maximum size of the out chat queue) int 20
|
|||||||
|
|
||||||
# Enable register confirmation when connecting to server.
|
# Enable register confirmation when connecting to server.
|
||||||
# If disabled, new account will be registered automatically.
|
# If disabled, new account will be registered automatically.
|
||||||
enable_register_confirmation (Enable register confirmation) bool true
|
enable_register_confirmation (Enable register confirmation) bool false
|
||||||
|
|
||||||
[*Advanced]
|
[*Advanced]
|
||||||
|
|
||||||
|
7
doc/multicraftserver.confd
Normal file
7
doc/multicraftserver.confd
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# alpine based server default distro config file
|
||||||
|
USER="multicraft"
|
||||||
|
GROUP="games"
|
||||||
|
LOG="/var/log/multicraft/multicraft.log"
|
||||||
|
CONFIG="/etc/multicraft/multicraft.conf"
|
||||||
|
ARGS=""
|
||||||
|
GAMEID="minenux"
|
9
doc/multicraftserver.defaults
Normal file
9
doc/multicraftserver.defaults
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# DEB/RPM based server default distro config file
|
||||||
|
# for deb place as /etc/defaults/multicraftserver
|
||||||
|
# for rpm place as /etc/sysconfig/multicraftserver
|
||||||
|
USER="multicraft"
|
||||||
|
GROUP="games"
|
||||||
|
LOG="/var/log/multicraft/multicraft.log"
|
||||||
|
CONFIG="/etc/multicraft/multicraft.conf"
|
||||||
|
ARGS=""
|
||||||
|
GAMEID="minenux"
|
87
doc/multicraftserver.init
Normal file
87
doc/multicraftserver.init
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: multicraftserver
|
||||||
|
# Required-Start: $remote_fs $network
|
||||||
|
# Required-Stop: $remote_fs $network
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: multicraftserver daemon by MinenuX
|
||||||
|
# Description: MinenuX dedicated game server for multicraft
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
|
||||||
|
NAME="multicraftserver"
|
||||||
|
DAEMON="/usr/games/$NAME"
|
||||||
|
DESC="multicraft network game server"
|
||||||
|
PIDFILE="/var/run/$NAME.pid"
|
||||||
|
BINARY="/usr/games/$NAME"
|
||||||
|
USER="multicraft"
|
||||||
|
|
||||||
|
test -x $DAEMON || exit 0
|
||||||
|
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
# Include defaults if available
|
||||||
|
if [ -f /etc/default/$NAME ] ; then
|
||||||
|
. /etc/default/$NAME
|
||||||
|
fi
|
||||||
|
|
||||||
|
DAEMON_OPTS = "--logfile $LOG --config $CONFIG --gameid $GAMEID"
|
||||||
|
|
||||||
|
multicraft_start() {
|
||||||
|
start-stop-daemon \
|
||||||
|
--start \
|
||||||
|
--quiet \
|
||||||
|
--pidfile $PIDFILE \
|
||||||
|
--oknodo \
|
||||||
|
--background \
|
||||||
|
--exec $BINARY \
|
||||||
|
--startas $DAEMON \
|
||||||
|
--make-pidfile --chuid $USER \
|
||||||
|
-- $DAEMON_OPTS > /dev/null 2>&1 || return 1
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
multicraft_stop() {
|
||||||
|
start-stop-daemon \
|
||||||
|
--stop \
|
||||||
|
--quiet \
|
||||||
|
--pidfile $PIDFILE \
|
||||||
|
--oknodo \
|
||||||
|
--exec $BINARY || return 1
|
||||||
|
rm -f $PIDFILE
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
log_begin_msg "Starting $DESC: $NAME"
|
||||||
|
multicraft_start
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
log_begin_msg "Stopping $DESC: $NAME"
|
||||||
|
multicraft_stop
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
restart|force-reload)
|
||||||
|
log_begin_msg "Restarting $DESC: $NAME"
|
||||||
|
multicraft_stop && sleep 1 && multicraft_start
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
reload)
|
||||||
|
log_begin_msg "Reloading $DESC: $NAME"
|
||||||
|
start-stop-daemon --signal HUP --exec "$BINARY" --pidfile "$PIDFILE"
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
|
||||||
|
echo "Usage: $0 {start|stop|restart|force-reload|status|reload}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
33
doc/multicraftserver.initd
Normal file
33
doc/multicraftserver.initd
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
description="multicraftserver daemon by MinenuX"
|
||||||
|
|
||||||
|
pidfile="/var/run/$SVCNAME.pid"
|
||||||
|
command="/usr/bin/multicraftserver"
|
||||||
|
|
||||||
|
start_stop_daemon_args="--user ${USER:-multicraft} --group ${GROUP:-games} --make-pidfile --pidfile $pidfile --background --quiet --wait 300"
|
||||||
|
command_args="$ARGS"
|
||||||
|
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need net
|
||||||
|
after firewall
|
||||||
|
}
|
||||||
|
|
||||||
|
optional_command_arg() {
|
||||||
|
if [ -n "$2" ]; then
|
||||||
|
command_args="$command_args $1 $2"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
optional_command_arg --logfile $LOG
|
||||||
|
optional_command_arg --config $CONFIG
|
||||||
|
optional_command_arg --gameid $GAMEID
|
||||||
|
}
|
||||||
|
|
||||||
|
reload() {
|
||||||
|
ebegin "Reloading $SVCNAME"
|
||||||
|
start-stop-daemon --signal HUP --exec "$EXEC" --pidfile "$pidfile"
|
||||||
|
eend $?
|
||||||
|
}
|
13
doc/multicraftserver.logrotate
Normal file
13
doc/multicraftserver.logrotate
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/var/log/multicraft/*.log {
|
||||||
|
daily
|
||||||
|
missingok
|
||||||
|
copytruncate
|
||||||
|
rotate 14
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
notifempty
|
||||||
|
copytruncate
|
||||||
|
postrotate
|
||||||
|
service multicraftserver reload
|
||||||
|
endscript
|
||||||
|
}
|
16
doc/multicraftserver.service
Normal file
16
doc/multicraftserver.service
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=multicraftserver daemon for multicraft.conf by MinenuX
|
||||||
|
Documentation=man:multicraftserver(6)
|
||||||
|
After=network.target
|
||||||
|
RequiresMountsFor=/var/games/multicraft
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=on-failure
|
||||||
|
User=multicraft
|
||||||
|
Group=games
|
||||||
|
ExecStart=/usr/games/multicraftserver --config /etc/multicraft/multicraft.conf --logfile /var/log/multicraft/multicraft.log
|
||||||
|
StandardOutput=null
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
16
doc/multicraftserver@.service
Normal file
16
doc/multicraftserver@.service
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=multicraftserver daemon for %i.conf by MinenuX
|
||||||
|
Documentation=man:multicraftserver(6)
|
||||||
|
After=network.target
|
||||||
|
RequiresMountsFor=/var/games/multicraft
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=on-failure
|
||||||
|
User=multicraft
|
||||||
|
Group=games
|
||||||
|
ExecStart=/usr/games/multicraftserver --config /etc/multicraft/%i.conf --logfile /var/log/multicraft/%i.log --gameid %i
|
||||||
|
StandardOutput=null
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
@ -73,7 +73,7 @@ void set_default_settings()
|
|||||||
settings->setDefault("enable_client_modding", "true");
|
settings->setDefault("enable_client_modding", "true");
|
||||||
settings->setDefault("max_out_chat_queue_size", "20");
|
settings->setDefault("max_out_chat_queue_size", "20");
|
||||||
settings->setDefault("pause_on_lost_focus", "true");
|
settings->setDefault("pause_on_lost_focus", "true");
|
||||||
settings->setDefault("enable_register_confirmation", "true");
|
settings->setDefault("enable_register_confirmation", "false");
|
||||||
|
|
||||||
// Keymap
|
// Keymap
|
||||||
settings->setDefault("remote_port", "30000");
|
settings->setDefault("remote_port", "30000");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user