Преглед изворни кода

Merged release/161224 into master

Daniel Gibbs пре 9 година
родитељ
комит
92ae06c9c9

+ 22 - 1
EmpiresMod/emserver

@@ -1,5 +1,26 @@
 #!/bin/bash
 #!/bin/bash
-# Empires Mod
+# Project: Game Server Managers - LinuxGSM
+# Author: Daniel Gibbs
+# License: MIT License, Copyright (c) 2016 Daniel Gibbs
+# Purpose: Empires Mod | Server Management Script
+# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors
+# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki
+# Website: https://gameservermanagers.com
+
+# Debugging
+if [ -f ".dev-debug" ]; then
+	exec 5>dev-debug.log
+	BASH_XTRACEFD="5"
+	set -x
+fi
+
+version="161221"
+
+##########################
+######## Settings ########
+##########################
+
+#### Server Settings ####
 
 
 ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
 ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
 defaultmap="emp_district"
 defaultmap="emp_district"

+ 0 - 302
Insurgency/cfg/lgsm-default.cfg

@@ -1,302 +0,0 @@
-// ****************************************************************************
-//                                                                            *
-//     Ingurgency - server.cfg                                                *
-//     Version 060116                                                         *
-//                                                                            *
-// ****************************************************************************
-
-// ............................. Basic Settings ............................. //
-
-// Hostname for server.
-hostname "<hostname>"
-
-// Server password - for private servers.
-sv_password ""
-
-// Contact email for server sysop.
-sv_contact "email@example.com"
-
-// LAN Mode - If set the server will not show on the internet.
-// Default: sv_lan 0
-sv_lan 0
-
-// Set maximum server FPS
-// Default: fps_max 300
-fps_max 300
-
-// ........................... RCON Configuration .......................... //
-
-// RCON - remote console password.
-rcon_password "<rconpassword>"
-
-// Number of minutes to ban users who fail rcon authentication
-// min. 0
-sv_rcon_banpenalty 10
-
-// Enable/disable rcon logging
-sv_rcon_log 1
-
-// Max number of times a user can fail rcon authentication before being banned
-// min. 1 max. 20
-sv_rcon_maxfailures 5
-
-// ......................... Matchmaking Playlists ......................... //
-// info: Selecting a playlist will allow the server to show up in matchmaking.
-// Playlists use predefined settings and mapcycle. 
-
-// You do not need to select a mapcycle as the server will cycle though the 
-// predefined playlist mapcycle.
-//
-// If you want to change the predefined playlist mapcycle you can create a 
-// custom mapcycle but only with maps from the playlist mapcycle.
-//
-// You can also create your own custom playlists.
-// http://steamcommunity.com/sharedfiles/filedetails/?id=461776759
-
-// "nwi/comp"
-// "nwi/coop"
-// "nwi/coop_elite"
-// "nwi/coop_hardcore"
-// "nwi/pvp_sustained"
-// "nwi/pvp_tactical"
-//
-sv_playlist "nwi/coop"
-
-// ............................... Map Cycles ............................... //
-// info: There are several predefined mapcycles available that are listed below.
-// You can also create your own custom mapcycle. 
-
-// "mapcycle.txt" - by default this contains the most popular options
-// "mapcycle_all.txt" - all possible map/mode combinations for PvP
-// "mapcycle_ambush.txt" - all ambush (VIP) maps 
-// "mapcycle_attackdefend.txt" - push & strike maps
-// "mapcycle_checkpoint.txt" - all checkpoint maps
-// "mapcycle_comp.txt" - firefight & elimination maps
-// "mapcycle_conquer.txt" - conquer gamemode
-// "mapcycle_cooperative.txt" - survival, coop, hunt maps
-// "mapcycle_firefight.txt" - all firefight maps
-// "mapcycle_flashpoint.txt" - all flashpoint maps
-// "mapcycle_hunt.txt" - all hunt maps
-// "mapcycle_infiltrate.txt" - all infiltrate (CTF) maps
-// "mapcycle_objrespawn.txt" - all firefight & flashpoint featuring respawning for completing objectives
-// "mapcycle_occupy.txt" - all occupy maps
-// "mapcycle_practice.txt"
-// "mapcycle_push.txt" - all push maps
-// "mapcycle_singlelife.txt" - strike & ambush single life modes 
-// "mapcycle_skirmish.txt" - all skirmish maps
-// "mapcycle_strike.txt" - all strike maps
-// "mapcycle_survival.txt" - all survival maps
-// "mapcycle_sustained_combat.txt"
-// "mapcycle_tactical_operations.txt"
-// "mapcycle_workshop.txt" - used by Workshop system
-//
-//mapcyclefile "mapcycle.txt"
-
-// .......................... Coop Mode Settings ............................ //
-// info: Settings for all cooperative gamemodes
-
-// Set the maximum number of human players in Cooperative modes
-// Maximum value: 8
-// Default: mp_coop_lobbysize 6
-//mp_coop_lobbysize 6
-
-// Set the minimum number of bots
-//mp_coop_min_bots 5
-
-// Set the maximum number of bots
-// Maximum value: maxplayers - mp_coop_lobbysize
-//mp_coop_max_bots 18
-
-// ........................... Voting Settings .............................. //
-
-// Allow voting?
-sv_allow_votes 1
-
-// Is map voting enabled?
-sv_map_voting 1
-
-// Allow spectators to vote?
-sv_vote_allow_spectators 0
-
-// A vote that fails cannot be re-submitted for this long
-sv_vote_failure_timer 300
-
-// Can people hold votes to change AI count?
-sv_vote_issue_botcount_allowed 1
-
-// The voting population required to pass a bot count vote
-// min. 0.1 max. 1
-sv_vote_issue_botcount_min_population 0.55
-
-// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes)
-// min. 0 max. 1
-sv_vote_issue_botcount_min_ratio 0.5
-
-// Can people hold votes to change AI difficulty?
-sv_vote_issue_botdifficulty_allowed 1
-
-// The voting population required to pass an AI difficulty vote
-// min. 0.1 max. 1
-sv_vote_issue_botdifficulty_min_population 0.55
-
-// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes)
-// min. 0 max. 1
-sv_vote_issue_botdifficulty_min_ratio 0.5
-
-// Can people hold votes to change the gamemode?
-sv_vote_issue_changegamemode_allowed 0
-
-// Can people hold votes to change levels?
-sv_vote_issue_changelevel_allowed 1
-
-// If enabled, wait until the end of the round to change levels
-sv_vote_issue_changelevel_wait 1
-
-// Can people hold votes to kick players from the server?
-sv_vote_issue_kick_allowed 1
-
-// Can we kick the other team?
-sv_vote_issue_kick_other_team 0
-
-// Can people hold votes to set the next level?
-sv_vote_issue_nextlevel_allowed 1
-
-// Allow players to extend the current map?
-sv_vote_issue_nextlevel_allowextend 0
-
-// Present players with a list of maps to choose from?
-sv_vote_issue_nextlevel_choicesmode 1
-
-// Not allowed to vote for a nextlevel if one has already been set
-sv_vote_issue_nextlevel_prevent_change 1
-
-// How many rounds before map voting can begin
-sv_vote_issue_nextlevel_round_count_delay 1
-
-// The voting population required to pass a next level vote
-// min. 0.1 max. 1
-sv_vote_issue_nextlevel_min_population 0.55
-
-// How strong does the yes vote need to be to win? (2.0 = 2x more voters)
-// min. 1 max. 5
-sv_vote_issue_nextlevel_min_ratio 0.5
-
-// Can people hold votes to restart the game?
-sv_vote_issue_restart_game_allowed 1
-
-// Can people hold votes to restart the round?
-sv_vote_issue_restart_round_allowed 1
-
-// Can people hold votes to scramble the teams?
-sv_vote_issue_scramble_teams_allowed 1
-
-// Can people hold votes to switch the teams?
-sv_vote_issue_switch_teams_allowed 1
-
-// How long should a kick ban last for if a player is kicked for hacking? (minutes)
-sv_vote_kick_ban_duration_cheating 240
-
-// The voting population required to kick a person for hacking
-// min. 0.1 max. 1
-sv_vote_kick_hack_min_population 0.60
-
-// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes)
-// min. 0 max. 1
-sv_vote_kick_hack_min_ratio 0.66
-
-// How long should a kick vote ban someone from the server? (in minutes)
-sv_vote_kick_ban_duration_idle 0
-
-// The voting population required to kick a person for being idle
-// min. 0.1 max. 1
-sv_vote_kick_idle_min_population 0.20
-
-// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes)
-// min. 0 max. 1
-sv_vote_kick_idle_min_ratio 0.5
-
-// How long should a kick ban last for if a player is kicked for team killing? (minutes)
-sv_vote_kick_ban_duration_teamkilling 10
-
-// The voting population required to kick a person for team killing
-// min. 0.1 max. 1
-sv_vote_kick_tk_min_population 0.25
-
-// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes)
-// min. 0 max. 1
-sv_vote_kick_tk_min_ratio 0.66
-
-// How long should a kick ban last for if a player is kicked for trolling? (minutes)
-sv_vote_kick_ban_duration_trolling 60
-
-// The voting population required to kick a person for trolling
-// min. 0.1 max. 1
-sv_vote_kick_troll_min_population 0.40
-
-// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes)
-// min. 0 max. 1
-sv_vote_kick_troll_min_ration 0.66
-
-// The minimum number of players needed on the server to start a vote kick
-sv_vote_kick_min_players 4
-
-// Minimum number of vote attempts required to start an actual vote
-sv_vote_kick_min_voters 3
-
-// The voting population required
-// min. 0 max. 1
-sv_vote_min_population 0.55
-
-// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes)
-// min. 0 max. 1
-sv_vote_min_ratio 0.55
-
-// ............................. Fast Download .............................. //
-// info: Allows custom maps to be downloaded to the client.
-
-// Allows clients to download custom maps and textures etc. from the server at 20 kbps.
-// Default: sv_allowdownload 1
-sv_allowdownload 1
-
-// Allows clients to download custom maps, textures etc. from a web server with no transfer limit.
-// Example:
-// 		server location: maps/custommap.bsp
-// 		web server location: http://example.com/custom/maps/custommap.bsp
-//		sv_downloadurl "http://example.com/custom"
-// Default: sv_downloadurl ""
-sv_downloadurl ""
-
-// ................................ Ban List ............................... //
-
-// sv_nwi_banlist is the official banlist.
-sv_nwi_banlist 1
-
-// personal banlist based on user IDs.
-exec banned_user.cfg
-
-// personal banlist based on user IPs.	
-exec banned_ip.cfg
-
-writeid
-writeip
-
-// ............................. Server Logging ............................. //
-
-//Enables logging to file, console, and udp < on | off >.
-log on
-
-// Log server bans in the server logs.
-// Default: sv_logbans 1
-sv_logbans 1
-
-// Echo log information to the console.
-// Default: sv_logecho 1
-sv_logecho 1
-
-// Log server information in the log file.
-// Default: sv_logfile 1
-sv_logfile 1
-
-// Log server information to only one file.
-// Default: sv_log_onefile 0
-sv_log_onefile 0

+ 0 - 26
QuakeWorld/cfg/lgsm-default.cfg

@@ -1,26 +0,0 @@
-// server info
-hostname                        "<hostname>" // server name shown in server browsers
-rcon_password					"<rconpassword>"
-sv_admininfo                    "lgsm <lgsm@example.com>" // admin name shown in server browsers
-
-// motd (max 15 rows) - this is the welcome message displayed when you connect to a server
-set	k_motd1                     "<hostname>"
-set	k_motd2                     " "
-set	k_motd3                     "Available game modes:"
-set	k_motd4                     "1on1, 2on2, 4on4, 10on10, ffa, ctf"
-//set k_motd5                     "line 5" // etc..
-
-set k_motd_time                 "5" // time motd is displayed in seconds
-
-
-// edit the lines below if you want different gamemodes on this port
-// matchless mode
-set k_matchless                 0               // run ktx as a regular match server or as a matchless (ffa) server (0 = regular, 1 = matchless)
-set k_use_matchless_dir         1               // use configs/usermodes/matchless instead of [...]/ffa (0 = no, 1 = yes)
-
-// free modes
-set k_defmode                   2on2            // default mode on server
-set k_allowed_free_modes        255             // allowed free modes (bit mask):
-                                                //  1=1on1, 2=2on2, 4=3on3, 8=4on4, 16=10on10, 32=ffa 64=ctf 128=hoonymode
-set k_defmap                    dm4             // server homemap. server will change to this when last player leaves the server
-set k_mode                      2               // server mode (1 = duel, 2 = team, 3 = ffa, 4 = ctf)

