Forum

> > CS2D > Scripts > Structuring Lua C modules in CS2D. Suggestions?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Structuring Lua C modules in CS2D. Suggestions?

6 replies
To the start Previous 1 Next To the start

old Structuring Lua C modules in CS2D. Suggestions?

MikuAuahDark
User Off Offline

Quote
So I've successfully wrote my CS2D Lua wrapper (Thread: thread cs2d Calling CS2D's statically Lua function. Legal?) and now I need suggestion about how to structure the DLLs/.so

What is CS2D Lua Wrapper >


First approach would be having liblua5.1.so/lua51.dll act as the wrapper itself and Lua C modules compiled depends on that DLL/shared object.
√ In case of CS2D update, only single file needs to be updated.
× In Linux, CS2D (dedicated server) must be run with
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./CS2D


A second approach would be compiling the C modules and the CS2D Lua wrapper together. It's just single file "cs2dlua.c" that must be added to module compilation.
√ No need of specialized command to run the CS2D (dedicated server)
× In case of CS2D update, all modules must be recompiled

I'm also open to other suggestion that maybe interesting.

Regards,
AuahDark

old Re: Structuring Lua C modules in CS2D. Suggestions?

ohaz
User Off Offline

Quote
setting the LD_LIBRARY_PATH is rather common and should be the preferred way in this case. As you usually start cs2d automated anyways, nobody ever needs to enter this more than once so it's fine.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview