LuaSQL CS2D (win32) OUTDATED 
23 comments

Instead, you can use @

Today i'd like to share what i made today, to get work MySQL-connection via LUA under Counter-Strike 2D.
Features:





Website:
http://www.keplerproject.org/luasql/

Code:
1
env:connect(sourcename[,username[,password[,hostname[,port]]]])
Install:
Copy file "mysql.dll" to cs2d "luasql" folder.
Copy files "libmysql.dll, lua5.1.dll" to C:\Windows\System32 folder
May you should register these files via regsvr32
edited 10×, last 19.04.21 02:06:26 pm

Comments
23 commentsLog in!
You need to log in to be able to write comments!Log in

NULL has written:
Great contribution, but most of kids like G-Unit won't simply get it
Is obvious that you've a problem with me. I think you've nightmares with me. Take some pills and let alone this obsession with me
About that LuaSQL, is very good.

I found a workaround for my own question below. If you build the shared lib from source and link it with the object files for Lua itself, it works. I now have a working Lua SQLite 3 lib for Linux. It's similar to Lua SQL, except that it only supports SQLite 3, of course. If someone is interested in trying it, send me a PM.
19.10.13 02:14:16 pm

I'm sure you could have a database server running as a background job on Linux rather easily just invoke (&) ampersand at the end of the command. After the script handler filename or the like, just make sure it runs in the background and ensure it's functional. The script handler will then deal with the data that comes in and hopefully securely sanitize the data as it comes into the database.
Although obviously you'd have to install some type of SQL database server on the PC (this works for Windows too, don't worry). I'd pick preferebly SQLite3 or MySQL, since SQLite3 is more file-based in a way. I'm quite sure that it can work flawlessly when done right. No need to cry over spilled milk but I've noticed that some aren't able to set things up like I do nor are they willing to experiment with what you can do as it's all free methods in the means of downloading and installing. Anyways there's various ways to do things with databases and this is just how I would of done it. It may seem like a "horrible" idea at first glance but at least it works and you don't see me complaining.
Although obviously you'd have to install some type of SQL database server on the PC (this works for Windows too, don't worry). I'd pick preferebly SQLite3 or MySQL, since SQLite3 is more file-based in a way. I'm quite sure that it can work flawlessly when done right. No need to cry over spilled milk but I've noticed that some aren't able to set things up like I do nor are they willing to experiment with what you can do as it's all free methods in the means of downloading and installing. Anyways there's various ways to do things with databases and this is just how I would of done it. It may seem like a "horrible" idea at first glance but at least it works and you don't see me complaining.

Very interesting project. I tried to get CS2D working with sqlite3 on Linux, but I get: undefined symbol: lua_settop. From this link I draw the conclusion that CS2D needs to be linked with the flags -Wl,--export-dynamic. Does anyone know if there's a workaround or would we have to ask some help from DC in order to be able to use external Lua libs on Linux?
edited 1×, last 19.10.13 06:04:37 pm

@
KimKat:
It is bloody retarded what you want to do. Wine is shit.

It is bloody retarded what you want to do. Wine is shit.
Admin/mod comment:

Thanks for all!
Got idea from SA-MP, by Pawn scripts (same as lua) which also could connect to MySQL, and it's can be useful if you run some roleplay server
Edit:
If someone wants linux version i can post it, but no time to test it, cause i have no another machine yet, and i don't want to install linux for this pc just this why..

Got idea from SA-MP, by Pawn scripts (same as lua) which also could connect to MySQL, and it's can be useful if you run some roleplay server

Edit:
If someone wants linux version i can post it, but no time to test it, cause i have no another machine yet, and i don't want to install linux for this pc just this why..
edited 3×, last 16.10.13 02:51:30 pm

@
ohaz: Well, just don't over do it. Wine is very good to be honest. It's a compatability layer. It's better than not being able to run anything at all.
It seems
Marcell won't provide anything else, so either go here to download Lua libraries and executables which are cross-platform and try to fix it yourselves or don't.

It seems

Good idea, just pretty useless since it's windows only.
@
KimKat: What. Using wine under linux to run a cs2d dedicated with some random dlls. Really? That's almost like running a virtual machine with windows on it on your linux server (which probably is just a virtual machine itself) to run the cs2d server in there...
@
Marcell: Rather add linux compatibility (you can just use the mysql libraries for linux)
@

@

16.10.13 11:47:00 am

Pretty cool submission
Marcell. Will be useful to store user information for Lua scripts and the likes.
@
EngiN33R: On Linux you could have Wine to emulate the Lua MySQL stuff rather easily. You could even emulate CS2D with this thing along with Lua MySQL directly. This page will tell you how to do that. Either way
Marcell would be great if you could create some Winelibs for this as it'd simplify things. For more information on running things on Linux, BSD, Solaris and Mac OS X then go to Wine website.
If you use Wine to emulate software. You can place the DLL files by default into this path right here...

@


If you use Wine to emulate software. You can place the DLL files by default into this path right here...
Code:
1
~/.wine/drive_c/windows/system32/

It's nice and all, though a majority of serious servers run on Linux machines. The libraries you provide are Windows-only, which significantly narrows down the target audience. If you really want to make a good project, you should find time for it.