Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix prefire plugin #175

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.env copy
/custom_files/*
cs2
tmp
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ ENV SRC_DIR="/home/cs2-modded-server"

WORKDIR $SRC_DIR

COPY . $SRC_DIR
COPY custom_files $SRC_DIR/custom_files

COPY install_docker.sh \
run.sh \
start.sh \
stop.sh \
$SRC_DIR

COPY game/csgo $SRC_DIR/game/csgo

USER steam

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
".NETCoreApp,Version=v8.0": {
"OpenPrefirePrac/1.0.0": {
"dependencies": {
"CounterStrikeSharp.API": "1.0.239",
"CounterStrikeSharp.API": "1.0.296",
"MaxMind.Db": "4.1.0",
"MaxMind.GeoIP2": "5.2.0",
"Microsoft.Extensions.Localization.Abstractions": "8.0.3"
Expand All @@ -17,7 +17,7 @@
"OpenPrefirePrac.dll": {}
}
},
"CounterStrikeSharp.API/1.0.239": {
"CounterStrikeSharp.API/1.0.296": {
"dependencies": {
"McMaster.NETCore.Plugins": "1.4.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -34,8 +34,8 @@
},
"runtime": {
"lib/net8.0/CounterStrikeSharp.API.dll": {
"assemblyVersion": "1.0.239.0",
"fileVersion": "1.0.239.0"
"assemblyVersion": "1.0.296.0",
"fileVersion": "1.0.296.0"
}
}
},
Expand Down Expand Up @@ -562,12 +562,12 @@
"serviceable": false,
"sha512": ""
},
"CounterStrikeSharp.API/1.0.239": {
"CounterStrikeSharp.API/1.0.296": {
"type": "package",
"serviceable": true,
"sha512": "sha512-gUL9lTypVUkoz/tgmkA49tAeIxOsZML8cIFAwJbZOmLXlTRfObVjg/isACG/6f8nKC+yqJxbcVQoyDNghUyCfg==",
"path": "counterstrikesharp.api/1.0.239",
"hashPath": "counterstrikesharp.api.1.0.239.nupkg.sha512"
"sha512": "sha512-mmf7iRKWa88vvsv1XQCw8hwxzsiPB2O5DPKAdr5zzPSod8hoplBHA80ITCIExGpoi1e3yXdT24JdsqW6pTGh8w==",
"path": "counterstrikesharp.api/1.0.296",
"hashPath": "counterstrikesharp.api.1.0.296.nupkg.sha512"
},
"MaxMind.Db/4.1.0": {
"type": "package",
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
// EquipPlayer:
// 0: Disabled. To avoid interfering with other weapon related plugins
// 1: Enabled. Players will be equipped with AK47, deagle and nades every time they respawn.
// 2: Behavior tree based aim lock: Hard mode.
"EquipPlayer": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@
"map.de_vertigo.mid_to_ct": "From mid to CT spawn",
"map.de_vertigo.a_ramp": "Attack A site from A ramp",
"map.de_vertigo.a_short": "Attack A site from scaffold",
"map.de_vertigo.b_retake": "Retake B site from elevator"
"map.de_vertigo.b_retake": "Retake B site from elevator",
"map.de_train.a_main_to_a_site": "Attack A site from A main",
"map.de_train.ivy_to_a": "Attack A site from ivy",
"map.de_train.ladder_to_a": "Attack A site from ladder room"
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@
"map.de_vertigo.mid_to_ct": "Da metade à desova do CT",
"map.de_vertigo.a_ramp": "Atacar o local A a partir da rampa A",
"map.de_vertigo.a_short": "Atacar um local a partir de um andaime",
"map.de_vertigo.b_retake": "Retomar o local B do elevador"
"map.de_vertigo.b_retake": "Retomar o local B do elevador",
"map.de_train.a_main_to_a_site": "Atacar o local A a partir do local A principal",
"map.de_train.ivy_to_a": "Ataque um site de hera",
"map.de_train.ladder_to_a": "Ataque um site da sala de escada"
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@
"map.de_vertigo.mid_to_ct": "从中路到警家",
"map.de_vertigo.a_ramp": "从 A 斜坡进攻 A 包点",
"map.de_vertigo.a_short": "从 A 小进攻 A 包点",
"map.de_vertigo.b_retake": "从连接回防 B 区"
"map.de_vertigo.b_retake": "从连接回防 B 区",
"map.de_train.a_main_to_a_site": "从匪口进攻 A 包点",
"map.de_train.ivy_to_a": "从绿通进攻 A 包点",
"map.de_train.ladder_to_a": "从红楼梯进攻 A 包点"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ivy_to_a ladder_to_a
8 0.6
-799.923523 764.033020 -152.128754 -0.395995 -96.058731 0.000000
-494.921600 377.192688 -216.128754 0.242000 146.337631 0.000000 False
-252.413940 217.506058 -38.12875 13.375969 144.401321 0.000000 False
82.860367 276.386993 -38.12875 9.833968 160.606430 0.000000 False
153.679504 371.550995 -216.128754 -1.320025 168.372910 -0.000000 False
883.995117 228.855545 -212.128754 -0.132760 168.244156 0.000000 False
820.984314 543.652405 -212.128754 -0.638734 -178.652206 0.000000 False
388.033691 628.562988 -216.128754 -0.792763 -174.987366 0.000000 False
-123.780762 597.380371 -216.128754 -0.528766 -170.953171 0.000000 False
-172.141724 689.967407 -172.12875400000001 2.771238 -156.001251 0.000000 False
-284.108765 56.425835 -216.128754 -0.088769 122.065254 0.000000 False
-446.978668 689.968811 -172.12875400000001 6.885214 -120.146896 0.000000 False
-454.654053 -352.149048 -215.128754 -0.572788 92.158836 0.000000 False
852.076355 110.031799 -212.128769 -0.594846 -179.411575 0.000000 False
679.408386 -45.148926 -216.128754 0.285154 170.997086 0.000000 False
-145.701416 -93.392944 -216.128754 -0.264790 131.393509 0.000000 False
-120.711975 17.675282 -216.128754 0.197158 153.044113 0.000000 False
467.170746 -42.869473 -142.12875400000001 4.311153 169.456787 0.000000 False
297.097626 -400.067902 -217.918945 0.131212 144.934875 0.000000 False
582.480957 -282.321960 -208.560776 0.483135 167.683289 0.000000 False
620.992371 -205.853088 -216.128754 0.373128 179.078827 0.000000 False
396.986237 -572.192932 -216.039291 -0.198844 127.145378 0.000000 False
303.338196 -711.579956 -138.570236 5.455121 104.353149 0.000000 False
550.031250 -394.001282 -208.128754 1.781115 91.510689 0.000000 False
-834.347900 645.238770 -207.128754
-786.816711 524.593506 -207.128754
-531.812378 468.774170 -207.128754
-428.748718 409.407898 -207.128754
-364.657349 -85.334290 -207.128754
-203.557373 -195.876160 -207.128754
73.312851 -231.036743 -207.128754
591.981628 -238.315308 -207.128754
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
a_main_to_a_site ladder_to_a
6 0.6
634.021729 1639.587280 -152.128754 0.308034 -25.734137 0.000000
1170.230225 544.047607 -212.128754 0.154028 100.786972 0.000000 False
1025.744141 455.669861 -212.128754 0.022028 90.754974 0.000000 False
1176.968750 1249.968872 -216.128815 1.056034 162.387817 0.000000 False
811.726746 -37.783752 -212.128754 0.593957 68.732033 0.000000 False
1265.227295 483.677216 -212.128754 0.132021 118.092789 0.000000 False
1234.968750 640.031555 -212.128754 0.285957 138.134796 0.000000 False
1474.238403 297.973480 -212.128754 0.506023 132.216385 0.000000 False
1234.967651 727.893127 -212.128754 0.858019 175.160339 0.000000 False
658.641418 0.619767 -216.128754 -0.307988 53.470242 0.000000 False
1613.966797 587.967224 -212.128738 0.484013 178.957443 0.000000 False
755.031555 359.028137 -212.128754 0.418001 26.729132 0.000000 False
393.617554 -198.685059 -176.71868899999998 2.112020 45.243027 -0.000000 False
640.189270 622.643494 -216.128754 -0.593975 -24.356567 0.000000 False
854.967163 593.968750 -212.128754 -0.945984 -77.011505 0.000000 False
1092.243408 -235.860840 -212.128754 0.110013 112.870514 0.000000 False
1210.471680 -236.930969 -212.128754 -0.572041 132.562637 0.000000 False
294.663605 -74.264587 -142.12875400000001 4.202036 30.730724 0.000000 False
103.308479 -67.892395 -216.128754 -0.945982 22.488110 0.000000 False
-448.191650 -249.443481 -216.128754 -0.153978 20.617834 0.000000 False
-233.373169 -54.561462 -216.128754 -0.087978 14.853843 0.000000 False
-235.760742 35.312992 -216.128754 -0.615978 9.705833 0.000000 False
-450.367432 119.689476 -216.128754 -0.593978 5.129843 0.000000 False
-320.323364 164.927383 -38.128727 7.700017 3.589828 0.000000 False
72.672592 347.817657 -38.789524 12.606039 -9.148296 0.000000 False
-1.844116 404.800812 -216.128754 -0.527956 -13.592201 0.000000 False
-813.833923 599.679382 -216.128754 -0.263971 -13.482258 0.000000 False
-333.391663 616.754761 -216.128754 -0.527974 -19.752289 0.000000 False
280.206573 423.352844 -216.128754 -0.747978 -20.742416 0.000000 False
334.193909 428.037598 -34.12875 17.820009 -24.306448 0.000000 False
597.717163 -205.860107 -216.128754 -0.109987 67.183167 0.000000 False
697.968811 -378.492065 -208.128754 0.792013 88.325546 0.000000 False
708.966125 385.968750 -216.128754 -0.109986 -85.136429 -0.000000 False
694.966492 446.667236 -34.12875 36.740131 -85.166718 0.000000 False
301.962982 -282.481079 -216.128754 -0.065855 15.401340 0.000000 False
930.520081 1599.816650 -207.128754
1053.649048 1601.462280 -207.128754
1068.693359 482.798492 -203.128754
900.025208 329.945312 -203.128754
883.065918 200.626892 -203.128754
676.671204 144.580399 -207.128754
672.928223 -229.367798 -207.128754
574.897034 -354.808228 -199.128754
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
a_main_to_a_site ivy_to_a
6 0.6
-604.705017 -156.010742 79.871246 6.666003 -90.490669 0.000000
-1042.623779 -1675.035522 -154.12875400000001 -3.014456 82.656349 0.000000 False
-920.083496 -1671.031250 -154.12875400000001 -3.168456 90.048477 0.000000 False
-905.061218 -832.030212 -154.12875400000001 -11.968463 93.348389 0.000000 False
-1266.872314 -498.772095 -89.128754 -3.168426 -1.371474 0.000000 False
-792.942139 -922.964355 -200.31781 -8.976435 135.344620 0.000000 False
-1323.972412 -392.541138 -133.128769 -10.560395 -46.669415 0.000000 False
-443.965820 -323.753784 -215.128784 -5.654380 -176.315582 0.000000 False
-629.939270 -400.110596 -213.628784 -6.556372 177.525208 0.000000 False
-346.882935 -193.622986 -216.128754 -0.462367 -128.868042 0.000000 False
-172.118454 69.289505 -216.128754 0.087631 -125.114006 0.000000 False
-12.211589 317.024719 -38.12878 12.693586 -124.638725 0.000000 False
-356.858704 277.344391 -216.128754 0.483558 -97.168694 0.000000 False
-305.345276 194.304718 -38.12875 17.775425 -105.910759 0.000000 False
-508.458801 444.551697 -216.128754 0.241568 -85.442902 0.000000 False
-136.139648 -12.567688 -216.128754 0.901537 -141.961792 0.000000 False
900.114685 280.175049 -212.128754 -0.110384 -161.387695 0.000000 False
463.436981 -22.604126 -141.96875 3.035631 -168.846924 0.000000 True
452.028259 -175.716797 -142.12875400000001 5.345616 -178.395035 0.000000 False
659.033325 -180.572571 -216.128754 0.087619 -178.681076 0.000000 False
361.964050 -320.499756 -216.97847 0.065602 170.649109 0.000000 False
-580.031250 571.967834 -216.128754 -0.066451 -69.303520 0.000000 False
361.967957 -426.852722 -216.589035 0.439602 146.734604 0.000000 False
155.344193 391.554199 -216.128754 0.813584 -100.779037 0.000000 False
432.324615 -610.923889 -216.128754 -0.506425 128.004898 0.000000 False
320.131836 -719.966919 -137.70263699999998 6.907570 107.404877 0.000000 False
162.486023 -572.900208 -216.128754 0.681576 77.009193 0.000000 False
659.033447 -104.491905 -216.128754 -0.440419 -119.385506 0.000000 False
550.029968 -394.026855 -208.128784 1.517579 95.326332 0.000000 False
-595.146057 -355.884277 26.709655999999995
-595.702209 -413.556152 26.794792
-599.692505 -494.022827 -26.765671
-597.572510 -552.911499 -26.963295
-660.500671 -552.889954 -27.327007
-738.819763 -547.968445 -80.128754
-1281.559814 -552.514832 -80.128754
-1281.442261 -460.785034 -80.17532299999999
-1283.193115 -391.164917 -124.128754
-1278.609619 -341.909668 -124.128754
-1185.735596 -340.476074 -124.130951
-1073.405640 -338.103394 -204.628769
-423.779053 -340.960571 -206.128754
-418.625977 -191.646362 -207.128754
610.810120 -212.069092 -207.128754
Binary file not shown.
80 changes: 62 additions & 18 deletions scripts/check-updates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# chmod +x check-updates.sh

extract_mods() {
local README_URL="https://raw.githubusercontent.com/kus/cs2-modded-server/master/README.md"
curl -s "$README_URL" | awk '
local README_URL="https://raw.githubusercontent.com/kus/cs2-modded-server/master/README.md"

curl -s "$README_URL" | awk '
BEGIN { modsStarted = 0 }
$0 == "Mod | Version | Why" { modsStarted = 1; next } # Look for the specific header to start
modsStarted == 1 && $0 ~ /^$/ { exit } # Stop at the first empty line
Expand All @@ -30,14 +30,14 @@ extract_mods() {

# Log function for printing messages to the console
log() {
local message="$1"
# Print the current date and time along with the message
echo "$(date '+%Y-%m-%d %H:%M:%S') - $message"
local message="$1"
# Print the current date and time along with the message
echo "$(date '+%Y-%m-%d %H:%M:%S') - $message"
}

# Function to fetch the latest release name of a GitHub repository
fetch_latest_release() {
local url="$1"
local url="$1"

if [[ $url == *"github.com"* ]]; then
# Use curl to fetch the releases page content
Expand Down Expand Up @@ -66,10 +66,9 @@ fetch_latest_release() {
fi
}


# Function to fetch when the last commit was made to a GitHub repository
fetch_last_updated() {
local url="$1"
local url="$1"

if [[ $url == *"github.com"* ]]; then
# Get last commit date
Expand All @@ -84,16 +83,60 @@ fetch_last_updated() {
fi
}

download_and_extract_latest_release() {
local repo_url="$1"
if [[ $repo_url != *"github.com"* ]]; then
echo "Unsupported URL: $repo_url"
return
fi

local repo_name=$(echo "$repo_url" | awk -F'github.com/' '{print $2}')
local latest_release_urls=$(curl -s "https://api.github.com/repos/${repo_name}/releases/latest" | grep "browser_download_url" | cut -d '"' -f 4)

if [ -z "$latest_release_urls" ]; then
echo "No releases found for $repo_name"
return 1
fi

rm -rf "./tmp/${repo_name}"
local temp_dir="./tmp/${repo_name}"
mkdir -p "${temp_dir}" || echo ""

for url in $latest_release_urls; do
local temp_file="./tmp/$(basename "$url")"
local temp_unzip_dir="$temp_dir"

if [[ "$temp_file" == *"windows"* ]]; then
temp_unzip_dir="$temp_unzip_dir/windows"
elif [[ "$temp_file" == *"linux"* ]]; then
temp_unzip_dir="$temp_unzip_dir/linux"
fi

if [ ! -f "$temp_file" ]; then
echo "Downloading latest release from $url..."
curl -L -o "$temp_file" "$url"
fi

echo "Extracting $temp_file..."
case "$temp_file" in
*.tar.gz) tar --overwrite -xzf "$temp_file" -C "$temp_unzip_dir" >/dev/null ;;
*.zip) unzip -o "$temp_file" -d "$temp_unzip_dir" >/dev/null ;;
*) echo "Unsupported file format: $temp_file" ;;
esac
done
echo "Latest release downloaded and extracted to $temp_dir"
}

main() {
# Call extract_mods and read output into an array
IFS=$'\n' read -rd '' -a modList < <(extract_mods)
# Reset IFS to default
IFS=$' \t\n'
# Loop through the array and print each mod's details
for mod in "${modList[@]}"; do
IFS='|' read -ra ADDR <<< "$mod" # Split each line based on "|"
IFS=$'\n' read -rd '' -a modList < <(extract_mods)

# Reset IFS to default
IFS=$' \t\n'

# Loop through the array and print each mod's details
for mod in "${modList[@]}"; do
IFS='|' read -ra ADDR <<<"$mod" # Split each line based on "|"
local name="${ADDR[0]}"
local url="${ADDR[1]}"
local version="${ADDR[2]}"
Expand All @@ -105,13 +148,14 @@ main() {
echo -e "\033[0;32m✅ ${name} ${latest_release}\033[0m"
else
echo -e "\033[0;33m📦 ${name} update available ${version} > ${latest_release} ${url}\033[0m"
download_and_extract_latest_release "$url"
fi
elif [ -n "$last_updated" ]; then
echo -e "\033[1;30m🔍 ${name} ${version} - Last updated ${last_updated} ${url}\033[0m"
else
echo -e "\033[0;31m🚫 ${name} ${version} - Could not find latest version or last update ${url}\033[0m"
fi
done
done
}

main