Browse Source

fix quakec

pull/4200/head
Daniel Gibbs 2 years ago
parent
commit
e460105bcd
  1. 18
      lgsm/modules/info_game.sh
  2. 14
      package-lock.json
  3. 2
      package.json

18
lgsm/modules/info_game.sh

@ -46,7 +46,7 @@ fn_info_game_quakec() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}"="$(sed -n "s/^.*${2}\s\+\"\(.*\)\"/\1/p;q" "${servercfgfullpath}")" eval "${1}"="$(sed -n '/^[[:space:]]*set hostname[[:space:]]*\"\?\(.*\)\?\"/ { s//\1/p;q }' "${servercfgfullpath}")"
} }
# Config Type: json # Config Type: json
@ -67,7 +67,7 @@ fn_info_game_sqf() {
# [^/]* This matches any character except a forward slash (/) zero or more times. # [^/]* This matches any character except a forward slash (/) zero or more times.
# ${2} matches the literal string "${2}". # ${2} matches the literal string "${2}".
# = " This matches the literal string " = ". # = " This matches the literal string " = ".
# \(.*\)": This is a capturing group that matches any sequence of characters until a closing double quote. It captures the desired value for later use. # \(.*\)" This is a capturing group that matches any sequence of characters until a closing double quote. It captures the desired value for later use.
# s//\1/ This performs a substitution with an empty search pattern (//) and replaces it with the captured value inside the capturing group (\1). # s//\1/ This performs a substitution with an empty search pattern (//) and replaces it with the captured value inside the capturing group (\1).
# p at the end of the s command tells sed to print the resulting line if there was a match. # p at the end of the s command tells sed to print the resulting line if there was a match.
# q at the end of the s command tells sed to quit after the first match. # q at the end of the s command tells sed to quit after the first match.
@ -107,6 +107,17 @@ fn_info_game_valve_keyvalues() {
fi fi
} }
fn_info_game_java_properties() {
# sed is used to process the file.
# -n option tells sed to suppress output by default.
# s/ indicates that the command is a substitution command.
if [ -f "${servercfgfullpath}" ]; then
eval "${1}"="$(sed -n 's/.*= *//^${2}\(.*\)/\1/p' "${servercfgfullpath}")"
fi
}
# Config Type: ini # Config Type: ini
# Parameters: false # Parameters: false
# Comment: ; or # # Comment: ; or #
@ -1188,6 +1199,9 @@ fn_info_game_lo() {
# Example: motd=SERVERNAME # Example: motd=SERVERNAME
# Filetype: properties # Filetype: properties
fn_info_game_mc() { fn_info_game_mc() {
if [ -f "${servercfgfullpath}" ]; then
fi
# Config # Config
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}" servername="${unavailable}"

14
package-lock.json

@ -7,7 +7,7 @@
"name": "linuxgsm", "name": "linuxgsm",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"prettier": "^2.7.1", "prettier": "^2.8.8",
"prettier-plugin-sh": "^0.12.8" "prettier-plugin-sh": "^0.12.8"
} }
}, },
@ -127,9 +127,9 @@
"dev": true "dev": true
}, },
"node_modules/open": { "node_modules/open": {
"version": "8.4.1", "version": "8.4.2",
"resolved": "https://registry.npmjs.org/open/-/open-8.4.1.tgz", "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz",
"integrity": "sha512-/4b7qZNhv6Uhd7jjnREh1NjnPxlTq+XNWPG88Ydkj5AILcA5m3ajvcg57pB24EQjKv0dK62XnDqk9c/hkIG5Kg==", "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"define-lazy-prop": "^2.0.0", "define-lazy-prop": "^2.0.0",
@ -159,9 +159,9 @@
"dev": true "dev": true
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.8.4", "version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin-prettier.js"

2
package.json

@ -5,7 +5,7 @@
"test": "tests" "test": "tests"
}, },
"devDependencies": { "devDependencies": {
"prettier": "^2.7.1", "prettier": "^2.8.8",
"prettier-plugin-sh": "^0.12.8" "prettier-plugin-sh": "^0.12.8"
}, },
"scripts": { "scripts": {

Loading…
Cancel
Save