Photon cloud and Database

Options
Acolit
edited January 2014 in Photon Server
Hello, i have a question, i want to create a game with cloud technology, but i need to save some data somewhere, i think of MYSQL, or SqLite...
Can you help me, and answer, if it's right to start game and connect it to database directly with PHP, i mean, i want to create first scene as aunthifitication scene with login and password and then, go to the secondly scene with main menu and rooms with photon cloud, can i make it? because i don't want to make photon server logic, i don't know how.
Thank you a lot! Sorry for my English..

Comments

  • Tobias
    Options
    You could use PHP and a database to make your clients login and to fetch account data (like skill, score, whatever). This is something we can't really help with though, as we focus on Photon but there are lots of good PHP solutions which will do.

    So far, Photon is not going to check users again, so anything a client passes to Photon is used "as is".
    We are working on a "remote authentication" feature. It basically makes Photon ask your web service if some token or login data is correct. This should fit your needs pretty well then.

    Neither requires in-Photon server logic.
  • Thank you, i know how to make it works :) but i want to know your opinion..
    I know, but i think, i want realize php + database system and check the login and password, score,etc, and then go to the next scene to menu, will be a session beetwen datebase and user, but can i realize check data after every game and send information to the database, and check the information sometimes?
    is it good solution to connect to the database directly? because i want to use Cloud service..
  • Tobias wrote:

    So far, Photon is not going to check users again, so anything a client passes to Photon is used "as is".
    What do you mean under "as is"?
  • uweenukr
    Options
    Once a connection has passed auth Photon does not have support to verify again later. This would be something you would need to add yourself. If a connection is lost and then re-established it would go through the initial auth again as long as you set it up that way.

    Could setup something with shared keys to help ensure the connection is legit.
  • Ok, so, how can i send auth with Photon? there are any examples?
    i thought that i only should connect to the database and create the session and then re-connect if it needs...or can i setup auth with photon cloud?
    Thank you a lot!
  • Tobias
    Options
    Photon does not verify any data you send, aside from the appID we use in the Photon Cloud, to identify your game/title.
    Anything else sent through Photon is not verified or persisted.
    We are working on a solution for "remote authentication", where Photon will use an external server for login but that's not ready yet.

    At the moment, you should use any external solution for accounts and login of a user. This could be your own PHP server and webrequests or some third party library like Roar Engine or similar. When a user logged in there, your client should start using Photon for matchmaking and in-game communication. But Photon will not communicate with your DB. In best case, your PHP script does (not the client, which would be totally insecure).
    can i realize check data after every game and send information to the database, and check the information sometimes?
    Sure, why not? Photon Cloud won't keep you from doing this.
  • So, where can i find photon script reference?
    http://doc.exitgames.com/photon-cloud/M ... references
    So, i want to know how to setup some things in the room, like starting the game after the players connect to my room...
    because i have an example where when i start my own room i create the map and start the game...but i want to wait some players , choose map,etc...
    so, i have this
    void createMyRoom(){
    hashtable customProps = new HashTable();
    customProps["map"] = "Map1"
    string [[ exposedProps = new string[1];
    etc...
    and then create the room with some propers like room name, and other custom propers...
  • dreamora
    Options
    This depends on the server SDK you want to use.

    In case of the Cloud, the client SDK of the target platform contains the documentation related to PhotonNetwork etc.
  • Tobias
    Options
    The reference documentation of the client side is in the SDKs. This describes the API and also contains some workflow description.

    Less client dependent help is provided online:
    http://doc.exitgames.com/photon-cloud
  • So, if i buy server license you don't give me a dedicated server, just sdk with license?
  • dreamora
    Options
    Correct, if you buy a single server license for Photon to use for your own installation, that grants you a license to use it on one of your server machines, performing any modifications you want and sending as many messages and data as you want. It also gives you control over location and hardware power of your machine naturally.

    Photon Cloud on the other hand has limits on how much packets you can send per room and it has no modifyability, likely to keep the general cloud load within reasonable limits as more than 1 game runs on the same game server.
  • Okey, thank you!
  • So is there a secure way yo use a database with the cloud? Since the cloud can't be told to do any logic. Or are we able to connect to a database through the cloud servers somehow?
  • chvetsov
    Options
    Hi, Bpears.
    right now you are not able to execute any of your custom code. But we are preparing version with such possiblity.
    At least you will be able to send events to some http service, where you are may handle them as you want.
    You may take a look at https://www.exitgames.com/en/Turnbased. it uses this posiblity