+ 71 - 30
QuakeWorld/qwserver

@@ -1,54 +1,81 @@
 #!/bin/bash
 #!/bin/bash
-# Quake World (nQuake)
-# Server Management Script
+# Project: Game Server Managers - LinuxGSM
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
+# License: MIT License, Copyright (c) 2016 Daniel Gibbs
+# Purpose: Quake World (nQuake) | Server Management Script
+# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors
+# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki
 # Website: https://gameservermanagers.com
 # Website: https://gameservermanagers.com
+
+# Debugging
 if [ -f ".dev-debug" ]; then
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	BASH_XTRACEFD="5"
 	set -x
 	set -x
 fi
 fi
 
 
-version="210516"
+version="161221"
 
 
-#### Variables ####
+##########################
+######## Settings ########
+##########################
 
 
-# Notification Alerts
-# (on|off)
+#### Server Settings ####
+
+## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
+port="27500"
+ip="0.0.0.0"
+
+## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
+# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
+fn_parms(){
+parms="-port ${port} -game ktx +exec ${servercfg}"
+}
 
 
-# Email
+#### LinuxGSM Settings ####
+
+## Notification Alerts
+# (on|off)
+# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
 emailalert="off"
 emailalert="off"
 email="email@example.com"
 email="email@example.com"
+emailfrom=""
 
 
-# Pushbullet
-# https://www.pushbullet.com/#settings
+# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
 pushbulletalert="off"
 pushbulletalert="off"
 pushbullettoken="accesstoken"
 pushbullettoken="accesstoken"
 channeltag=""
 channeltag=""
 
 
-# Start Variables
-ip="0.0.0.0"
-port="27500"
+## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
 
 
-fn_parms(){
-parms="-port ${port} -game ktx +exec ${servercfg}"
-}
+## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging
+consolelogging="on"
+logdays="7"
 
 
-#### Advanced Variables ####
+#### LinuxGSM Advanced Settings ####
 
 
-# Github Branch Select
+## Github Branch Select
 # Allows for the use of different function files
 # Allows for the use of different function files
 # from a different repo and/or branch.
 # from a different repo and/or branch.
 githubuser="GameServerManagers"
 githubuser="GameServerManagers"
 githubrepo="LinuxGSM"
 githubrepo="LinuxGSM"
 githubbranch="master"
 githubbranch="master"
 
 
-# Server Details
-servicename="quakeworld_server"
+## LinuxGSM Server Details
+# Do not edit
 gamename="QuakeWorld"
 gamename="QuakeWorld"
 engine="quake"
 engine="quake"
 
 
-# Directories
+## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers
+servicename="quakeworld_server"
+
+#### Directories ####
+# Edit with care
+
+## Work Directories
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
 lockselfname=".${servicename}.lock"
@@ -57,6 +84,8 @@ functionsdir="${lgsmdir}/functions"
 libdir="${lgsmdir}/lib"
 libdir="${lgsmdir}/lib"
 tmpdir="${lgsmdir}/tmp"
 tmpdir="${lgsmdir}/tmp"
 filesdir="${rootdir}/serverfiles"
 filesdir="${rootdir}/serverfiles"
+
+## Server Specific Directories
 systemdir="${filesdir}/ktx"
 systemdir="${filesdir}/ktx"
 executabledir="${filesdir}"
 executabledir="${filesdir}"
 executable="./mvdsv"
 executable="./mvdsv"
@@ -64,24 +93,26 @@ servercfg="${servicename}.cfg"
 servercfgdefault="server.cfg"
 servercfgdefault="server.cfg"
 servercfgdir="${systemdir}"
 servercfgdir="${systemdir}"
 servercfgfullpath="${servercfgdir}/${servercfg}"
 servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
 backupdir="${rootdir}/backups"
 backupdir="${rootdir}/backups"
 
 
-# Logging
-logdays="7"
-gamelogdir="${filesdir}/Logs"
+## Logging Directories
+gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
 consolelogdir="${rootdir}/log/console"
-consolelogging="on"
-
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
 emaillog="${scriptlogdir}/${servicename}-email.log"
 emaillog="${scriptlogdir}/${servicename}-email.log"
 
 
-scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
-consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
+## Logs Naming
+scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
+consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"
 
 
-##### Script #####
-# Do not edit
+########################
+######## Script ########
+###### Do not edit #####
+########################
 
 
 # Fetches core_dl for file downloads
 # Fetches core_dl for file downloads
 fn_fetch_core_dl(){
 fn_fetch_core_dl(){
@@ -138,8 +169,18 @@ functionfile="${FUNCNAME}"
 fn_fetch_core_dl
 fn_fetch_core_dl
 }
 }
 
 
+# Prevent from running this script as root.
+if [ "$(whoami)" = "root" ]; then
+	if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then
+		echo "[ FAIL ] Do NOT run this script as root!"
+		exit 1
+	else
+		core_functions.sh
+		check_root.sh
+	fi
+fi
+
 core_dl.sh
 core_dl.sh
 core_functions.sh
 core_functions.sh
-
 getopt=$1
 getopt=$1
 core_getopt.sh
 core_getopt.sh

+ 7 - 7
lgsm/functions/command_postdetails.sh

@@ -17,7 +17,7 @@ postdetails=yes
 
 
 # The options for posttarget are:
 # The options for posttarget are:
 # The default destination - hastebin
 # The default destination - hastebin
-# posttarget="http://hastebin.com"
+# posttarget="https://hastebin.com"
 #
 #
 # Secondary destination - pastebin
 # Secondary destination - pastebin
 # posttarget="http://pastebin.com
 # posttarget="http://pastebin.com
@@ -31,7 +31,7 @@ postdetails=yes
 # to post to pastebin, or
 # to post to pastebin, or
 #  rustserver@gamerig:~$ posttarget= ./rustserver pd
 #  rustserver@gamerig:~$ posttarget= ./rustserver pd
 # to leave the output on the filesystem.
 # to leave the output on the filesystem.
-posttarget=${posttarget="http://hastebin.com"}
+posttarget=${posttarget="https://hastebin.com"}
 
 
 # For pastebin, you can set the expiration period.
 # For pastebin, you can set the expiration period.
 # use 1 week as the default, other options are '24h' for a day, etc.
 # use 1 week as the default, other options are '24h' for a day, etc.
@@ -126,16 +126,16 @@ if [ "${posttarget}" == "http://pastebin.com" ] ; then
 
 
 	 # Output the resulting link.
 	 # Output the resulting link.
 	fn_print_ok_nl "Posting details to pastbin.com for ${postexpire}"
 	fn_print_ok_nl "Posting details to pastbin.com for ${postexpire}"
-	echo "  * url: ${posttarget}${link}"
-elif [ "${posttarget}" == "http://hastebin.com" ] ; then
-	fn_print_dots "Posting details to hastebin.com for ${postexpire}"
+	echo "  Please share the following url for support: ${posttarget}${link}"
+elif [ "${posttarget}" == "https://hastebin.com" ] ; then
+	fn_print_dots "Posting details to hastebin.com (expires 30 days after last view)"
 	sleep 1
 	sleep 1
 	# hastebin is a bit simpler.  If successful, the returned result
 	# hastebin is a bit simpler.  If successful, the returned result
 	# should look like: {"something":"key"}, putting the reference that
 	# should look like: {"something":"key"}, putting the reference that
 	# we need in "key".  TODO - error handling. -CedarLUG
 	# we need in "key".  TODO - error handling. -CedarLUG
-	link=$(curl -s -d "$(<${tmpfile})" "${posttarget}/documents" | cut -d\" -f4)
+	link=$(curl -H "HTTP_X_REQUESTED_WITH:XMLHttpRequest" -s -d "$(<${tmpfile})" "${posttarget}/documents" | cut -d\" -f4)
 	fn_print_ok_nl "Posting details to hastebin.com for ${postexpire}"
 	fn_print_ok_nl "Posting details to hastebin.com for ${postexpire}"
-	echo "  * url: ${posttarget}/${link}"
+	echo "  Please share the following url for support: ${posttarget}/${link}"
 else
 else
 	 fn_print_warn_nl Review the output in "${tmpfile}"
 	 fn_print_warn_nl Review the output in "${tmpfile}"
 	 core_exit.sh
 	 core_exit.sh