English LuaJIT for Dedicated Server icon

9 comments
11.01.20 01:54:52 pm
like 9 like it!
278 kb, 16 Downloads
MikuAuahDark
User
Offline Off
SUPPORTED CS2D VERSION: 1.0.1.1
IF STABILITY OF YOUR SCRIPT IS CONCERN, DON'T USE

∗ Description ∗
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 cs2d [LuaJIT/LuaFFI] Fix for os.clock (6) and file cs2d [LuaJIT/LuaFFI] Socket Support (4) again.

You may hear LuaJIT before and yes, LuaJIT was used in thread news CS2D Beta 0.1.2.6 but removed in thread news CS2D Beta 0.1.2.7 due to stability issues. I believe the instability was caused by ancient BlitzMax (or whatever CS2D uses) so this method only patches the Lua API inside the dedicated server to use LuaJIT and nothing else.

∗ Installation ∗
Windows: Extract
cs2djit.dll
and
cs2djitwrapper.exe
into your CS2D server root directory, beside
cs2d_dedicated.exe

Linux: Extract
cs2djit.sh
and
libcs2djit.so
. Make sure you have LuaJIT library (i386) installed (Debian-based: libluajit-5.1)

If your Linux VPS supports Docker, you can use user EngiN33R's Docker image which additionally support LuaRocks so you can install Lua C modules with ease.

∗ Running ∗
Windows: Run
cs2djitwrapper.exe
in your server directory.
Linux: Run
cs2djit.sh
in your CS2D server directory, example:
bash cs2djit.sh


∗ Source Code ∗
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

∗ Permission ∗
This program is licensed under MIT license. In short:
√ You can use this.
√ Modify.

∗ Notes ∗
• This guaranteed 100% to break when new CS2D is released. Please check this file for up-to-date version!
• Executables only tested in Debian 10 and Windows 10.
• In Windows, the LuaJIT lua51.dll is NOT bundled along with the downloads. It's your responsibility to provide your own LuaJIT lua51.dll because you have to be consistent in using compilers there as mixing DLLs between different (MSVC) compilers can cause problems. (hint: look for "luajit windows binaries").
• If you have any issues which directly related to this, please tell me.
• If your script breaks after using this, please tell me in UnrealSoftware Discord server, #cs2d-scripting channel.
• This only benefits server scripters. This is not form of cheat/hack that can give players unfair advantage

∗ Version History ∗
> 20200111
ADDED Initial release.
imageimage
edited 5×, last 15.01.20 02:34:55 pm
ok This file has been reviewed and approved by Starkkz (11.01.20 10:35:59 pm)

Comments

9 comments
Goto Page
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in
17.01.20 10:07:49 am
like I like it!
Up
Infinite Rain
Reviewer
Offline Off
This is awesome, actually. Lua JIT also supports goto which is amazing as well. Good job.
15.01.20 12:05:25 pm
like I like it!
Up
VADemon
User
Offline Off
There's no reason not to like it. ❤
Thanks for taking your time.
13.01.20 09:10:29 am
like I like it!
Up
Gaios
Security Supporter
Offline Off
Maybe you can record benchmark speed tests between old and new Lua.
12.01.20 02:38:12 am
like I like it!
Up
Oops321
User
Offline Off
Nice job
11.01.20 08:27:03 pm
like I like it!
Up
mrc
User
Offline Off
I'm using it, ty.
11.01.20 08:10:14 pm
like I like it!
Up
Goo
User
Offline Off
This should've been integrated.
11.01.20 07:48:27 pm
like I like it!
Up
TrialAndError
User
Offline Off
Nice.
11.01.20 02:01:08 pm
like I like it!
Up
Kapachino
User
Offline Off
Here, get a like.
11.01.20 01:58:42 pm
like I like it!
Up
Hajt
User
Offline Off
I have tested. Works like a charm.
To the start Previous 1 Next To the start