MySQL & C++

Started by
12 comments, last by hplus0603 18 years, 4 months ago
Hello, I am working on a project where I would like an easy way to integrate between a web site & a game. This is to simply pull highscores, and figure out whos logged in online (amoung a few other things). I decided one of the best ways to do this would be to utilize a MySQL database, and interact with it via both the application and the site. When I developed PokerVitals (pokervitals.com) for PTI, I used PHP glue code and curl, providing a simple REST based way of logging a user in to a subscription service, but I think there is defintly a better way here. The Problem I am not really sure where to start as far as accessing a mySQL server via an external application (using C++ here). I have thought for a while that a convinient way would be to use CURL and some scripted glue code in PHP, but I would prefer something cleaner. Im pretty sure there is already some code out there that does this, so its probably best not to undertake a large "recreate the wheel" project. So if anyone has any sudgestions or recommendations, drop me a hand! Thanks Richard P. Cesar
Advertisement
Also, I _AM_ aware of mysql's C library, but I fail to find license information on there site, and this is for a commercial project.
IIRC, the MySQL C library is under the GPL license, which means, if you are putting the code on the actual client, then it is no good for commercial use.

There is also MySQL++ - however this is just a wrapper of the MySQL C library, and therefore probably suffers the same license restrictions.

If you have some sort of central server app running which communicates with the database, then you're fine, since you are not redistrbuting it.

It's probably a good idea to not put DB code onto an untrusted client anyway - you are giving away your connection string and therefore the username/password/IP/etc... Which just opens you up to attacks. Hell, they could just play with the memory on your app and not even bother connecting to it themselves, and just cause havoc via your app...

Here's one idea - consider setting up a web service which your client calls to set high scores and stuff - then you won't have to put any actual DB calls on the client, or even have to create an always-running server app. I don't know much about using web services in C++ thought - it might not even be worth the hassle, but it seems to me like your best bet w/o having a stand alone trusted server app.
FTA, my 2D futuristic action MMORPG
Actualy, as I mentioned thats what I was doing with a previous project. Created a REST based PHP web service to interact with the database. So yes, it can be done.

It is on a seperate server though, thankfully, the main thing im worrying about is the same thing as many... the new GPL rule thats supposidly in the works, which would ban it from commercial use on a server aswell. (the new GPL license)
damn, that was fast... i had edited my post [grin].

i had no idea there was any new rules in the works...... i'd be surprised to hear something like that... it would really cost ALOT of people alot of money........ i really hope nothing like that comes up... good luck with whatever you do..
FTA, my 2D futuristic action MMORPG
taken from wikipedias referance to Stallman's April 7, 2005 talk in philadelphia

http://en.wikipedia.org/wiki/GPL#GPLv3

"Overall it's going to be the same, but there's just various areas where we're looking at changes in details. And, one of them is that we might put in some kind of patent retaliation clause, but it's hard to see what's a good one to do. We'll put in something to deal with this case of public use on a server the public connects to. We may put in something designed to prohibit putting the software into something that won't let the user, that refuses to run a modified version if the user installs one."

The key phrase here is:

"We'll put in something to deal with this case of public use on a server the public connects to."

What the FSF is refering to is requiring software used in publicly connected servers to be availiable opensource. Meaning if you write something (using GPL code), and host it on your server, its still under GPL (ie: requires you to make the source availiable). You have to completely prevent the public from touching the software, even remotely.

Yes, its going to suck.

OSS has its good and its bad. Stallman is, in many ways, a communist. (ok guys, bash me for it). The OSS movement was great in some areas, but its going to hurt us indies like it or not, this being one of them.

That being said, I see more and more people moving to the Mozilla, zLib, and BSD licenses, so all you can do is pray.

[Edited by - PaulCesar on December 17, 2005 5:46:41 AM]
hah.... i can't imagine how many commercial products would have to chunk up change if something like that ever went through... *looks in hplus's direction*.

sounds like a bait and switch to me [grin].
FTA, my 2D futuristic action MMORPG
Quote:Original post by PaulCesar
"We'll put in something to deal with this case of public use on a server the public connects to."

What the FSF is refering to is requiring software used in publicly connected servers to be availiable opensource. Meaning if you write something, and host it on your server, its still under GPL (ie: requires you to make the source availiable).


Actually, from this I'm reading that the server software should be open source. So, that if you modify your copy of Apache and run it on a public server, you must supply your modified Apache-code to the public. It does NOT mean that anything you host on that server, must be public too.

I'm no legal buff, not even a native English speaker, but that's just my two cents.

Which may actualy be a good thing in some ways I suppose, but very bad for the OSS movement. Many industries have depended on it for the past 6-8 years, to revert back to how it was before is going to seriously mess many businesses up (providing the licenses do not enter a more liberal license scheme)

I will say though, that stallman is going to kill the GPL's usablility in the commercial sector completely.
Dabono, thats not what I was refering to, you are correct.

But this is where it will hurt. Everyone that developes say.. a game based server (such as an MMORPG, MUD, etc) that uses open source code, will have to make the source code to that publicly availiable.

This causes many.. and i mean MANY problems:

1) With people having access to the server code, they will be able to find vulnerabilities and take advantage of them.

2) Competition will be able to legaly copy your codebase

3) Fans will be able to make servers, removing any real profit margin from running a subscription based service.

EDIT: This will completely demolish the profit margin for creating subscription based software that utilizes any GPL code , as well as some companies that make there money based on services which rely on a server using an GPL based codepath for the basis of the application.

Thankfully, banking institutions have a thing against using OpenSource software, or we could really be in trouble. But the same can not be said about the online gaming industry.

This topic is closed to new replies.

Advertisement