[PLUGIN] Clay.io (leaderboards & achievements)

Post your completed addons to share with the community

Post » Fri Jul 20, 2012 5:15 am

Yeah that's not too big of a priority right now :)

I have a confirm box in place for clearing the scores, so it's not too easy to do accidentally (though not as good as what MailChimp has). That's not a huge priority now either.

I'd better get to integrating Multiplayer Rooms & Payments before the mob comes after me ;)
B
24
S
8
G
4
Posts: 208
Reputation: 6,147

Post » Fri Jul 20, 2012 7:57 am

Hey Austin, this sounds like it could become a fantastic plugin. However I'm experiencing several showstopper issues with it.

1) Uploaded game information disappeared from my profile. I created 2 games ("Cake Star" and "funstormtest") on my developer account ("wgfunstorm"). Both showed up in the list of my games. Then I logged out & back in again. Now "funstormtest" has disappeared completely, and "Cake Star" shows up under a blank name (I know it's that one because if I check out the stats I see a custom metric that I created). It appears there is still a trace of "funstormtest" somewhere in the system because when I try to create a new game with the same name it says it's already taken. It's just nowhere to be found on my profile.

2) I can't get it to work with multiple layouts:
- Everything works fine on the first layout that I use the plugin on.
- The problem arises when I attempt to use it on any subsequent layout. Although the 'Ready' expression still returns '1', the 'Clay.io Ready' condition does not trigger, and any attempts to log a custom metric don't show up in the statistics.
- I tested this with a barebones project with just 2 layouts and 1 metric to log on each.wgfunstorm2012-07-20 07:58:27
B
22
S
9
G
5
Posts: 122
Reputation: 5,386

Post » Fri Jul 20, 2012 8:53 am

Issues fixed (check your email)
B
24
S
8
G
4
Posts: 208
Reputation: 6,147

Post » Fri Jul 20, 2012 11:04 am

Wow that was fast thanks! Count me as a fan.
B
22
S
9
G
5
Posts: 122
Reputation: 5,386

Post » Fri Jul 20, 2012 8:46 pm

Hello! First of all i want to thank you for this great plugin. Its concept it's awesome!
But sadly, i am having a few problems and i can't make it to work. I read the tutorial about how implement the API and i read all the entries of this topic to see if i could find the error.

- The first problem: (i don't know for sure if it's a Construct bug or the plugin itself)



If i pass the mouse near some actions, they disappear. If i pass again they come back:



In the Conditions, just the "Leaderboard Score Posted" disappears. The Construct Native's plugins work fine and the others third parties plugins too. I don't think if it's a Graphic Card problem, but i can be wrong.

- Now the second problem. I followed the tutorial and tried to implement the API in an game of mine. When i double-click the action "Show Leaderboard", it doesn't show no window for input the parameters. It just add the action and go back to the event sheet editor. The tutorial shows this window:



But for me it's no good. It shows nothing, just go back to the event sheet editor. Okay then, maybe i did something wrong. Created a blank .capx and did a simple post score and show leaderboard system. Same thing, doesn't show nothing. I downloaded the test.capx :

http://clay.io/plugins/scirra/test.capx

And nothing too. When I run the project, any project with Clay.io or even the test.capx, this is what i got:



The debug mode it's disabled so i think i could at least post the score. But I'm not receiving data at all. I created a game in Clay.io site again, added a leaderboard to it and i got the same thing, no entries. Okay, so I searched more deeply and I found the Fetch action. Did a new post and show score system using Fetch this time. Used the Fetch like Austin explained, outside the loop:



But it's look like that I sending a null value or receiving a null value. Cause this is the result:



I'm sending this in Post Score Action:



I thought the APIKey could be wrong. To be sure, i created a new game, a new APIKey and a new LeaderBoard. See:



And the same result. I played other games at Clay.io and the scoreboard shows everything ok. If it helps, here the .capx i was using:

https://dl.dropbox.com/u/5143153/ClayTest.capx

Just for you know, when I post to Facebook Wall, the value goes right.
I'm using
- Google Chrome - 20.0.1132.57 m .
- Windows 7 64bits.
If you need the specs of my machine, let me know.

Sorry for the long post. But even with some hits in the wall, I think this plugin is incredible and it will be a strong weapon for Construct 2 users. Great Job Austin, i hope you continue the good work.

ps- Sorry for my English.drzanuff2012-07-20 21:05:31
B
15
S
2
G
2
Posts: 23
Reputation: 1,613

Post » Fri Jul 20, 2012 9:57 pm

I'm really not sure what the deal with the missing actions and hovering over makes them show issue...I'll get in touch with Ashley on that.

Fixed the issue on the "leaderboard show" options not opening up for you

For the no names and 0's for scores, you need to add the loopindex parameter to each like:


I think that resolves everything you mentioned.

Be sure to download the new plugin first: http://clay.io/docs/scirra
B
24
S
8
G
4
Posts: 208
Reputation: 6,147

Post » Sat Jul 21, 2012 12:43 am

Austin! Thank you very much man! It's working now!

Man! I totally missed the loopindex. My bad.

Anyways, greate job, please, continue with the hard work that your team is putting in Clay.io. The best Construct 2 plugin ever!

Cheers.drzanuff2012-07-21 00:43:40
B
15
S
2
G
2
Posts: 23
Reputation: 1,613

Post » Sat Jul 21, 2012 1:24 am

Heh, thanks
B
24
S
8
G
4
Posts: 208
Reputation: 6,147

Post » Mon Jul 23, 2012 11:59 am

Hi @Austin, thanks for the great help to the C2 community! I had a question around encryption. I've been reading your articles: http://clay.io/docs/encryption which explain how you can use JWT to encrypt the high score posts. Is there some way we can implement this with Construct 2?
B
34
S
8
G
3
Posts: 328
Reputation: 7,692

Post » Mon Jul 23, 2012 12:18 pm

I'll try to get that in with the next release (along with include payments and multiplayer rooms).

It does require some sort of backend though, so with the current set of Construct 2 plugins, that'll probably end up being AJAX for most people. The big thing encryption prevents is the falsified leaderboard scores. However, a simple implementation of a backend isn't really going to do the trick - if you send the score over via AJAX to encrypt it, then send the encrypted object to Clay.io, the user can still fake sending a higher score over via AJAX. The best way to do it is keep track of the score with server-side logic, and verify what the client is sending is legitimate :)

There are some interesting use cases for this. For example, in Word Wars, we generate the 4x4 board on the server, then run through all possible combinations of words - each possible word is hashed, then sent to the client along with a unique salt for each game.

The client then hashes each word that is typed, and checks it against the array of hashes to see if it's a match, then updates the score for the client to see (so they know it was a valid word).

At the end of the game, the list of non-hashed words the user came up with is passed to the server, and the server checks those against the list of all possible words and generates a score from that (the scoring algorithm is the same as the client side, so the scores will be the same).

So basically my point is, it takes a bit of extra work to completely stop faked scores, but it's definitely not impossible with JavaScript :)
B
24
S
8
G
4
Posts: 208
Reputation: 6,147

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests