![∗](img/star.gif)
![∗](img/star.gif)
This does NOT support closed-beta dedicated server as in
![thread](img/i_forum.png)
![cs2d](img/icons/cs2d.png)
![∗](img/star.gif)
![∗](img/star.gif)
This patches the dedicated server to use LuaJIT instead of Lua 5.1. This also allows Lua C (external) modules to be loaded without memory errors. This works for Windows and Linux (patches for macOS are welcome).
So what's better with LuaJIT? This execute your scripts faster, I mean, faster. You can also use one of the best feature in LuaJIT which is FFI. This means you can use
![file](img/i_file.png)
![cs2d](img/icons/cs2d.png)
![∗](img/star.gif)
![∗](img/star.gif)
Unfortunately CentOS 7 stuck with very old glibc. CentOS 7 users must compile from source and not download the prebuilt binaries from this site!
![∗](img/star.gif)
![∗](img/star.gif)
You may hear LuaJIT before and yes, LuaJIT was used in
![thread](img/i_forum.png)
![news](img/icons/news.png)
![thread](img/i_forum.png)
![news](img/icons/news.png)
From UnrealSoftware Discord:
![user](img/i_friend.png)
Is it possible to have custom build of CS2D dedicated server with LuaJIT instead of Lua 5.1 as an option?
![user](img/i_friend.png)
@
MikuAuahDark Last time we tried that everything exploded. Won't go through the pain of trying it again. Not worth it.
![user](img/i_friend.png)
![user](img/i_friend.png)
Even by adding notice that "it's unstable"?
![user](img/i_friend.png)
I can't add it as an option. either broken shit or working shit. The decision has already been made.
So, CS2DJIT is born. It provides users an option to use LuaJIT for their server.
![∗](img/star.gif)
![∗](img/star.gif)
Windows: Extract
cs2djit.dll,
cs2djitwrapper.exe, and optionally
lua51.dll(notice below!) into your CS2D server root directory, beside
cs2d_dedicated.exe
Linux: Extract
cs2djit.shand
libcs2djit.sointo your CS2D server root directory, beside
cs2d_dedicatedexecutable. Make sure you have 32-bit LuaJIT library installed (
libluajit-5.1:i386for Debian and its derivatives)
If your Linux VPS supports Docker, you can use
![user](img/i_friend.png)
![∗](img/star.gif)
![∗](img/star.gif)
Windows: Run
cs2djitwrapper.exein your server directory.
Linux: Run
cs2djit.shin your CS2D server directory, example:
bash cs2djit.sh
![∗](img/star.gif)
![∗](img/star.gif)
In case you think this steals stuff, it's not. You can compile it yourself if you really paranoid. Here's the source code: https://github.com/MikuAuahDark/cs2djit
![∗](img/star.gif)
![∗](img/star.gif)
This program is licensed under MIT license. In short:
![√](img/ok.gif)
![√](img/ok.gif)
![√](img/ok.gif)
![×](img/x.gif)
![∗](img/star.gif)
![∗](img/star.gif)
![•](img/dot.gif)
![•](img/dot.gif)
![•](img/dot.gif)
![•](img/dot.gif)
cs2djitwrapper.exeas virus or unwanted software. This maybe caused by antivirus doesn't quite like MinGW-compiled binaries. Rest assured that binaries are compiled by GitHub Actions from Debian or if you really paranoid you can compile this program yourself from source above.
![•](img/dot.gif)
![•](img/dot.gif)
![•](img/dot.gif)
![•](img/dot.gif)
![∗](img/star.gif)
![∗](img/star.gif)
This is caused if your script uses
os.executeor
io.popen. Save this script as
sys/lua/autorun/ld_preload_unset.lua
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
if not jit then return end local ffi = require("ffi") ffi.cdef[[ int unsetenv(const char *name); ]] if os.getenv("LD_PRELOAD") then 	ffi.C.unsetenv("LD_PRELOAD") end
![∗](img/star.gif)
![∗](img/star.gif)
If you have code something like this:
1
2
3
2
3
function foo(...) 	print(arg[1], arg[2], arg[3]) end
argyourself:
1
2
3
4
2
3
4
function foo(...) 	local arg = {...} -- this 	print(arg[1], arg[2], arg[3]) end
![∗](img/star.gif)
![∗](img/star.gif)
![>](img/i_next.png)
![INFO](img/clog_info.png)
![thread](img/i_forum.png)
![news](img/icons/news.png)
![CHANGED](img/clog_changed.png)
![>](img/i_next.png)
![INFO](img/clog_info.png)
![thread](img/i_forum.png)
![news](img/icons/news.png)
![>](img/i_next.png)
![INFO](img/clog_info.png)
![thread](img/i_forum.png)
![news](img/icons/news.png)
![>](img/i_next.png)
![FIXED](img/clog_fixed.png)
![CHANGED](img/clog_changed.png)
![CHANGED](img/clog_changed.png)
![CHANGED](img/clog_changed.png)
![>](img/i_next.png)
![ADDED](img/clog_added.png)
edited 28×, last 26.07.24 05:18:42 am
Approved by Starkkz
Download
370 kb, 877 Downloads