mySQL support in T3D 3.6, Windows 10, VS Studio 2015 Express

Expanding and utilizing the engine via C++.
9 posts Page 1 of 1
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Fri Jan 29, 2016 5:10 am
I am currently trying to get this resource:

http://www.garagegames.com/community/blogs/view/13528

Working in T3D 3.6, under Windows 10, with Visual Studio 2015 Express edition.

This resource works find on the same machine and compiler with an earlier version of the engine, but with the new version, it gives me the following error when I try to start the exe:

"Unable to load game library: <Projectpath><Project_DEBUG.dll>".

It is complaining about my project exe! The exe works fine when I remove the two .cc files in the above resource. I suspect the issue is that the mysql libs are out of date, and wont run properly on the new version of T3D.

Is there an up to date resource available?

How difficult is it to integrate the most up to date mysql connector with T3D?

This link:
https://dev.mysql.com/doc/connector-cp ... ple-1.html

Provides what looks like a simple implementation, would something like this, exposed to script, work in T3D?

Thanks!
chriscalef
Posts: 375
Joined: Mon Feb 09, 2015 7:48 pm
by chriscalef » Fri Jan 29, 2016 8:41 pm
I can't help you at the moment with mysql, but on the off chance you just want an SQL database and don't really care about all the powerful features of mysql in particular, it's very easy to get SQLite 3 going in T3D. I have a T3D branch on my github (github.com/ChrisCalef/T3D - sqlite) with only the files you need (look in source/console, or check the commit history).

But by all means keep us informed if you get an up to date mysql working, that would sure be nice!
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Fri Jan 29, 2016 9:43 pm
Hi, thanks for your reply.

I don't really need much power in the DB, but I do need a shared database, and sqllite is embedded, is it not?

IE, I am making a multiplayer game, which may have (hopefully :P) a relatively large number of people accessing the database regularly, and transferring a relatively large amount of data. From what I've read about sqlite, it doesn't like to be used in this way, is that correct?
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Sat Jan 30, 2016 4:38 am
I have this working now, I used ODBC in the end, and this site gave me some sample code which I used:
https://bobobobo.wordpress.com/2009/07/ ... bc-from-c/#

I will clean it up a bit and add some script helper functions, and then post it on my site. I think mySQL is a pretty vital resource to have in any serious engine, so it would be good to get some exposure for it. sqlLite is great for single player data storage but for heavy duty databases, MMO's, RPG's, etc etc, it's not really optimal at all.

I made a post about it on my site here:

http://phoenixgamedevelopment.com/blog/?p=2285
chriscalef
Posts: 375
Joined: Mon Feb 09, 2015 7:48 pm
by chriscalef » Sat Jan 30, 2016 7:18 pm
Hey, right on, glad you figured it out, and thanks for sharing! Yeah, I didn't think SQLite would help, because you're right, it's mainly for local data, that's what I use it for. I guess in a pinch you could run it embedded in your dedicated server build... but mysql is clearly much better, and yeah it would help T3D a lot to have a ready resource for it.

Good luck with your game, look forward to hearing about it!
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Sun Jan 31, 2016 12:42 am
Thanks for your reply! Yeah, I briefly considered using sqlite in a dedicated server build, (since I will be doing the same thing with mySQL anyway for licensing and security reasons) but I thought mySQL would be the "correct" way to do this.

I finished my (admittedly basic) implemenation, the instructions are on my blog here:
http://phoenixgamedevelopment.com/blog/?p=2290

and the file itself is here:
http://www.phoenixgamedevelopment.com/d ... /mysql.cpp

Hopefully that will be of some use to someone!
rlranft
Posts: 298
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Sun Jan 31, 2016 4:26 pm
I applaud the ODBC approach - it should make it easier to adapt to different RDBMS.
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Sun Jan 31, 2016 9:17 pm
Thank you!

Although, if I'm honest, I used that one because it seemed to be the simplest, rather than for any other reason!
JackStone
Posts: 67
Joined: Fri Oct 02, 2015 1:03 am
by JackStone » Fri Feb 05, 2016 2:55 am
I have noticed a fairly major oversight with this in that I didn't add any container class to expose the results of the mySQL queries to script.

What would be the best way of doing this?

I need to convert the sql statement containing, potentially, many rows from the database into a data structure that I can access and parse quickly from script.

I am guessing a custom class using a vector would be the correct approach here, but how do I expose that vector to script, so that I can do something like:

for(%i=0;%i<numberofresultsreceived;%i++)
%row = resultset.getrow(%i)

Any ideas?
9 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests