JackStone Posted January 29, 2016 Share Posted January 29, 2016 I am currently trying to get this resource:http://www.garagegames.com/community/blogs/view/13528Working 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: ". 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:http://https://dev.mysql.com/doc/connector-cpp/en/connector-cpp-examples-complete-example-1.htmlProvides what looks like a simple implementation, would something like this, exposed to script, work in T3D?Thanks! Quote Link to comment Share on other sites More sharing options...
chriscalef Posted January 29, 2016 Share Posted January 29, 2016 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! Quote Link to comment Share on other sites More sharing options...
JackStone Posted January 29, 2016 Author Share Posted January 29, 2016 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? Quote Link to comment Share on other sites More sharing options...
JackStone Posted January 30, 2016 Author Share Posted January 30, 2016 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/11/working-with-odbc-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 Quote Link to comment Share on other sites More sharing options...
chriscalef Posted January 30, 2016 Share Posted January 30, 2016 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! Quote Link to comment Share on other sites More sharing options...
JackStone Posted January 30, 2016 Author Share Posted January 30, 2016 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=2290and the file itself is here:http://www.phoenixgamedevelopment.com/downloads/mysql.cppHopefully that will be of some use to someone! Quote Link to comment Share on other sites More sharing options...
rlranft Posted January 31, 2016 Share Posted January 31, 2016 I applaud the ODBC approach - it should make it easier to adapt to different RDBMS. Quote Link to comment Share on other sites More sharing options...
JackStone Posted January 31, 2016 Author Share Posted January 31, 2016 Thank you!Although, if I'm honest, I used that one because it seemed to be the simplest, rather than for any other reason! Quote Link to comment Share on other sites More sharing options...
JackStone Posted February 5, 2016 Author Share Posted February 5, 2016 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%row = resultset.getrow(%i)Any ideas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.