Forum Topic: Newgrounds Domain?

(196 views • 15 replies)

This topic is 1 page long.

<< < > >>
None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 09:16 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

What is it?


Happy

matrix5565

Reply To Post Reply & Quote

Posted at: 7/29/09 09:17 PM

matrix5565 LIGHT LEVEL 15

Sign-Up: 02/28/06

Posts: 568

That games are hosted at uploads.ungrounded.net


None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 09:29 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

Why isnt this working? It works on flash game license


None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 09:31 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

var urlString = _root._url;
if (urlString.indexOf("uploads.ungrounded.n et" || "flashgamelicense.com") == -1) {
_root.gotoAndStop(7);
}


None

SpamBurger

Reply To Post Reply & Quote

Posted at: 7/29/09 09:43 PM

SpamBurger NEUTRAL LEVEL 15

Sign-Up: 07/12/05

Posts: 4,747

At 7/29/09 09:31 PM, UknownXL wrote: var urlString = _root._url;
if (urlString.indexOf("uploads.ungrounded.n et" || "flashgamelicense.com") == -1) {
_root.gotoAndStop(7);
}

Just so you know, that isn't the most secure way of doing this. I could host your game on:

http://evilsite.com/yourgame.php?uploads.ungrounded.net

And it would run perfectly fine.

Unless, of course, _url returns only the domain name, and not the entire URL which I thought it did

"However, the game received only two orders, one of which Molyneux speculated was from his mother." -Peter Molyneux's first game The Entrepreneur


None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 09:44 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

ok im so tired of this. I am trying to site lock this game to newgrounds and it wont work can someone tell em exactly how to fix this. I have never site locked anything before and I cant get it to work.


None

knugen

Reply To Post Reply & Quote

Posted at: 7/29/09 09:55 PM

knugen LIGHT LEVEL 35

Sign-Up: 02/07/05

Posts: 4,708

At 7/29/09 09:44 PM, UknownXL wrote: ok im so tired of this. I am trying to site lock this game to newgrounds and it wont work can someone tell em exactly how to fix this. I have never site locked anything before and I cant get it to work.
var urlString = _root._url;

if (urlString.indexOf("uploads.ungrounded.net") == -1 && urlString.indexOf("flashgamelicense.com"))
_root.gotoAndStop(7);

Should do it.


None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 10:07 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

The code I showed works on fgl, i just cant get it to work on newgrounds for some reason


None

knugen

Reply To Post Reply & Quote

Posted at: 7/29/09 10:11 PM

knugen LIGHT LEVEL 35

Sign-Up: 02/07/05

Posts: 4,708

At 7/29/09 10:01 PM, IoIwut wrote: wouldn't that lock it to FGL rather than newgrounds ?

Ehm, true... I left a key part out in order to test him of course, totally intentional! Now stfu :)

Hint to Unknown: add "== -1" somewhere :P

None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 10:15 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

Like this?

var urlString = _root._url;
if (urlString.indexOf("uploads.ungrounded.n et") == -1 && urlString.indexOf("flashgamelicense.com"
)== -1) {
_root.gotoAndStop(2);
}

I have tried to upload my game twice and the sitelock is not working correctly.


None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 10:21 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

Lol I want it to be able to be played on newgrounds only lol. How do I do that?
I want it so someone cant take my game off of newgrounds and put it on there site.


None

knugen

Reply To Post Reply & Quote

Posted at: 7/29/09 10:29 PM

knugen LIGHT LEVEL 35

Sign-Up: 02/07/05

Posts: 4,708

Your code is not necessarily wrong:

if (urlString.indexOf("uploads.ungrounded.net") == -1 && urlString.indexOf("flashgamelicense.com") == -1)
{
    // This code will execute if the game is _not_ on FGL or NG
}

None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 10:35 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

will this work also?
onEnterFrame = function () {
// get everything between the "://" and the next "/"
urlStart = _url.indexOf("://")+3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
// get rid of any prefixes before the second to last "."
LastDot = domain.lastIndexOf(".")-1;
pfixEnd = domain.lastIndexOf(".", LastDot)+1;
domain = domain.substring(pfixEnd, domain.length);
//tell the movie what to do...
if (domain != "ungrounded.net" && domain != "newgrounds.com" && domain != "uploads.ungrounded.net" && domain != "ngfiles.com") {
_root.gotoAndStop(7);
}
};


None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 10:47 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

When I tell it to go to frame 7 you know its suppose to be the error page right?


None

UknownXL

Reply To Post Reply & Quote

Posted at: 7/29/09 11:55 PM

UknownXL EVIL LEVEL 10

Sign-Up: 05/22/05

Posts: 1,343

So I tested the code on swf cabin, then on fgl and it works properly. Now all i need to know is what is newgrounds domain name. Is it newgrounds.com or what?


None

knugen

Reply To Post Reply & Quote

Posted at: 7/30/09 12:34 AM

knugen LIGHT LEVEL 35

Sign-Up: 02/07/05

Posts: 4,708

At 7/29/09 11:55 PM, UknownXL wrote: So I tested the code on swf cabin, then on fgl and it works properly. Now all i need to know is what is newgrounds domain name. Is it newgrounds.com or what?

The .swf's are stored on uploads.ungrounded.net, so that's the URL you should match with, just like in the code I gave above.


All times are Eastern Standard Time (GMT -5) | Current Time: 08:43 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!