Construct 2 and sitelock

0 favourites
  • 8 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • 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:

    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 ;
    
    }
    
  • 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.

  • never know this could apply with Browser object

    e.g. checking each character of the domain individually, so the actual string of your domain name does not occur in the javascript code.

    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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • Nevermind, I found it.

    Browser.Domain

  • 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.

  • As explained earlier, you can already do this with the Browser object.

  • 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?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)