0 registered members (),
1,094
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Connect to SQL Database?
[Re: Eyesgood]
#385053
10/12/11 06:55
10/12/11 06:55
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
1) You can save all these in your self file-format or you can use sql,xml etc. Point here is if your game is an online game or a single player game. For a single player game saving data on a remote server is not really a good solution, nor running a server on user's machine.
2) If you really need to use SQL, use one of the libraries that do not require a server to be running, like SQLite or MS Access.
3) you need plugins to use a SQL server, connection string is more like .net thing, f.i. in MySQL or SQLite you do not use connection strings. For MySQL you pass your server's ip,username and password to a function then you select a db with another function. For SQLite you only need a filename, there is no server to connect to.
There are other things to consider when using a SQL server from your games. First, a note, I am going to name game's main executable where players run to play the game as "Client". You do not want to directly connect to your database or db/server from your client. If you do that you have to provide your username/pass/connection string either in your code, hard-coded, or in a config file which is not really healthy for your server's security. If a local database on the player's machine is sufficient for your needs, use SQLite. SQL syntax is not much different from MSSQL. If not, you need a "game server" for your problem. The function of the game server is to get data from clients and connect to database then store that data there. This way you can validate the incoming data on game server and do not expose your database credentials in your cliet.
3333333333
|
|
|
Re: Connect to SQL Database?
[Re: Quad]
#387465
11/19/11 00:34
11/19/11 00:34
|
Joined: Aug 2007
Posts: 286
DestroyTheRunner
Member
|
Member
Joined: Aug 2007
Posts: 286
|
Hi, taking advantage of this post since it is about a same problem i ran through. I have a kind different idea in my game, I have an old A6 standard version, and I was wondering if there is any plugin that could make my game connect to a mysql database that is hosted on the web and retrieve some information from there, every 15 minutes.(just as an example) just for explain it better, my game is a mix of single player with multiplayer game, but there´s no 'real time server' for it, so the client kinda feeds the mysql webserver with information every 15 minutes. (this all is just an example!) Anyway, is there any way? Thanks and sorry for using someone elses post.
|
|
|
Re: Connect to SQL Database?
[Re: DestroyTheRunner]
#387479
11/19/11 16:00
11/19/11 16:00
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
Again rather than connecting to db from user's machine you can use a php script that clients make calls to. Since its a webserver your server probably has php support. Besides using mysql from php should be much easier than usin it on a6 wdl. How are you going to connect to that php page is whole another questin. Still it will be easier and safer than using mysql directly on clients. How would you do that in a6 standart? i do not know if that version supports plugins but if it does you need a http plugin.
3333333333
|
|
|
Re: Connect to SQL Database?
[Re: Quad]
#387482
11/19/11 16:38
11/19/11 16:38
|
Joined: Aug 2007
Posts: 286
DestroyTheRunner
Member
|
Member
Joined: Aug 2007
Posts: 286
|
actually it supports, somebody just remind me about the peacekeeper's GSHTTP-plugin. I never used it, but i think i can work something out with that. I don´t know why but still would preffer making the client connect directly to the mysql database, inside the game, he would just put his username and password and thats it! Like combat arms or any mmorpg that we see in this days, in my case is just for downloading info. thanks
|
|
|
Re: Connect to SQL Database?
[Re: DestroyTheRunner]
#387485
11/19/11 17:28
11/19/11 17:28
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Like combat arms or any mmorpg that we see in this days, in my case is just for downloading info. This is definitely NOT the common case and NO MMORPG does this! This is a HUGE (and I mean really huge!) security risk since you knowingly build an attack vector right into your application! Everyone, really everyone, will be able to sniff what you talk with the database, the password, the username etc. And sorry if this is wrong now, but I assume that even if you would use HTTPS you would either never validate the certificate and/or validate it wrong (eg. trust every root certificate) resulting in easy to do man in the middle attacks giving you no security at all. Please, consider that your users are trusting YOU with THEIR data, assuming that you are able to deal with this correctly. What you are trying to do is virtually spitting every single customer in the face and then laughing at them. Do you really want to do this? Do you want to be treated like this as a customer?
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Connect to SQL Database?
[Re: DestroyTheRunner]
#387516
11/20/11 03:10
11/20/11 03:10
|
Joined: Dec 2009
Posts: 128 China
frankjiang
Member
|
Member
Joined: Dec 2009
Posts: 128
China
|
you can development dll about ms asscee to save data
development 3d game is interesting!
|
|
|
Re: Connect to SQL Database?
[Re: DestroyTheRunner]
#387533
11/20/11 11:35
11/20/11 11:35
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
The example given was only to illustrate how the player would 'connect' to his account, through inside the game. My initial thought was not to use anything between the database on my webserver and the program(game) itself (besides the plugin which contains the funcion to propper conection). It would be just like going to hotmail.com put your username and password. Was just to illustrate. Its not like hotmail.com, its like going naked on the street with your hotmail credentials tattooed in large bold letters on your skin! Really, everyone can read the database credentials and most people on this planet a able to at least send "DROP TABLE quests" to an SQL server! And since its just a prototype game, that the database only holds the players score and download new missions or messages that I´ll feed the database. Nothing fancy or personal info. It doesn't matter if its a prototype, this won't stop people from either dropping your tables at random and/or altering the rows at random. I never got too deep inside security in web applications but now that you told me that, so how ANY game or app that connects to a server only to know if there is or not a update or a simply 'hi webserver I have just logged in, bye' ? No App connects directly to the database but to a webserver that does the database transactions for you, the webserver does a sanity check on any input and makes sure that no app tries to do something that it shouldn't.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|