Skip to content

Commit

Permalink
tidy up ram requirements
Browse files Browse the repository at this point in the history
used data gathered from analytics
  • Loading branch information
dgibbs64 committed Oct 30, 2023
1 parent ceccf92 commit a087c4e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
57 changes: 36 additions & 21 deletions lgsm/modules/check_system_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,57 @@ info_distro.sh
# RAM requirements in megabytes for each game or engine.

if [ "${shortname}" == "ark" ]; then
ramrequirementmb="4000"
ramrequirementgb="4"
ramrequirementgb="7"
elif [ "${shortname}" == "arma3" ]; then
ramrequirementgb="2"
elif [ "${shortname}" == "armar" ]; then
ramrequirementgb="3"
elif [ "${shortname}" == "bt" ]; then
ramrequirementmb="1000"
ramrequirementgb="1"
elif [ "${shortname}" == "mh" ]; then
ramrequirementmb="4000"
ramrequirementgb="4"
elif [ "${shortname}" == "arma3" ]; then
ramrequirementmb="1000"
elif [ "${shortname}" == "cc" ]; then
ramrequirementgb="1"
elif [ "${shortname}" == "rust" ]; then
ramrequirementmb="4000"
elif [ "${shortname}" == "dayz" ]; then
ramrequirementgb="5"
elif [ "${shortname}" == "dodr" ]; then
ramrequirementgb="2"
elif [ "${shortname}" == "hw" ]; then
ramrequirementgb="3"
elif [ "${shortname}" == "mc" ]; then
ramrequirementgb="1"
elif [ "${shortname}" == "pmc" ]; then
ramrequirementgb="2"
elif [ "${shortname}" == "mh" ]; then
ramrequirementgb="4"
elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "wmc" ]; then
ramrequirementmb="1000"
elif [ "${shortname}" == "ns2" ] || [ "${shortname}" == "ns2c" ]; then
ramrequirementgb="1"
elif [ "${shortname}" == "ps" ]; then
ramrequirementmb="2000"
ramrequirementgb="2"
elif [ "${shortname}" == "ns2" ] || [ "${shortname}" == "ns2c" ]; then
ramrequirementmb="1000"
elif [ "${shortname}" == "pvr" ]; then
ramrequirementgb="1"
elif [ "${shortname}" == "pz" ]; then
ramrequirementgb="3"
elif [ "${shortname}" == "rust" ]; then
ramrequirementgb="9"
elif [ "${shortname}" == "sdtd" ]; then
ramrequirementgb="4"
elif [ "${shortname}" == "squad" ]; then
ramrequirementgb="2"
elif [ "${shortname}" == "st" ]; then
ramrequirementmb="1000"
ramrequirementgb="1"
elif [ "${shortname}" == "pvr" ]; then
ramrequirementmb="2000"
elif [ "${shortname}" == "stn" ]; then
ramrequirementgb="3"
elif [ "${shortname}" == "tu" ]; then
ramrequirementgb="2"
elif [ "${shortname}" == "vh" ]; then
ramrequirementgb="2"
else
ramrequirementgb="0.5"
fi

# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM.
if [ "${ramrequirementmb}" ]; then
if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then
if [ "${ramrequirementgb}" ]; then
if [ "${physmemtotalgb}" -lt "${ramrequirementgb}" ]; then
fn_print_dots "Checking RAM"
# Warn the user.
fn_print_warn_nl "Checking RAM: ${ramrequirementgb}G required, ${physmemtotal} available"
echo "* ${gamename} server may fail to run or experience poor performance."
fn_sleep_time_5
Expand Down
3 changes: 3 additions & 0 deletions lgsm/modules/info_stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ cpuusedmhzroundup="$(((cpuusedmhz + 99) / 100 * 100))"
# nearest 100MB
memusedmbroundup="$(((memusedmb + 99) / 100 * 100))"

# Convert any commas to dots.
physmemtotal="${physmemtotal//,/.}"

apisecret="A-OzP02TSMWt4_vHi6ZpUw"
measurementid="G-0CR8V7EMT5"

Expand Down

0 comments on commit a087c4e

Please sign in to comment.