Forum BigDB Same DB for several games

Discussion and help relating to the PlayerIO database solution, BigDB.

Same DB for several games

Postby Al-Kanor » March 13th, 2015, 8:55 pm

Hello,

I just want to know if it is possible to use the same database in different games, in other words can I access a database associated to a game in the server code of another game ?

Thank you =)
Al-Kanor
 
Posts: 3
Joined: February 26th, 2015, 4:09 pm

Re: Same DB for several games

Postby [GD]AlaaNasro » March 14th, 2015, 8:22 am

Hey,
Yes i think you just have to call DB of your server without using create new DB function.
But, you'll just confuse and get your game lag whats the point of this ? make your question clearly so i can answer clearly.
Cheers,
[GD]AlaaNasro
 
Posts: 46
Joined: March 10th, 2015, 6:11 pm

Re: Same DB for several games

Postby archipdev » March 14th, 2015, 10:47 am

AlaaNasro, it's good to try to help other people but you're just confusing them by saying random stuff. As Confucius said : "To know what you know and what you do not know, that is true knowledge."

Al-Kanor, that's a good question, and I'm also waiting for an answer, but I have an idea on how to solve your problem. You can create only one game on yahoo, and your different game clients use different rooms. Therefore, all your clients can connect to the same database. The problem is that if you have a lot of games, it will get really messy.
archipdev
 
Posts: 28
Joined: September 6th, 2014, 10:35 am

Re: Same DB for several games

Postby Al-Kanor » March 14th, 2015, 1:20 pm

Thanks for your answers.

Indeed I have a lot of games and I don't really like the idea of only create one game on Yahoo (I already thought this), but if it's the only solution, I'll probably do this.
More, it will mean that the same dll of the server will manage the whole of the clients of the differents games, it is awful :shock:
Al-Kanor
 
Posts: 3
Joined: February 26th, 2015, 4:09 pm

Re: Same DB for several games

Postby robertflesch » March 14th, 2015, 7:14 pm

We have been told you can use different DLLs for different rooms (since I havent tried it). The room type chooses the DLL to load for that room.
robertflesch
Paid Member
 
Posts: 136
Joined: April 22nd, 2013, 9:18 pm

Re: Same DB for several games

Postby Al-Kanor » March 14th, 2015, 11:32 pm

Oh, I think it's worth trying ! Thank you
Al-Kanor
 
Posts: 3
Joined: February 26th, 2015, 4:09 pm

Re: Same DB for several games

Postby Henrik » March 16th, 2015, 11:10 pm

A serverside DLL can only be associated with a single game, but can contain the code for multiple roomtypes for that game.

A game client can connect to multiple games, and connect to multiple rooms in multiple games. The tricky part is getting authentication right so that a single client can be securely connected to multiple games. If you're using SimpleUsers or Basic Authentication you should be fine, but if you're using Yahoo Authentication or Facebook Authentication or any other, you'll need to do more work.

Essentially, you will need to do something like this:
* Authenticate in whatever way, Yahoo, Facebook, something to Game 1.
* Connect to a service room, where you calculate a username and auth hash for this user for the Shared Game. (Store the secret in the serverside .dll of Game 1)
* Pass this info back to the client
* Authenticate using Basic Authentication to the Shared Game.

...And now you have two secure connections to two games, and you can store meta-data in the Shared Game.

When you add Game 2, do the same thing, just make sure it calculates the username in the same way that Game 1 does given however the actual user authenticated to each game.
Henrik
.IO
 
Posts: 1832
Joined: January 4th, 2010, 1:53 pm


Return to BigDB