Data Bridge API

15 posts (showing 1-15)
FGL_Devault

FGL AdminCommunity Level 3
246 posts

Hello GamerSafe devs!

Summary: Hosts can get scoreboard info from GamerSafe games.

I've been working on GamerSafe for a few months. I just finished work on a new Data Bridge feature that allows host sites to collect information about player activity in GamerSafe games. Expect it to go live in a few days. Initially it will relay scoreboard entries, but we can add more messages as desired.

I tried to make setup very simple, just a snippet of javascript on the host page:

<script language="JavaScript" type="text/javascript">
<!--
function setupGamerSafeBridge() {
    var bridgeConfig = {
        user: "hostUserID", 
        session: "hostSessionID", 
        url: "http://localhost/GamerSafe/bridge_test.php",
        salt: "kosher" 
    };
    return bridgeConfig;
}
// -->


Once GS is loaded, it calls setupGamerSafeBridge() through the External Interface. The host should write server code to generate the user and session IDs, but they are optional if you'd rather not. Right now the salt is just used to do some simple checksumming. The system could be made more secure with a bit more work, but that wasn't our main concern on the first pass. The most important part of the bridgeConfig is the URL, and this is where the scoreboard data will be sent.

Now, every time the game writes to a scoreboard, it will now copy that URL with the scoreboard entry data. The data comes in via HTTP POST. I've written a sample bridge receiver PHP script at http://www.flashgamelicense.com/resources/bridge_test.txt

All bridge messages will contain the following parameters:

userID: from setupGamerSafeBridge()

sessionID: from setupGamerSafeBridge()

message: an identifier for the type of message being sent from the GamerSafe lib - in this first version, "scoreboard_entry" is all that currently is sent over the bridge. Adding more messages is very easy.

params: an array of supplementary arguments specific to the message type, for "scoreboard_entry": ["extra", "score", "scoreboard_id", "unregistered_user"]

hash: a checksum for the message, calculated from:
    SHA1(salt + userID + sessionID + message + <extra params by alpha order>)

If the user is logged into gamersafe, "username" will be appended to "params". All parameters named in "params" will also be POSTed.

Thanks for reading this! I look forward to your interesting uses for this system. Let me know if you have any questions or suggestions.

- Stimpy

posted 2010-01-20T05:59:25-08:00
OBGames

Market Level 5Community Level 1
80 posts

Where is the best place to easily locate all the gamersafe highscore enabled games?

posted 2010-02-02T14:09:01-08:00
FGL_Luke

FGL AdminCommunity Level 2
100 posts

Hey OBGames,

You can view a list of some GamerSafe enabled games here.. This doesn't include every single GamerSafe game, but it's enough to get you started:

http://flashgamedistribution.com/gamersafe

You'll have to play the games to see if they use the scoreboard system yet, but bear in mind that the scoreboard bridge isn't active yet - we'll hopefully have it live in a couple of days. I'll update this thread when it is live.

Hope that helps!

-Luke

posted 2010-02-02T22:53:16-08:00 | edited 2010-02-02T22:53:41-08:00
OceanBreezeGames

Market Level 7Community Level 2
119 posts

Hello,

Thanks for the link.

Here are some suggestions for the system:

  • JavaScript callback function when the score has posted to the URL (so I know to reload the scores beside the game)
  • Some sort of integration with a publishers gamersafe account so a secret key can be used to create a checksum. Only gamersafe and the publisher would know the key. The key would be individual to each publisher.
  • A way to not allow guests on my site to post scores, but have a url shown where they can signup so they can submit their scores.

Thanks,
Ocean Breeze Games

posted 2010-02-03T16:38:37-08:00
FGL_Devault

FGL AdminCommunity Level 3
246 posts

OceanBreezeGames,

I think I can address most of your questions.

1) This should be no problem to add. I'll pass the message identifier along with this callback.

2) We actually discussed a system like this during development, but I'll discuss it with Eric and Luke and see what we can come up with. Originally, I'd included the Salt for this purpose, which you could tie to an individual session ID and check on the receiver side.

