Construct 2 and sitelock

Discussion and feedback on Construct 2

Post » Thu Jun 14, 2012 2:34 pm

Hello :D

just i was wondering if construct 2 can add a domain site lock feature, many famous games portal website like for example gametako, require sometime for exclusive releases to be sitelocked for thier domain, this feature can be added very easily with stencyl flash games, also HTML5 if it's linked through external JS, i just wonder if @Ashley could apply this important feature like for example in properties, we can add the domain we want our game to be locked, than an event that check if domain="true" do some action, for example developer could make a layout that appear if the game uploaded on different domain telling the players he must play this game on specific website.

here a java script to do that task, i just believe that better be added to Construct 2 by default than making an external plugin for that purpose.   

JS Code:
[code]
function game_tako(argument0,argument1,argument2)
{
var argument0;
var argument1 = document.location.href;
var argument2=argument1.indexOf("scirra.com");
if (argument2==-1)
{
   argument0 = 'false';
}
else
{
   argument0 = 'true';
}
return argument0 ;

}
[/code]
B
22
S
3
G
5
Posts: 141
Reputation: 5,117

Post » Fri Jun 15, 2012 12:04 pm

A simple way to do this is just use the Browser object and compare the domain. However it's easy to hack the Javascript to remove the check or change it to check a different domain. It's best to invent your own system, e.g. checking each character of the domain individually, so the actual string of your domain name does not occur in the javascript code.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Fri Jun 15, 2012 5:51 pm

never know this could apply with Browser object
[quote]
e.g. checking each character of the domain individually, so the actual string of your domain name does not occur in the javascript code. [/quote]

nice tip, that's would be harder for someone to change [;D], i will try to play with that and see how it's goes.
B
22
S
3
G
5
Posts: 141
Reputation: 5,117

Post » Wed Feb 20, 2013 5:25 pm

Any luck on the site lock?
I don't see a way to compare the domain using the browser object.

Sorry to pull this thread from the grave, but as more publishers are out there supporting HTML5 games, more will ask to site lock. I just wanted to see if there was a way to do it through construct or not.
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Wed Feb 20, 2013 5:33 pm

Nevermind, I found it.

Browser.Domain
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Thu Jun 20, 2013 10:47 am

Another resurrection for this feature.

It's a issue that i read on a lot of comments and blogs etc against html5 vs say Flash. yes there are some workarounds but this is supposed to be a game engine for non coders right ;)
This would be a real nice feather in Construct 2's cap and a real help to developers.
Some sort of way to do this from Construct 2 would be great as this would need to change a few times when you start looking at sites/sponsors etc. Put in on your own site, then on another site as well as change it to the sponsor's site.


B
19
S
3
G
4
Posts: 79
Reputation: 3,711

Post » Thu Jun 20, 2013 1:19 pm

As explained earlier, you can already do this with the Browser object.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat Dec 21, 2013 1:18 pm

I got the way to compare a domain using Browser Object, but I don't know how to apply it for all subdomain of that domain. Anyone know the way for applying it?Iris2013-12-21 13:19:31
B
6
S
1
G
1
Posts: 39
Reputation: 828


Return to Construct 2 General

Who is online

Users browsing this forum: MadSpy, saiyadjin and 3 guests