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

V3 Arcade (vBulletin) - how does it work!?

Status
Not open for further replies.

Mr.Domains

DNF Addict
Legacy Exclusive Member
Joined
Sep 29, 2004
Messages
1,417
Reaction score
29
Hello,

(I've been a Developer/coder for several years, but am stumped with this one, so I hoping one of you Geniuses can help me figure it out...)

V3 Arcade is the popular arcade games add-on for vBulletin forums.

SWF games are modified to include a blank movie clip containing the following code:

Code:
// HERE THE ARCADE SESSION IS INITIATED
// DON'T FORGET TO CHANGE THE GAMENAME VALUE!
if (this.sessionstarted != 1) {
    this.arcade = new LoadVars();
    this.sessionvars = new LoadVars();
    this.arcade.gamename = "towerball";
    this.arcade.sessdo = "sessionstart";
    this.arcade.sendAndLoad("arcade.php", sessionvars, "POST");
    this.sessionstarted = 1;
}

// IF GAMEOVER=1, SUBMIT THE SCORE AND REDIRECT THE PAGE
if (_root.gameover == 1) {
    if ((this.askpermission != 1) && (this.sessionvars.connStatus == 1)) {
        this.prequestvars = new LoadVars();
        this.pranswer = new LoadVars();
        this.prequestvars.gametime = this.sessionvars.gametime;
        this.prequestvars.fakekey = this.sessionvars.initbar;
        if (_root.score == 0) {
            this.prequestvars.score = -1;
        } else {
            this.prequestvars.score = _root.score;
        }
        this.prequestvars.id = this.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;
    }
    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;
        }
        this.burnscore.sessdo = "burn";
        this.burnscore.send("./arcade.php", "_self", "POST");
        this.finalsent = 1;
    }
}

These SWF games are them embeded in the page in the usual way:

Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,14,0" width="600" height="600">
  <param name="movie" value="./games/snake.swf">
  <param name="quality" value="high">
  <embed src="./games/snake.swf" quality="high" width="600" height="600" quality="high"
  pluginspage="http://www.macromedia.com/go/getflashplayer"
  type="application/x-shockwave-flash"></embed>
</object>

When the game is over and the "_root.gameover == 1" variable is set, the SWF submits the LoadVars() via a sendAndLoad() using the "POST" method to "./arcade.php", and the page reloads to display your highscore, etc.

I am trying to recreate this to embed a few of these games on my site, and I have called the page "./arcade.php", but when the games finish they don't seem to post to the page?

Is there some extra javascript or AJAX that you need on the "./arcade.php" page, to listen or receive the sendAndLoad() vars and reload the page?

Any help would be greatly appreciated!
 
Last edited:
Domain summit 2024

Mark Talbot

Level 7
Legacy Platinum Member
Joined
Jun 13, 2003
Messages
931
Reaction score
164
First, a game player after the game has ended, has to click on the game window somewhere to instigate the post to arcade.php.

Second, a page of fixes if the above isnt related, one fix directly related to posting the scores.
 

Mr.Domains

DNF Addict
Legacy Exclusive Member
Joined
Sep 29, 2004
Messages
1,417
Reaction score
29
Thanks smirkley, but I don't think you've understood the question completely.

First, a game player after the game has ended, has to click on the game window somewhere to instigate the post to arcade.php.

The player doesn't have to click anything. Inside the converted SWF files a variable "_root.gameover == 1" is set, whenever a game is lost. A blank movie clip inside the SWF looks for that variable, if (_root.gameover == 1) and submits the high score, and other variables in a LoadVars() via a sendAndLoad() using the "POST" method to "./arcade.php". The trouble is, I think it is looking for a session Var or something, to make it submit the "POST".

Second, a page of fixes if the above isnt related, one fix directly related to posting the scores.

I don't need a bug fix, I want to get a couple of these games working on stand-alone php pages. I just want the high score variables to get returned, in the same way they do on the v3 Arcade script.
 

Mark Talbot

Level 7
Legacy Platinum Member
Joined
Jun 13, 2003
Messages
931
Reaction score
164
I stand corrected. Yes I did misunderstand the question. I have been only using the vB Pro Arcade, mostly with the default settings and games.
 
Status
Not open for further replies.

The Rule #1

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

Sedo - it.com Premiums

IT.com

Premium Members

AucDom
UKBackorder
Be a Squirrel
MariaBuy

New Threads

Our Mods' Businesses

UrlPick.com
Free QR Code Generator by MerchArts

*the exceptional businesses of our esteemed moderators

Top Bottom