Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.
Sedo

Wanted: Service Scripting problems

Status
Not open for further replies.

Mr.Domains

DNF Addict
Legacy Exclusive Member
Joined
Sep 29, 2004
Messages
1,417
Reaction score
29
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!
 
Dynadot - Expired Domain Auctions

mikesherov

Level 5
Legacy Platinum Member
Joined
Jan 14, 2005
Messages
429
Reaction score
1
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!

Mr.Domains said:
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!
 

Mr.Domains

DNF Addict
Legacy Exclusive Member
Joined
Sep 29, 2004
Messages
1,417
Reaction score
29
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 [email protected] for conversion. Within a reasonable delay, I'll post the converted game and installation script on vBulletin.org.
http://www.vbulletin.org/forum/showthread.php?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!
 

mikesherov

Level 5
Legacy Platinum Member
Joined
Jan 14, 2005
Messages
429
Reaction score
1
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.
 

VisualDigits

The One
Legacy Exclusive Member
Joined
Mar 8, 2005
Messages
1,480
Reaction score
0
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.
 
Status
Not open for further replies.

Who has viewed this thread (Total: 1) View details

Who has watched this thread (Total: 1) View details

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members Online

Sedo - it.com Premiums

IT.com

Premium Members

MariaBuy

Upcoming events

New Threads

Our Mods' Businesses

UrlPick.com

*the exceptional businesses of our esteemed moderators

Top Bottom