Sending and Receiving data using your own SQL Server - PHP file and TestProject included

17810121315

Comments

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694
    edited January 2015

    Finally got my game to use network features. Out on the App Store. I still need to make some modification to the php script but database leaderboard works pretty great.

  • App_MakerApp_Maker Member, PRO Posts: 64

    @scottharrrules43 said:
    Finally got my game to use network features. Out on the App Store. I still need to make some modification to the php script but database leaderboard works pretty great.

    Nice, what is your app called.

  • wayback_gamerwayback_gamer USMember, PRO Posts: 124

    Im not trying to beat a horse called lag, but after thorough examination of this thread I have determined that the discussion and the work has just ended. There is no new information, no test project, and no templates. All that remains is what once was a hot topic. I have some questions and I'm full of new ideas. Google fusion tables for instance. TinyDB built into the device. There is nothing about these options. Further more I would like to know a little more about GS and how it works regarding the web browser. Even The_Gamesalad_Guru was impressed by the effort of those trying to be pioneers yet it somehow never came to be and everyone just moved on I guess. I realize that we all have a lot going on and some Im sure have bigger fish to fry like speeding up this awesome new release of GS with asynchronous multiplayer and gamepad key mapping, but Id like to continue the conversation and see if there is any stoned left unturned. If anyone sees this and has any working models that would be willing to share please let me know and share what you have so I can try to try some things new.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694
    edited March 2015

    @wayback_gamer I made a thread for a leaderboard which uses these networks features to make a cross platform leaderboard.

    http://forums.gamesalad.com/discussion/76504/cross-platform-leaderboarddemo#latest

    Also have a game that threw together that uses the leaderboard and also uses networking to for news.

    https://appsto.re/us/SLWo3.i

    Edit:well ok then

  • wayback_gamerwayback_gamer USMember, PRO Posts: 124

    @jonmulcahy
    @StormyStudio
    @tatiang
    @EireStudios
    @Riffel
    Some things have changed like the php version since this thread and the test project were posted. The thread and project are not very easy to follow. If you have any information or a working project you would be willing to share or sell please let me know. I would like to explore synchronous multiplayer little more and see if I can contribute something new.

  • deepanshi guptadeepanshi gupta Member Posts: 63

    @StormyStudio I just want to know how you did facebook friend list function and I am also not able to do this multi player functionality . How can I do this ?

  • deepanshi guptadeepanshi gupta Member Posts: 63

    @StormyStudio I just want to know how you did facebook friend list function and I am also not able to do this multi player functionality . How can I do this ?

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited March 2015

    @deepanshi gupta

    (Oh I'd recommend removing the space from your username, it makes tagging you in a reply a tad tricky... maybe impossible?)

    • The Facebook friend list isn't currently possible... and when it was it was a slightly messy work around and used the Facebook API in an unapproved way. It was basically using their website Facebook access api and using that to fill your own server with the friendliest which you could then send to GameSalad via the get/ send table URL functionality.

    • I wrote everything I worked on for my own multiplayer setup... it took many many many months or in my spare time to get to the point I got to.. All off the back of Jon Mulcahys excellent original tutorial on how to use the send/get functionality. Which is (was?) a PRO only feature. If you read the following thread from start to finish and all the links I provide on PDO database queries, database security, email verification etc etc... you'll know a lot and should get closer to running your own multiplayer game. Good luck.

    http://forums.gamesalad.com/discussion/64039/creating-your-own-asynchronous-server/p1

  • deepanshi guptadeepanshi gupta Member Posts: 63

    Thankyou so much @StormyStudio . Sir , I wan to know that how can i fetch players list i.e. the particular player is online t play the game . Should it necessary to put the record of all the players in databases?

  • deepanshi guptadeepanshi gupta Member Posts: 63

    @jonmulcahy Sir where should I use game key generated by playstogether game to develop a multiplayer game ?

  • deepanshi guptadeepanshi gupta Member Posts: 63

    @stevej how can we implement multiplayer using only two behaviour of network i.e. get and send table in game salad creator?

  • jonmulcahyjonmulcahy Member, Sous Chef, PRO Posts: 10,406

    @deepanshi gupta said:
    stevej how can we implement multiplayer using only two behaviour of network i.e. get and send table in game salad creator?

    playstogether is not available yet, it is coming in 14.0 with a whole bunch of new behaviors.

    To use your own server, you will have to come up with a method for your game, there is no 'standard'

    and be aware, playstogether might be a pro only feature. no one knows yet.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694
    edited March 2015

    Random question, but is local multiplayer over wifi supported? Using UDP?

  • jonmulcahyjonmulcahy Member, Sous Chef, PRO Posts: 10,406

    @scottharrrules43 said:
    Random question, but is local multiplayer over wifi supported? Using UDP?

    I don't think so, I'm no expert on UDP, but the existing network functions are very much a client/server setup. You submit data from your phone to the server, the server does whatever you want and sends it back.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    @jonmulcahy said:
    I don't think so, I'm no expert on UDP, but the existing network functions are very much a client/server setup. You submit data from your phone to the server, the server does whatever you want and sends it back.

    Light Bulb, brb

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694
    edited March 2015

    @jonmulcahy said:
    I don't think so, I'm no expert on UDP, but the existing network functions are very much a client/server setup. You submit data from your phone to the server, the server does whatever you want and sends it back.

    What do you think about this concept idea?

  • vikingviking Member, PRO Posts: 322

    Quick question: Is there a way to ping the current date and time on a sever to see if for example 20 minutes have passed? I would like to add a cool-down period in my game, but it is too easy to just change the time on the device to skip the time delay, so I need to do it on the server side. Is the current version of the engine capable of this, or do I have to wait for 14?

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    @viking said:
    Quick question: Is there a way to ping the current date and time on a sever to see if for example 20 minutes have passed? I would like to add a cool-down period in my game, but it is too easy to just change the time on the device to skip the time delay, so I need to do it on the server side. Is the current version of the engine capable of this, or do I have to wait for 14?

    There is a way to do this but requires some coding and research, it is in Rc and stable release.

  • vikingviking Member, PRO Posts: 322

    That is good to know :) I am willing to pay to add this feature to my game. Anyone out there who has proven that they can get this working already?

  • jonmulcahyjonmulcahy Member, Sous Chef, PRO Posts: 10,406

    I got a note from someone a few weeks ago that went unnoticed in my PM's, but it's an important one:

    The PHP script you wrote in the thread below is vulnerable to an SQL Injection attack.

    You must escape $playerID, $playerName, $playerStats before passing them to mysql_query(), otherwise malicious people can run arbitrary SQL commands on your MySQL server (which may have other things besides the game table).

    Quick&Dirty, pass these variables through mysql_real_escape_string():
    http://php.net/manual/de/function.mysql-real-escape-string.php

    tagging @StormyStudio & @Hopscotch as I know they also did some work with networking

  • HopscotchHopscotch Member, PRO Posts: 2,782
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989

    Thanks for the heads up.

    I'm all good after updating the mySQl to PDO.

    Hopefully. ;-)

  • snapesnape Member Posts: 9

    Is it possible to achieve a connection and use mysql database tables in the version? Sorry I read a lot of the thread but never actually saw that info..?

  • snapesnape Member Posts: 9

    in the free version I meant?

  • jonmulcahyjonmulcahy Member, Sous Chef, PRO Posts: 10,406

    @snape said:
    in the free version I meant?

    I'm pretty sure the network connection behaviors are pro only, but yes you can use any back end server you want provided to write the code to handle the incoming JSON data, manipulate it however you want and send it back out when requested. It's very flexible, but you need to know how to do some actual programming :)

  • DuesDues Member Posts: 1,159

    @jonmulcahy How much work is it to make a custom leaderboard with score and name displayed in the game? :)

  • jonmulcahyjonmulcahy Member, Sous Chef, PRO Posts: 10,406
    edited May 2015

    @Dues said:
    jonmulcahy How much work is it to make a custom leaderboard with score and name displayed in the game? :)

    I would think it's lot of work, but i don't think it's terribly difficult work for someone with some modest programming skills.

    You need to support creation of an account.
    Uploading of scores
    downloading of high scores

    the creation of the account is probably the most difficult. @StormyStudio spent a great deal of time doing this a year ago, his old thread probably has a lot of great information.

  • DuesDues Member Posts: 1,159

    Ok :) Thanks @jonmulcahy

Sign In or Register to comment.