Be a Supporter!

Newgrounds.io Help & Support

  • 2,102 Views
  • 25 Replies
New Topic Respond to this Topic
PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer

Newgrounds.io is the successor to the old Newgrounds Flash API. We've completely re-built the server API to remove all dependencies on custom ActionScript classes.

Now, ANY platform should be able to use the API. The only requirements are the ability to encode and decode JSON objects, and post over HTTP.

Newgrounds.io is launching it's public beta today. We already have some libraries available for platforms that target HTML5, and complete documents on how you can build your own libraries from any other platform.

Newgrounds.io is going in to public beta today, so if you start using it, and need help or support, post in this thread and we'll get back to you as soon as we can.

If you plan on implementing Newgrounds.io into a platform we haven't covered yet, you should also check out the Newgrounds.io Developers Group. I'll be posting any major updates to the server API in there, so joining the group will keep you in the loop.

Now, before anyone DOES post for help in here, make sure you have already checked the Getting Started and Help pages on www.newgrounds.io, or the help documents for any Newgrounds.io libraries you are using. There's a lot of useful information already out there.

If you are interested in in-game ads, we will not be adding those to this API. The old Flash API often had issues with ad-blockers because they would occasionally block access to the entire API server, and we do not want a repeat of that with Newgrounds.io.

At some point, we will be looking at creating a standalone API for implementing ads in games, so keep your eyes open for that.

Also, we haven't implemented any NEW features at the time of this post, we were primarily concerned with updating the network interface and encryption options so the whole thing is a lot more platform agnostic.

The 'save data' feature is still being rebuilt (the old version was VERY Flash-oriented), and is not currently available. When it becomes available I'll post about it in here and in the developer group.

You can also follow the project on Twitter, I'll be posting news and changes there as well.


Arch-Angel likes this sig!

BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer

"Now, any user with a Newgrounds, Facebook or Google+ account can sign in to your game, no matter where it's running from!"

Is this saying it's possible to log in via a Facebook account that is not linked to a NG account? Do a linked FB and NG account both give the same User object?

Does `passport_url` mean that if they are not logged in or logged in via an unlinked(?) FB, this url gives them the option to log into NG? Does that notify the app in any way?

Edit: looked at your js example, answers the second question.

PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Newgrounds.io Help & Support 2016-08-01 23:26:15 Reply

At 8/1/16 06:14 PM, MSGhero wrote: "Now, any user with a Newgrounds, Facebook or Google+ account can sign in to your game, no matter where it's running from!"

Is this saying it's possible to log in via a Facebook account that is not linked to a NG account? Do a linked FB and NG account both give the same User object?

Does `passport_url` mean that if they are not logged in or logged in via an unlinked(?) FB, this url gives them the option to log into NG? Does that notify the app in any way?

Edit: looked at your js example, answers the second question.

Users will need a Newgrounds account, but you can create one with FB and G+ and skip the oldschool registration form. Everything is powered by Newgrounds in the end, we just make it easily accessible to other social users.


Arch-Angel likes this sig!

BBS Signature
9221145
9221145
  • Member since: Jul. 28, 2016
  • Offline.
Forum Stats
Member
Level 04
Blank Slate

