User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26

Thread: Something changed in Android that is making my high score script to fail? HELP

  1. #1
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,323
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)

    Something changed in Android that is making my high score script to fail? HELP

    It seems that something must be changed in Fusion about 2/3 months ago for Android at least.
    My Score script doesn't seem to work anymore.
    Its creating the connection successfully
    But after that it's failing.

    I think this happened when 292.1 came out and I had to update all my apps for the newer Android version/API

    I am at a loss as of why it's failing. it's the code I used for the last 4 years.

    <?php

    //application/x-httpd-php scores.php
    // PHP script text


    // Main Info
    $weblink = 'localhost'; // Link where the database is stored
    $username = 'xxxx'; // Database Username
    $password = 'xx'; // Database Password
    $databasename = 'xxxx'; // Database Name

    // Database Connection
    $bd = mysqli_connect($weblink, $username, $password, $databasename);
    mysqli_select_db($bd, $databasename);



    // Retrieving variables from MMF
    $Player = stripslashes($_POST['Player']); //Player Name
    $Score = stripslashes($_POST['Score']); //Game score
    $Cle = stripslashes($_POST['Cle']); //Security Key
    $Device = stripslashes($_POST['Device']); //Device on which you played
    $Game = stripslashes($_POST['Game']); //Application Name




    //////////////////////////////////////////////////
    // Check for the existing table if its not found create it
    // This is really just here to make the life of new users of the script easier
    // They won't have to go thru the script and create the table
    /////////////////////////////////////////////////

    if(!mysqli_num_rows( mysqli_query($bd,"SHOW TABLES LIKE '".$Game."'")))
    {
    $query = "CREATE TABLE `$Game` (`Id` int(11) NOT NULL auto_increment,
    `Player` varchar(255) NOT NULL,
    `Score` Decimal(65,0) NOT NULL,
    `Device` varchar(255) NOT NULL,
    `scoredate` varchar(255) NOT NULL,
    PRIMARY KEY (`Id`)) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;";

    $create_table = mysqli_query($bd,$query)or die (mysqli_error($bd));
    }





    // Check condition variables
    if (isset($_POST['Player']) && isset($_POST['Score']) && isset($_POST['Cle']) && isset($_POST['Device']))
    {
    if (md5($Player . $Score . $Device . "xxxxxt") == $Cle) //security password to compare the existing scores.

    {
    //Database we check to see if the player is already
    $sql_player = 'SELECT * FROM '.$Game.' WHERE Player = "'.$Player.'" AND Device = "'.$Device.'"';
    $req_player = mysqli_query($bd, $sql_player) or die('Error SQL !<br>'.$sql_player.'<br>'.mysqli_error($bd));
    $number = mysqli_num_rows($req_player);

    //If the player does not exist, then added his score to the database
    if($number == 0)
    {
    $date = date('M d Y');
    $sql = 'INSERT INTO '.$Game.' VALUES("","' . $Player . '", "' . $Score . '", "' . $Device . '", "' . $date . '")';
    $req = mysqli_query($bd, $sql) or die('Error SQL !<br>'.$sql.'<br>'.mysqli_error($bd));
    echo "Saved" ;
    }
    //If the player already exists, then it is verified that the new score is better than his recorded score
    else
    {
    //Database we check to see if the player does a better score
    $date = date('M d Y');
    $sql_player2 = 'SELECT * FROM '.$Game.' WHERE Player = "'.$Player.'" AND Device = "'.$Device.'" AND Score >= "'.$Score.'"';
    $req_player2 = mysqli_query($bd, $sql_player2) or die('Error SQL !<br>'.$sql_player2.'<br>'.mysqli_error($bd));
    $number2 = mysqli_num_rows($req_player2);

    //If the player has a higher score, then update the score
    if($number2 == 0)
    {
    $sqlupdate = 'UPDATE '.$Game.' SET Score ="'.$Score.'" , scoredate ="'.$date.'" WHERE Player = "'.$Player.'" AND Device ="'.$Device.'"';
    $req_update = mysqli_query($bd, $sqlupdate) or die('Error SQL !<br>'.$sqlupdate.'<br>'.mysqli_error($bd));
    echo "Saved" ;
    }
    //If player score is smaller than the score already registered then do nothing
    else
    {
    echo "Not saved. You did more than that.";
    }
    }


    }
    else
    {
    //MD5 Error
    echo "MD5_Error" ;
    }
    }
    else
    {
    //connection Error
    echo "connection_Error" ;
    }

    // Disconnecting from the database
    mysqli_close($bd);
    ?>
    Images attachées Images attachées

  2. #2
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,323
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    They connection is fine, since this is working

    ?php

    //application/x-httpd-php scores.php
    // PHP script text


    // Main Info
    $weblink = 'localhost'; // Link where the database is stored
    $username = 'pxxxx'; // Database Username
    $password = 'xxx'; // Database Password
    $databasename = 'xxx'; // Database Name

    // Database Connection
    $bd = mysqli_connect($weblink, $username, $password, $databasename);
    mysqli_select_db($bd, $databasename);

    echo "Success" ;


    // Disconnecting from the database
    mysqli_close($bd);
    ?>


    idk if the GET object got changed? that one is set to UTF-8

  3. #3
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,041
    Mentioned
    130 Post(s)
    Tagged
    3 Thread(s)
    can you explain more?, can you provide with the link to this php and a small mfa?
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  4. #4
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,323
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fernando View Post
    can you explain more?, can you provide with the link to this php and a small mfa?
    Can I sent you an mfa somehow..

    it's just for submitting scores, and that is done with the procedure from the image, and the script i posted. (without the passwords etc)

  5. #5
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,041
    Mentioned
    130 Post(s)
    Tagged
    3 Thread(s)
    OK please send me your mfa to test
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  6. #6
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,323
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fernando View Post
    OK please send me your mfa to test

    I sent the link on FB and e-mail
    link for the php is in the mfa
    it worked for years, and it just stopped.

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Kimera's Avatar
    Join Date
    Feb 2007
    Location
    Houston, TX
    Posts
    718
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hey Perry, hope things are going well, it's been a while since we spoke. I take it your script does not run completely and, though I am not a PHP guy, I may be able to help a bit. In every language I have ever used there is a way to provide output then stop the script early...

    C# example...
    Response.Write...
    Response.End

    If you have that ability in PHP you could go section by section in your code to see what happens and when it happens. Once you find the section that fails you can then go line by line and keep moving the Write and End commands down to pinpoint what line fails. Additionally, while I don't write PHP I have done some troubleshooting for friends but to be honest if the code worked for years it should still work. Having said that I know it does happen when standards change over the years. I will look at the code tonight, I am at the office now so I can't look at it right now. In looking over the code quickly I have some questions but we can talk on the phone for those.

    I use the get object every day, mobile and desktop and have seen no issues to date and I have updated recently.

    We will catch up later!

  8. #8
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,323
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    Hey, long time no talk.
    I don't have that ability.
    The login part works, I think it's happening when it's trying to submit. But I think it fails before, since it does not create the table either.

  9. #9
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)iOS Export Module (Steam)

    Join Date
    May 2014
    Posts
    190
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Just checking, but did you try to log in manually to the database with the same user and do some manual operations by hand? Maybe that user lost some rights for some reason.

  10. #10
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,041
    Mentioned
    130 Post(s)
    Tagged
    3 Thread(s)
    @Perry

    mm can you check your SQL

    Error SQL !
    SELECT * FROM ORDER BY Score DESC LIMIT
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY Score DESC LIMIT' at line 1
    Regards,


    Fernando Vivolo

    ... new things are coming ...

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. My game's 'custom" high score table is making me pull my hair (joking)
    By Aloan in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 28th May 2017, 01:15 AM
  2. High Score Object and Android?
    By Keli in forum Android Export Module 2.5
    Replies: 9
    Last Post: 11th April 2015, 08:36 PM
  3. Replies: 1
    Last Post: 21st November 2014, 10:18 AM
  4. Save High Score android?
    By Zallred in forum Fusion 2.5
    Replies: 1
    Last Post: 19th May 2014, 04:18 PM
  5. High-score script problem
    By Danell in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 1st May 2008, 06:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •