CTRL+SHIFT+B
компилирование проекта (из репозитория) AMXModX в папку назначения (рантайм, сервер) включая плагины, которые находятся в своих подпапках с сохранинеием иерархии файлов с подсветкой ошибок (в том числе в коде) и предупреждений компилятора без лишней информации в выводе ответа компилятора. - .vscode/build.sh
#!/bin/bash
# Define color codes
RED="\e[31m"
ORANGE="\e[33m"
GREEN="\e[32m"
WHITE_BG="\e[47m"
RESET="\e[0m"
# Define directories
destenitionDir="D:/Dev/HLDS_Server/cstrike/addons/amxmodx"
scriptingDir="$destenitionDir/scripting"
srcDir="$PWD/cstrike/addons/amxmodx/scripting"
# Function to print colored messages
print_color() {
local color="$1"
local message="$2"
echo -e "${color}${message}${RESET}"
}
# Function to compile a .sma file
compile_sma() {
local smaFile="$1"
local outputPluginDir="$2"
pluginName=$(basename "${smaFile%.sma}")
relativeDir=$(dirname "${smaFile#$srcDir}")
outputPlugin="$outputPluginDir/${pluginName}.amxx"
# Create the output plugin directory if it doesn't exist
mkdir -p "$outputPluginDir"
# Print the name of the .sma file with white background
print_color $WHITE_BG " - Compiling: $(basename $smaFile)"
# Compile the .sma file and capture its output, excluding the lines with version and copyright info
compile_output=$("$scriptingDir/amxxpc" \
"$smaFile" \
-i"$srcDir" \
-i"$srcDir/include" \
-i"$srcDir/ReDeathmatch" \
-o"$outputPlugin" 2>&1 | grep -vE "AMX Mod X Compiler|Copyright|Could not locate output file")
# Check if there are any errors or warnings in the compile output
if echo "$compile_output" | grep -qi "error"; then
error_lines=$(echo "$compile_output" | grep -i "error")
warning_lines=$(echo "$compile_output" | grep -i "warning")
print_color $RED "❌ $error_lines"
if [ -n "$warning_lines" ]; then
print_color $ORANGE "⚠ $warning_lines"
fi
elif echo "$compile_output" | grep -qi "warning"; then
warning_lines=$(echo "$compile_output" | grep -i "warning")
print_color $ORANGE "⚠ $warning_lines"
else
print_color $GREEN " ✅ Compiled: $(basename $smaFile)"
fi
}
# Find and compile all .sma files in the source directory and its subdirectories
find "$srcDir" -name "*.sma" -type f | while read smaFile; do
relativeDir=$(dirname "${smaFile#$srcDir}")
outputPluginDir="$destenitionDir/plugins$relativeDir"
compile_sma "$smaFile" "$outputPluginDir"
done
echo ""
# Copy directories without confirmation with green messages
print_color $GREEN " - Copying configs..."
cp -rf "$srcDir/../configs"/* "$destenitionDir/configs"
print_color $GREEN " - Copying data..."
cp -rf "$srcDir/../data"/* "$destenitionDir/data"
- .vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Build AMX Mod X Plugins",
"type": "shell",
"command": "bash",
"args": [".vscode/build.sh"],
"group": {
"kind": "build",
"isDefault": true
}
}
],
"presentation": {
"echo": false,
"reveal": "always",
"focus": false,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
},
"problemMatcher": {
"fileLocation": "autoDetect",
"owner": "problem",
"pattern": {
// Group 1 - filename (absolute path for filename)
// Group 2 - beginning line
// Group 3 - ending line (optional)
// Group 4 - error | warning (severity)
// Group 5 - message
"regexp": "(.+?)\\((\\d+)(?:\\s--\\s(\\d+))?\\)\\s:\\s(warning|error)\\s\\d+:\\s(.*)",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
Проблема:BiZaJe,
это зависит от названия файла дампа ядра, настройки операционной системы, в том числе параметра:
/proc/sys/kernel/core_pattern
$ sysctl -w kernel.core_pattern=core
$ wsl.exe -l -v
NAME STATE VERSION
* docker-desktop Running 2
docker-desktop-data Running 2
wsl
, а далее посмотреть core_patterncat /proc/sys/kernel/core_pattern
/mnt/wslg/dumps/core.%e
./hlds_run -debug ...
это являлось проблемой, так скрипт hlds_run ищет дамп ядра в папке hlds, и не сможет найти, и не покажет подробной информации из дампа.