When trying to submit score to scoreboard in javascript by callComponent('ScoreBoard.postScore'... I get "Unexpected server response" error.

Any suggestions?

PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Newgrounds.io Help & Support 2016-08-08 13:55:29 Reply

At 8/6/16 08:56 AM, iv5 wrote: When trying to submit score to scoreboard in javascript by callComponent('ScoreBoard.postScore'... I get "Unexpected server response" error.

Any suggestions?

I'll need a bit more information to help you.

First, add this somewhere before you make the call:

ngio.debug = true;

Open the network inspector in your browser and run that call. Copy paste the response object you get from the server when the error happens and send it to me in a PM so I can see exactly what the server is getting/sending.


Arch-Angel likes this sig!

BBS Signature
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer

At 8/1/16 01:58 PM, PsychoGoldfish wrote: Now, ANY platform should be able to use the API. The only requirements are the ability to encode and decode JSON objects, and post over HTTP.

S! S!!
HTTPS!!!!

why do you want to give me a heart-attack D:

HTPS works, by the way. Thank you! Please make it default and update references to include the S. Most high-level languages handle that automatically, and anyone working in lower-level parts of a language where it actually matters should know better.

Also, HKPK (public key pinning) and HSTS wouldn't hurt, and it's not a lot of work. You've already alienated all the browsers that would allow downgrade attacks, so there's really no harm in adding a couple extra headers for more security.

An encrypted web is a happy web. We're over 50% there! Join us :D

Edit: Looking at the encryption, RC4 shouldn't really be used. AES-128 is a solid choice and isn't (yet) possibly broken whereas RC4 may be. Why not make AES the only option?

Although RC4 is specifically broken through TLS, it can be translated to other applications. Why take the risk?

I haven't yet looked at the encryption implementations, but if I find anything tomorrow I'll let you know.

Another edit: I appreciate the new platform, thank you very much :D


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Newgrounds.io Help & Support 2016-08-18 11:31:25 Reply

At 8/18/16 01:21 AM, egg82 wrote:
At 8/1/16 01:58 PM, PsychoGoldfish wrote: Now, ANY platform should be able to use the API. The only requirements are the ability to encode and decode JSON objects, and post over HTTP.
S! S!!
HTTPS!!!!

why do you want to give me a heart-attack D:

HTPS works, by the way. Thank you! Please make it default and update references to include the S. Most high-level languages handle that automatically, and anyone working in lower-level parts of a language where it actually matters should know better.

Also, HKPK (public key pinning) and HSTS wouldn't hurt, and it's not a lot of work. You've already alienated all the browsers that would allow downgrade attacks, so there's really no harm in adding a couple extra headers for more security.

An encrypted web is a happy web. We're over 50% there! Join us :D

Going full https only was the original plan, but given that this platform is still targeted toward html5 games that can be distributed on various portal sites (most of which don't host games over SSL), we have most of the libraries simply not declaring the protocol and just posting to //newgrounds.io and letting the host site determine the protocol.

Many of the people that use our API tend to be entry level programmers and we just don't have the ability to hold everyone's hands when it comes to making SSL work for them on every possible host site.

Edit: Looking at the encryption, RC4 shouldn't really be used. AES-128 is a solid choice and isn't (yet) possibly broken whereas RC4 may be. Why not make AES the only option?

Although RC4 is specifically broken through TLS, it can be translated to other applications. Why take the risk?

I haven't yet looked at the encryption implementations, but if I find anything tomorrow I'll let you know.

The good news is there's really no secure information being used by our API at all. The RC4/AES encryption are primarily there for obfuscation purposes. RC4 is in there more for the poor saps still using ActionScript 2 to make Flash games. AES is the default (and preferred) encryption method.

Another edit: I appreciate the new platform, thank you very much :D

Glad you like it so far!


Arch-Angel likes this sig!

BBS Signature
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer

Haven't had time to play with anything yet, but it's on my to-do and I managed to look at some of the code while I was at work.

I have a couple questions/issues on some things:
Why is the AES/RC4 key provided by the application? Is that intentional for back-end magic, or can that just be replaced by an RSA implementation? (it really should if it can. Secure keys are unknown keys.) - also, why does the key need to be Base64-encoded? I'm not seeing anywhere that it's sent in plaintext to the server (at least, I hope it's not) but that does worry me slightly.. ?

RijndaelManaged by default uses CBC which is vulnerable to padding oracle attacks. (CBC specifically here)

Also, when sending encrypted messages over the wire it's important you make sure they maintain integrity from both accidental and malicious forces. Bouncy Castle provides AES-GCM.

I'm also curious about session_id being a public string. Why not just make it a UUIDv4 with a public accessor? Just make sure people know about section 6 of the RFC spec.

Ending note: Crypto is the reason I drink. Welcome to my world of pain.

Edit:
Oh, also about HTTPS- The host shouldn't determine whether or not HTTPS is used because that would defeat the point of it. There's no reason for it, either, since you can happily transmit secure data from an insecure location without problems. The reason I mention it being forced is because most people will use wrappers that handle those things automatically, and if they're not then they will be playing with a deeper part of the language and should know what they're doing by that point (or at least know how to use Google. "What does this 'TLS error' mean?") - anywhere in-between and honestly you have those same people asking those same questions anyway. Maybe just add it into an FAQ of some sort and reference it where possible?


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
Pkmn2
Pkmn2
  • Member since: Jan. 4, 2007
  • Offline.
Forum Stats
Supporter
Level 38
Animator
Response to Newgrounds.io Help & Support 2016-09-07 18:09:02 Reply

A tiny question...
If I understand this correctly, I could theoretically make a game in C++ and implement the Newgrounds API there?

Anyhow this is truly amazing and I am really looking forward to future updates.


Nintentrix. Presto Sprites! Retro Sights!

BBS Signature
PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Newgrounds.io Help & Support 2016-09-07 18:11:01 Reply

At 9/7/16 06:09 PM, Pkmn2 wrote: A tiny question...
If I understand this correctly, I could theoretically make a game in C++ and implement the Newgrounds API there?

Anyhow this is truly amazing and I am really looking forward to future updates.

Yes, you can make a client for our API in any language that has JSON support and can post to a web address.


Arch-Angel likes this sig!

BBS Signature
Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer

At 9/7/16 06:09 PM, Pkmn2 wrote: A tiny question...
If I understand this correctly, I could theoretically make a game in C++ and implement the Newgrounds API there?

Yep. That's very much possible, and isn't all that difficult**.

I'm also working on a backend framework for creating game servers (or any other type of server, really) that communicates with the client using the WebSocket protocol and am including ways of linking it to the NGAPI. I have a repo of it uploaded—it's not as up-to-date as the source on my computer but it still works.

And that's my shameless plug for the day.

** It's not difficult, but can be rather tedious due to the nature of C++.

Pkmn2
Pkmn2
  • Member since: Jan. 4, 2007
  • Offline.
Forum Stats
Supporter
Level 38
Animator
Response to Newgrounds.io Help & Support 2016-09-08 12:28:30 Reply

At 9/8/16 11:19 AM, Diki wrote: I'm also working on a backend framework for creating game servers (or any other type of server, really) that communicates with the client using the WebSocket protocol and am including ways of linking it to the NGAPI.

Thanks for sharing.
I am extremely far away in adding online support to my game, since it's my very first time making one in C++.
But it's cool to hear, that something like this is possible.


Nintentrix. Presto Sprites! Retro Sights!

BBS Signature
ballpreta
ballpreta
  • Member since: May. 1, 2010
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to Newgrounds.io Help & Support 2016-09-18 16:26:12 Reply

Hi guys,
Im trying to add highscore board to my unity webgl game.
I am using the newgrounds.io for unity available in https://bitbucket.org/newgrounds/newgrounds.io-for-unity-c
I think I know how to post a score, Im using something like this:

public void submithethescore()
{
io.newgrounds.components.ScoreBoard.postScore submit_score = new io.newgrounds.components.ScoreBoard.postScore();
submit_score.id = 6666;
submit_score.value = 100;
submit_score.callWith(ngio_core);
}

But I am having problems with the code of retrieving the scores (getScores).
Can someone please show me a C# example of how would be a function to retrieve and list all scores of a specific scoreboard.

Thx very much.

PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Newgrounds.io Help & Support 2016-09-20 11:27:51 Reply

At 9/18/16 04:26 PM, ballpreta wrote: Hi guys,
Im trying to add highscore board to my unity webgl game.
I am using the newgrounds.io for unity available in https://bitbucket.org/newgrounds/newgrounds.io-for-unity-c
I think I know how to post a score, Im using something like this:

public void submithethescore()
{
io.newgrounds.components.ScoreBoard.postScore submit_score = new io.newgrounds.components.ScoreBoard.postScore();
submit_score.id = 6666;
submit_score.value = 100;
submit_score.callWith(ngio_core);
}

But I am having problems with the code of retrieving the scores (getScores).
Can someone please show me a C# example of how would be a function to retrieve and list all scores of a specific scoreboard.

Thx very much.

You'll want something like this:

void onScoresLoaded(io.newgrounds.results.ScoreBoard.getScores result) {
if (result.success) {
// result.scores is a list of score objects
for (int i = 0; i < result.scores.Count; i++)
{
// this object contains all the score info, and can be cast to a proper model object.
io.newgrounds.objects.score score = (io.newgrounds.objects.score)r.scores[i];
}
}
else
{
// there was a problem talking to the server. Details should be in result.error.message
}
}

void loadScored(int board_id) {
io.newgrounds.components.ScoreBoard.getScores get_scores = new io.newgrounds.components.ScoreBoard.getScores();
get_scores.id = board_id;

// configure additional score settings such as get_scores.limit, get_scores.period, get_scores.social, etc here

get_scores.callWith(ngio_core, onScoresLoaded);
}


Arch-Angel likes this sig!

BBS Signature
LunaWolfStudios
LunaWolfStudios
  • Member since: May. 27, 2015
  • Offline.
Forum Stats
Member
Level 02
Game Developer
Response to Newgrounds.io Help & Support 2016-11-23 01:52:40 Reply

Hello!

I'm attempting to get the Newgrounds.io working with my Unity WebGL game. Whenever I try to post a score I get a null thrown. Any idea what I may be doing wrong? Does the game need to be published to test leaderboards and medals?

I've attached a screenshot below it seems a call is being made, but throws an exception.

Let me know if you need anything else. Thanks!

Newgrounds.io Help & Support

LunaWolfStudios
LunaWolfStudios
  • Member since: May. 27, 2015
  • Offline.
Forum Stats
Member
Level 02
Game Developer
Response to Newgrounds.io Help & Support 2016-11-23 15:44:09 Reply

At 11/23/16 01:52 AM, LunaWolfStudios wrote: Hello!

I'm attempting to get the Newgrounds.io working with my Unity WebGL game. Whenever I try to post a score I get a null thrown. Any idea what I may be doing wrong? Does the game need to be published to test leaderboards and medals?

I've attached a screenshot below it seems a call is being made, but throws an exception.

Let me know if you need anything else. Thanks!

*Resolved
My Newgrounds Core wasn't attached to the correct game object and so the StartCoroutine(_executeCallList(single_call)); was causing a crash as you need an object to execute a co-routine.

Wooooooooooooooooooo
Wooooooooooooooooooo
  • Member since: Nov. 28, 2010
  • Offline.
Forum Stats
Member
Level 14
Game Developer
Response to Newgrounds.io Help & Support 2016-12-14 19:13:49 Reply

At 8/1/16 01:58 PM, PsychoGoldfish wrote: Newgrounds.io is the successor to the old Newgrounds Flash API. We've completely re-built the server API to remove all dependencies on custom ActionScript classes.

Hi just wondering I'm an as2 game designer and I have implemented medals in my games before, I've been trying to add them to a new game I'm working on but I'm getting failed to unlock medal every time?
does this new api have something to do with it?

Raeldor
Raeldor
  • Member since: Oct. 1, 2014
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to Newgrounds.io Help & Support 2016-12-18 08:26:02 Reply

Hi,

I was wondering if there is any updates to the new api for GameMaker, since looks like the old one using the unnoficial HTML5 version is not working again, freezing the game when a medal is called.

Some months ago I was really trying to get the v3 api to work with game maker but got stuck I have a nearly completed game in game maker and I really would like some medals.


It's good to learn something new every day!
Trying to develop games, music and art.
Follow my work!

StaticSkull
StaticSkull
  • Member since: Jan. 16, 2016
  • Offline.
Forum Stats
Member
Level 20
Animator
Response to Newgrounds.io Help & Support 2017-01-09 13:11:33 Reply

can this work for html games?

Raeldor
Raeldor
  • Member since: Oct. 1, 2014
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to Newgrounds.io Help & Support 2017-01-13 03:31:53 Reply

At 1/9/17 01:11 PM, NightRaid-NG wrote: can this work for html games?

there is an example in Here but it depends on what you are using to make the game, now I'm struggling to make this work with game maker.

Unity uses another set of files to comunicate with the server,


It's good to learn something new every day!
Trying to develop games, music and art.
Follow my work!

Raeldor
Raeldor
  • Member since: Oct. 1, 2014
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer

So there it is one of my tests with game maker, I managed to greet the user if it is connected, and now I'm trying to get the medal. For some reason this happens, Don't mind the "medal_name = null;" that is defined inside the game maker, so It can be edited from inside the engine when you call the function.

Newgrounds.io Help & Support


It's good to learn something new every day!
Trying to develop games, music and art.
Follow my work!

StaticSkull
StaticSkull
  • Member since: Jan. 16, 2016
  • Offline.
Forum Stats
Member
Level 20
Animator
Response to Newgrounds.io Help & Support 2017-01-13 07:59:34 Reply

At 1/13/17 03:31 AM, Raeldor wrote:
At 1/9/17 01:11 PM, NightRaid-NG wrote: can this work for html games?
there is an example in Here but it depends on what you are using to make the game, now I'm struggling to make this work with game maker.

Unity uses another set of files to comunicate with the server,

I use rpg maker mv

PsychoGoldfish
PsychoGoldfish
  • Member since: Sep. 26, 2000
  • Offline.
Forum Stats
Staff
Level 12
Programmer
Response to Newgrounds.io Help & Support 2017-01-13 10:14:17 Reply

At 1/13/17 05:10 AM, Raeldor wrote: So there it is one of my tests with game maker, I managed to greet the user if it is connected, and now I'm trying to get the medal. For some reason this happens, Don't mind the "medal_name = null;" that is defined inside the game maker, so It can be edited from inside the engine when you call the function.

Make sure NG_loadMedals has been called and received a response before you try unlocking anything.


Arch-Angel likes this sig!

BBS Signature
NeithR
NeithR
  • Member since: Jul. 25, 2015
  • Offline.
Forum Stats
Member
Level 08
Programmer

Hello, Everyone.

I tried to upload HTML5 game using the v3 API. The game currently is still in Preview phase.
When I tried to add medal in firefox, the console displays this message:

"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://newgrounds.io/gateway_v3.php. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘none’)"

It happened similarly when I used Chrome.
Also, the session and medal were loaded successfully.

Solution for this? Thank you.

Edit:

@Raeldor:
I know this is very late, but from your case, it is because the "medal[i]" is supposed to be "medals[i]".
The one from the example (newgrounds io) has typo that needs fix, since I experienced it the same error.

MrStahlfelge
MrStahlfelge
  • Member since: May. 31, 2017
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Newgrounds.io Help & Support 2017-06-15 13:03:04 Reply

Hi, is this the right forum for questions and support or the Google group? Google group is linked in the official guide, but there's no one around answering questions.

MrStahlfelge
MrStahlfelge
  • Member since: May. 31, 2017
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Newgrounds.io Help & Support 2017-06-25 08:16:57 Reply

I just tell about my problem now here and in the Google group. Perhaps someone in charge reads it.

I have the issue that my calls to the API get blacklisted. Please take a look: http://www.newgrounds.com/projects/games/1109814/preview - password is v3beta
If you play the game, you will see that it does not do many calls but already the second call (when a game is started) normally gets rejected. Users won't be enthusastic if their medals and scores were not submitted. :-(

Benjamin