-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add install.bat/install_linux.sh JitOpt config default true->false
- Loading branch information
Showing
11 changed files
with
238 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
set "processes=dontstarve_steam_x64.exe dontstarve_dedicated_server_nullrenderer_x64.exe" | ||
|
||
for %%p in (%processes%) do ( | ||
tasklist /FI "IMAGENAME eq %%p" 2>NUL | find /I "%%p" >NUL | ||
if !errorlevel! == 0 ( | ||
echo [INFO] kill processes: %%p | ||
taskkill /F /IM "%%p" >NUL | ||
timeout /t 1 /nobreak >NUL | ||
) | ||
) | ||
|
||
set "source=.\bin64\windows" | ||
set "destination=..\..\bin64" | ||
|
||
if not exist "%source%" ( | ||
echo [ERROR] source directory not find: %source% | ||
timeout /t 5 | ||
exit /b 1 | ||
) | ||
|
||
if not exist "%destination%" ( | ||
echo [INFO] create directory: %destination% | ||
mkdir "%destination%" | ||
) | ||
|
||
echo [INFO] moving files... | ||
robocopy "%source%" "%destination%" /E /MOVE /NP /NFL /NDL >NUL | ||
|
||
if errorlevel 8 ( | ||
echo [ERROR] moving files failed | ||
timeout /t 5 | ||
exit /b 1 | ||
) | ||
|
||
|
||
echo [INFO] install success | ||
timeout /t 5 | ||
exit /b 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
|
||
# List of processes to check | ||
processes=("dontstarve_steam_x64.exe" "dontstarve_dedicated_server_nullrenderer_x64.exe") | ||
|
||
# Terminate running processes | ||
for process in "${processes[@]}"; do | ||
pid=$(pgrep -f "$process") | ||
if [ -n "$pid" ]; then | ||
echo "[INFO] Terminating process: $process (PID: $pid)" | ||
kill -9 "$pid" | ||
sleep 1 # Wait for the process to fully terminate | ||
fi | ||
done | ||
|
||
# Set path variables | ||
source="bin64/linux" | ||
destination="../../bin64" | ||
|
||
# Verify if the source directory exists | ||
if [ ! -d "$source" ]; then | ||
echo "[ERROR] Source directory does not exist: $source" | ||
exit 1 | ||
fi | ||
|
||
# Create the destination directory if it doesn't exist | ||
if [ ! -d "$destination" ]; then | ||
echo "[INFO] Creating destination directory: $destination" | ||
mkdir -p "$destination" | ||
fi | ||
|
||
# Move files | ||
echo "[INFO] Moving files..." | ||
cp -r "$source"/* "$destination/" | ||
|
||
# Check the result of the operation | ||
if [ $? -eq 0 ]; then | ||
echo "[INFO] Files moved successfully" | ||
else | ||
echo "[ERROR] An error occurred while moving files" | ||
exit 1 | ||
fi | ||
|
||
if [ -f dontstarve_steam_x64 ] && [ $(stat -c%s dontstarve_steam_x64) -gt 1048576 ]; then | ||
mv dontstarve_steam_x64 dontstarve_steam_x64_1 | ||
|
||
cat > dontstarve_steam_x64 <<'EOF' | ||
#!/bin/bash | ||
export LD_LIBRARY_PATH=./lib64 | ||
export LD_PRELOAD=./lib64/libInjector.so | ||
./dontstarve_steam_x64_1 | ||
EOF | ||
|
||
chmod +x dontstarve_steam_x64 | ||
echo "rewrite dontstarve_steam_x64 success" | ||
else | ||
echo "skip rewrite dontstarve_steam_x64." | ||
fi | ||
|
||
if [ -f dontstarve_dedicated_server_nullrenderer_x64 ] && [ $(stat -c%s dontstarve_dedicated_server_nullrenderer_x64) -gt 1048576 ]; then | ||
mv dontstarve_dedicated_server_nullrenderer_x64 dontstarve_dedicated_server_nullrenderer_x64_1 | ||
|
||
cat > dontstarve_dedicated_server_nullrenderer_x64 <<'EOF' | ||
#!/bin/bash | ||
export LD_LIBRARY_PATH=./lib64 | ||
export LD_PRELOAD=./lib64/libInjector.so | ||
./dontstarve_dedicated_server_nullrenderer_x64_1 | ||
EOF | ||
|
||
chmod +x dontstarve_dedicated_server_nullrenderer_x64 | ||
echo "rewrite dontstarve_dedicated_server_nullrenderer_x64 success" | ||
else | ||
echo "skip rewrite dontstarve_dedicated_server_nullrenderer_x64." | ||
fi | ||
|
||
|
||
echo "[INFO] Operation completed successfully" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,90 @@ | ||
local lc = locale | ||
|
||
local function translate(t) | ||
t.zhr = t.zh | ||
t.zht = t.zht or t.zh | ||
return t[lc] or t.en | ||
end | ||
name = "DontStarveLuaJit2" | ||
|
||
description = translate( | ||
{ | ||
zh = [[ | ||
替换游戏底层虚拟机为LUAJIT,加速整个游戏 | ||
务必备份你的存档,不保证没错误 | ||
]], | ||
en = [[ | ||
Replacing the underlying VM with luajit speeds up the entire game. | ||
Be sure to back up your archive, there is no guarantee that there are no bugs! | ||
]] | ||
} | ||
) | ||
|
||
author = "fesil" | ||
|
||
version = "0.5.11" | ||
|
||
forumthread = "https://github.com/fesily/DontStarveLuaJit2" | ||
|
||
api_version = 10 | ||
|
||
dont_starve_compatible = true | ||
reign_of_giants_compatible = true | ||
dst_compatible = true | ||
|
||
--TODO: need test compatible without the mod | ||
client_only_mod = true | ||
server_only_mod = true | ||
|
||
-- Preview image | ||
icon_atlas = "images/modicon.xml" | ||
icon = "modicon.tex" | ||
|
||
configuration_options = { | ||
{ | ||
name = "EnabledJIT", | ||
label = translate({ en = "EnabledJIT", zh = "开启JIT模式" }), | ||
hover = translate({ | ||
en = "It is recommended to turn off if the lag is severe in the game", | ||
zh = "在游戏中卡顿现象很严重的建议关闭" | ||
}), | ||
options = { | ||
{ description = "On", data = true }, | ||
{ description = "Off", data = false }, | ||
}, | ||
default = true | ||
}, | ||
{ | ||
name = "JitOpt", | ||
label = translate({ en = "JitOpt", zh = "JIT优化选项" }), | ||
hover = translate({ | ||
en = "maybe faster, maybe slower.", | ||
zh = "可能更快, 可能更慢." | ||
}), | ||
options = { | ||
{ description = "On", data = true }, | ||
{ description = "Off", data = false }, | ||
}, | ||
default = true, | ||
}, | ||
{ | ||
name = "ModBlackList", | ||
label = translate({ en = "ModJitBlackList", zh = "MODJit黑名单" }), | ||
hover = translate({ en = "some mod is't not appropriate", zh = "有些mod可能写的特别,不合适jit模式" }), | ||
options = { | ||
{ description = "On", data = true }, | ||
{ description = "Off", data = false }, | ||
}, | ||
default = true | ||
}, | ||
{ | ||
name = "DisableJITWhenServer", | ||
label = translate({ en = "DisableJITWhenServer", zh = "服务器禁用luajit" }), | ||
hover = translate({ en = "server process disable luajit mod", zh = "服务器进程禁用luajit" }), | ||
options = { | ||
{ description = "On", data = true }, | ||
{ description = "Off", data = false }, | ||
}, | ||
default = false | ||
} | ||
} | ||
--restart_required = true | ||
local lc = locale | ||
|
||
local function translate(t) | ||
t.zhr = t.zh | ||
t.zht = t.zht or t.zh | ||
return t[lc] or t.en | ||
end | ||
name = "DontStarveLuaJit2" | ||
|
||
description = translate( | ||
{ | ||
zh = [[ | ||
替换游戏底层虚拟机为LUAJIT,加速整个游戏 | ||
务必备份你的存档,不保证没错误 | ||
]], | ||
en = [[ | ||
Replacing the underlying VM with luajit speeds up the entire game. | ||
Be sure to back up your archive, there is no guarantee that there are no bugs! | ||
]] | ||
} | ||
) | ||
|
||
author = "fesil" | ||
|
||
version = "0.6.0" | ||
|
||
forumthread = "https://github.com/fesily/DontStarveLuaJit2" | ||
|
||
api_version = 10 | ||
|
||
dont_starve_compatible = true | ||
reign_of_giants_compatible = true | ||
dst_compatible = true | ||
|
||
--TODO: need test compatible without the mod | ||
client_only_mod = true | ||
|
||
-- Preview image | ||
icon_atlas = "images/modicon.xml" | ||
icon = "modicon.tex" | ||
|
||
configuration_options = { | ||
{ | ||
name = "EnabledJIT", | ||
label = translate({ en = "EnabledJIT", zh = "开启JIT模式" }), | ||
hover = translate({ | ||
en = "It is recommended to turn off if the lag is severe in the game", | ||
zh = "在游戏中卡顿现象很严重的建议关闭" | ||
}), | ||
options = { | ||
{ description = "On", data = true }, | ||
{ description = "Off", data = false }, | ||
}, | ||
default = true | ||
}, | ||
{ | ||
name = "JitOpt", | ||
label = translate({ en = "JitOpt", zh = "JIT优化选项" }), | ||
hover = translate({ | ||
en = "maybe faster, maybe slower.", | ||
zh = "可能更快, 可能更慢." | ||
}), | ||
options = { | ||
{ description = "On", data = true }, | ||
{ description = "Off", data = false }, | ||
}, | ||
default = false, | ||
}, | ||
{ | ||
name = "ModBlackList", | ||
label = translate({ en = "ModJitBlackList", zh = "MODJit黑名单" }), | ||
hover = translate({ en = "some mod is't not appropriate", zh = "有些mod可能写的特别,不合适jit模式" }), | ||
options = { | ||
{ description = "On", data = true }, | ||
{ description = "Off", data = false }, | ||
}, | ||
default = true | ||
}, | ||
{ | ||
name = "DisableJITWhenServer", | ||
label = translate({ en = "DisableJITWhenServer", zh = "服务器禁用luajit" }), | ||
hover = translate({ en = "server process disable luajit mod", zh = "服务器进程禁用luajit" }), | ||
options = { | ||
{ description = "On", data = true }, | ||
{ description = "Off", data = false }, | ||
}, | ||
default = false | ||
} | ||
} | ||
--restart_required = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.