Page 1 of 2
[REQ] MYSQL / MYSQLi support
Posted: 21 Sep 2014, 00:58
by w1lla
Hi,
Hope this can be arranged. Not by doing this through a http request in maniascript but by adding mysql/mysqli support to maniascript.
This way you can write selfmade libraries to a certain database on your own server and still keep all data in your own pocket.
with kind regards,
w1lla.
Re: [REQ] MYSQL / MYSQLi support
Posted: 22 Sep 2014, 06:49
by alividerci
Good idea, i think.
Re: [REQ] MYSQL / MYSQLi support
Posted: 22 Sep 2014, 17:41
by djhubertus
+1 But it was requested several times without results :/
Re: [REQ] MYSQL / MYSQLi support
Posted: 23 Sep 2014, 06:25
by reaby
i don't understand where possible one could need mysql support in maniascript, since i can't imagine any use case.
why can't you just use httpManager for basic io transport for db -> if you intend it to run on localhost ?
Re: [REQ] MYSQL / MYSQLi support
Posted: 03 Oct 2014, 13:41
by djhubertus
reaby wrote:i don't understand where possible one could need mysql support in maniascript, since i can't imagine any use case.
For example to build global tops, to save some data.
Amxx(Counter-Strike mod) bring Mysql support and it's used in thousands of scripts. For example, I made COD:MW 3 mod with level progression and in-game class creator. It uses mysql to collect data and for example build website with this.
Re: [REQ] MYSQL / MYSQLi support
Posted: 03 Oct 2014, 14:11
by TGYoshi
For server-sided scripts you can emit xmlrpc events, which can handle database stuff. For client-sided scripts you really don't want to put your database server details in the script...
Also, MySQLi is a PHP library, completely unrelated to a ManiaScript lib.
ManiaScript first really needs proper data structure support anyway, you can't define custom structures yet (which nearly every language supports).
Re: [REQ] MYSQL / MYSQLi support
Posted: 03 Oct 2014, 15:20
by djhubertus
TGYoshi wrote:For server-sided scripts you can emit xmlrpc events, which can handle database stuff. For client-sided scripts you really don't want to put your database server details in the script...
Yea, but not all servers have xml-rpc enabled/have troubles with sending.
Re: [REQ] MYSQL / MYSQLi support
Posted: 03 Oct 2014, 15:44
by TGYoshi
And you expect them to be able to run a mysql server instead?
Re: [REQ] MYSQL / MYSQLi support
Posted: 03 Oct 2014, 15:58
by djhubertus
TGYoshi wrote:And you expect them to be able to run a mysql server instead?
For some reasons yes and for some reasons no. We can build huge discussion similar to question "Is being positive is better than being negative." but is it really worth time to discuss about opinions what someone like more?
In my previous post I should bold "have troubles with sending". Mysql in my personal opinion is easier to use than xml-rpc and propably someone on this forum will post "xml-rpc is ultra easy."
If devs will not introduce mysql, I will not cry

It's only a suggestion/wish.
Re: [REQ] MYSQL / MYSQLi support
Posted: 03 Oct 2014, 17:22
by TGYoshi
There exist libs to handle all magic for you, just like how you use MySQLi to handle all php <-> mysql server communication.
Although, I'll have to say Nadeo made a huuuuuuge mess of the xmlrpc communication, complicating communication for no reason.
I do like the idea of a database though, but a serverless database (SQLite?) is likely much more convenient since MySQL requires a bunch of stupid setup steps.
My point is more that there are other things which should be done first no matter what. It's impossible to define a custom structure like a common struct (either statically/compile time determined (e.g. C) or runtime/dynamic ones (e.g. JS)), so reading/writing database results in ManiaScript is will be huge pain already...
Adding features like structs to ManiaScript (and severely improving the performance) is one of the essential things to make it a somewhat decent language.
I feel sorry for the guy who wrote the Animations lib for ManiaScript, what a mess thanks to the fact that custom structures aren't possible

.