Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 6 of 6
  1. #1
    DNF Addict
    Mr.Domains's Avatar
    Join Date
    Sep 2004
    Location
    Geneva, Switz.
    Posts
    1,868
    Country

    Great Britain
    DNF$
    3,239
    Bank
    6,090
    Total DNF$
    9,329
    Donate  

    Scripting problems

    Hello all scripting gurus,
    I am building a games arcade, which is roughly based around the vBulletin Arcade mod, because I want to be able to use the hundreds of swf games that have already been adapted to work with it.

    But I can't figure out how the .swf game file is sending the score back to the script after "game over".

    If you play one of the games, for example, Snake:
    http://www.dnforum.com/arcade.php?do=play&gameid=1

    ...when you die it says "please wait while you score is submitted" and then the page reloads. But if you download that page and .swf file, then play it to your own server, it doesn't seem to submit any variables or reload the page when you die.

    I am quite familiar with both PHP and Flash, but I can't figure out how this is being done?

    I'm happy to give my 400 F$ to anyone that can explain it to me!
    Neil Hillman - Web Developer, Pixel Pusher...

  2. #2
    Platinum Lifetime Member
    mikesherov's Avatar
    Join Date
    Jan 2005
    Location
    NY
    Posts
    463
    DNF$
    2,143
    Bank
    0
    Total DNF$
    2,143
    Donate  

    Re: Scripting problems

    The problem lies in the fact that you probably did not install the PHP script on your site. The flash file does a SendAndLoad() command (probably) instead of doing a redirect or a refresh. Here's what's supposed to happen

    1. flash game does sendandload to PHP script.
    2. PHP does processing and sends back that it did it.
    3. once flash receives the fact that the PHP did what it is supposed to do, then it forwards to another page, displaying the high scores.

    Here's what happens if you don't have the PHP script in:

    1. flash game does sendandload to PHP script (which isn't there).
    2. flash waits for response from PHP script before going to another page.
    3. flash never gets response and just sits there.

    this gives the desired effect.... it LOOKS like nothing is happening... but in reality, flash has attempted to silently post to a PHP page and is waiting for an answer.

    The solution? Install the proper PHP to give the proper response. Go to the snake games website (http://www.neave.com), download the PHP script you need... and you should be all set.

    $400 DNF please!

    Quote Originally Posted by Mr.Domains
    Hello all scripting gurus,
    I am building a games arcade, which is roughly based around the vBulletin Arcade mod, because I want to be able to use the hundreds of swf games that have already been adapted to work with it.

    But I can't figure out how the .swf game file is sending the score back to the script after "game over".

    If you play one of the games, for example, Snake:
    http://www.dnforum.com/arcade.php?do=play&gameid=1

    ...when you die it says "please wait while you score is submitted" and then the page reloads. But if you download that page and .swf file, then play it to your own server, it doesn't seem to submit any variables or reload the page when you die.

    I am quite familiar with both PHP and Flash, but I can't figure out how this is being done?

    I'm happy to give my 400 F$ to anyone that can explain it to me!

  3. #3
    DNF Addict
    Mr.Domains's Avatar
    Join Date
    Sep 2004
    Location
    Geneva, Switz.
    Posts
    1,868
    Country

    Great Britain
    DNF$
    3,239
    Bank
    6,090
    Total DNF$
    9,329
    Donate  

    Re: Scripting problems

    Hi Mike,
    Funnily enough, I almost PM'ed this question directly to you, because you've done some good scripting work for me in the past, but then I decided to throw it open to the board, and you where the one that replied!

    Your answer does sound like the plausable explaination, and you will get your 400 DNF$, but I need to figure out how to implement this, not just what's happening in theory.

    The "sendandload" function isn't added by the Game's authors, (in this case http://www.neave.com), it was added by v3arcade.com, the guys who made the vBulletin Arcade hack.

    If you have the source (.FLA) for a game that you want to use in the v3 Arcade, you can send the required files to john@v3arcade.com for conversion. Within a reasonable delay, I'll post the converted game and installation script on vBulletin.org.
    http://www.vbulletin.org/forum/showt...threadid=60377
    The same function is added to all the games, so if I can find out what that is, then they will all work with my site. What I need to figure out is what URL the sendandload that John adds points too, and what response is it is expecting.

    I guess one of these Flash decompilers would be the way to go?


    SECOND POST
    -----------------------------------------------------
    Okay, I decompiled the "snake" .swf file, and found this:

    // [Action in Frame 3]
    if (_root.sessionstarted != 1)
    {
    _root.arcade = new LoadVars();
    _root.sessionvars = new LoadVars();
    _root.arcade.gamename = "snake";
    _root.arcade.sessdo = "sessionstart";
    _root.arcade.sendAndLoad("arcade.php", sessionvars, "POST");
    _root.sessionstarted = 1;
    } // end if
    and this:

    // [Action in Frame 1]
    if (this.askpermission != 1 && _root.sessionvars.connStatus == 1)
    {
    this.prequestvars = new LoadVars();
    this.pranswer = new LoadVars();
    this.prequestvars.gametime = _root.sessionvars.gametime;
    this.prequestvars.fakekey = _root.sessionvars.initbar;
    if (_root.score == 0)
    {
    this.prequestvars.score = -1;
    }
    else
    {
    this.prequestvars.score = _root.score;
    } // end if
    this.prequestvars.id = _root.sessionvars.lastid;
    this.prequestvars.sessdo = "permrequest";
    this.prequestvars.note = this.prequestvars.id * this.prequestvars.score * this.prequestvars.fakekey;
    this.prequestvars.sendAndLoad("./arcade.php", this.pranswer, "POST");
    this.askpermission = 1;
    } // end if
    if (this.pranswer.validate == 1 && this.finalsent != 1)
    {
    this.burnscore = new LoadVars();
    this.burnscore.microone = this.pranswer.microone;
    this.burnscore.gametime = this.prequestvars.gametime;
    this.burnscore.id = this.prequestvars.id;
    if (_root.score == 0)
    {
    this.burnscore.noscore = 1;
    } // end if
    this.burnscore.sessdo = "burn";
    this.burnscore.send("./arcade.php", "_self", "POST");
    this.finalsent = 1;
    } // end if
    Looks like we're on the right track!
    Last edited by Mr.Domains; 03-04-2005 at 04:54 AM.
    Neil Hillman - Web Developer, Pixel Pusher...

  4. #4
    Platinum Lifetime Member
    mikesherov's Avatar
    Join Date
    Jan 2005
    Location
    NY
    Posts
    463
    DNF$
    2,143
    Bank
    0
    Total DNF$
    2,143
    Donate  

    Re: Scripting problems

    excellent work... you now need to download the vbulletin arcade.php file, just so you can see what variables it returns.

    now, take the .fla file and change the sendandload() commands to just say send(), and change the second argument of the send command to "_blank" instead of a reference to some other loadvars object. That way, when it is time to silently submit to the arcade.php file.... the flash will post the variables in a new window and clear as day you can see what arcade.php returns.

    If you don't want to bother doing all this investigative work yourself.... you can send me the .fla file, the arcade.php file, and the .swf file and I can figure it all out for you. Of course, there will be a small charge associated with this , but it'll be something around an additional $1000 DNF. Of course, I can then go ahead and write you a new file arcade.php file that would work with your homepage, but that too will cost some $$.

    Anyway, try this method... it'll get you pointed in the right direction. please respond when you do try this... I'll guid what to do next.

  5. #5
    Platinum Lifetime Member
    mikesherov's Avatar
    Join Date
    Jan 2005
    Location
    NY
    Posts
    463
    DNF$
    2,143
    Bank
    0
    Total DNF$
    2,143
    Donate  

    Re: Scripting problems

    Was this ever resolved?

  6. #6
    The One
    VisualDigits's Avatar
    Join Date
    Mar 2005
    Location
    New Jersey
    Posts
    1,917
    DNF$
    1,211
    Bank
    0
    Total DNF$
    1,211
    Donate  

    Re: Scripting problems

    I don't know much about scripting but there's a free project called pnflashgames and it has some pretty good documentation. Just google it.
    Cogito, ergo sum!

Similar Threads

  1. problems with enom club drop
    By stuff in forum Gold Cafe
    Replies: 2
    Last Post: 11-08-2004, 05:09 AM
  2. Damaged undersea cable blamed for UK Net problems
    By Whois-Search in forum Domain Name News
    Replies: 1
    Last Post: 11-27-2003, 07:12 PM
  3. Voxtreme problems..
    By bidawinner in forum Gold Cafe
    Replies: 1
    Last Post: 03-01-2003, 06:02 PM
  4. Anybody having problems with C-PANEL?
    By scjollie in forum Website Development and Design Discussion
    Replies: 8
    Last Post: 12-08-2002, 01:46 AM
  5. using a .me.uk domain for commercial puposes - any problems with it?.
    By bunder in forum General Domain Name Discussion
    Replies: 1
    Last Post: 11-17-2002, 01:17 PM

Bookmarks

Posting Permissions

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

Domain name forum recommended by Domaining.com