3) Actually, this should already be possible with the existing setup. You can pass a user ID through the configuration, as well as a session ID. You should be able to use this (and the new callback) to decide if you want to register the score or show the user a link to your registration page.

Glad to hear your comments! Keep them coming.

-Stimpy

 

posted 2010-02-03T19:05:00-08:00
OceanBreezeGames

Market Level 7Community Level 2
119 posts

Just thought of another piece of info that would be handy. In addition to the scoreboard_id I also would need to know if the score is time based / point based as well as the sorting order it should be displayed in (ASC / DESC).

Thanks!

posted 2010-02-03T19:46:21-08:00
Archbob

Market Level 7Community Level 10
1164 posts

So,

can it now be integrated into my user database on my site like Mochi leaderboards?

That'd be great because then I can just tell the devs to use gamersafe leaderboards instead of Mochi's.

posted 2010-02-05T05:47:01-08:00
FGL_Devault

FGL AdminCommunity Level 3
246 posts

OceanBreezeGames -

Sure, that information is already stored about the scoreboards for each game, I can send that along too.

 

Archbob -

That was the original intent of this project, so yes!

 

- Stimpy

posted 2010-02-06T04:04:07-08:00
Archbob

Market Level 7Community Level 10
1164 posts

Cool, I'll look into integrating it.

 

Still waiting for an AS2 version though to use for development.

posted 2010-02-06T04:30:42-08:00
danbak

Market Level 0Community Level 0
3 posts

Hi all,

We are about to integrate GamerSafe data bridge with our arcade script but we have some difficulties.

The imported GamerSafe games don't try to submit scores to our URL.

This is the code we add before the game:
[java]
<script language="JavaScript" type="text/javascript">
<!--
function setupGamerSafeBridge() {
  var bridgeConfig = {
    game: "7",
    user: "1",
    session: "15845738177a9ee76bbfeafdb28a7052_7",
    url: "http://devdomain.com/modules/gamersafe-bridge.php",
    salt: "cesar"
  };
  return bridgeConfig;
}
// -->
</script>[/java]

 

Do you know what we are doing wrong?
Best regards,
Daniel
posted 2014-05-15T19:04:07-07:00
FGL_Aaron

FGL AdminCommunity Level 7
1060 posts

:

Do you know what we are doing wrong?

Best regards,
Daniel

Hey Daniel!

It looks like you may be commenting out the setupGamerSafeBridge function. Have you tried removing the 3rd line in your code or perhaps comment that line out? ( I'm referring to this <!-- )

posted 2014-05-15T19:28:40-07:00
danbak

Market Level 0Community Level 0
3 posts

Hi Aaron,

Thank you! I totally overlooked that. We have removed the commend but still it doesn't work.

Do we need to include something else? Maybe a javascript lib or a crossdomain.xml?

Best regards,

Daniel

posted 2014-05-15T20:05:47-07:00
FGL_Devault

FGL AdminCommunity Level 3
246 posts

Ah, sorry. I got contacted about this through email. The problem was that 'allowscriptaccess' was set to 'never'.

Aaron - that's an old-style javascript block. In some (horribly old) browsers you had to put it all in an HTML comment block to prevent said crappy browsers from catching fire and possibly derailing.

posted 2014-05-15T21:28:32-07:00
FGL_Aaron

FGL AdminCommunity Level 7
1060 posts

Heh, learn something new every day! Laughing

Thanks Steve!

posted 2014-05-15T21:43:54-07:00
danbak

Market Level 0Community Level 0
3 posts

Hi,

Thank you both for your support. Score collecting via the GamerSafe Data Bridge works now perfectly with MyArcadePlugin. 

We will release the new version in two days after our testing period and MyArcadePlugin seems to be the first arcade script which supports your data bridge :)

Thank you guys!

Best regards,
Daniel

CEO of MyArcadePlugin

posted 2014-05-16T17:20:05-07:00