home *** CD-ROM | disk | FTP | other *** search
/ One Click 21 (Special) / OC021.iso / Juegos / miniscrapercaper / miniscrapercaper.swf / scripts / frame_1 / DoAction.as < prev   
Encoding:
Text File  |  2006-02-02  |  1.7 KB  |  60 lines

  1. copyProtection = new Object();
  2. copyProtection.sites = new Array();
  3. copyProtection.addSite = function(name, domains, config)
  4. {
  5.    this.sites.push({name:name,domains:domains,config:config});
  6. };
  7. copyProtection.validate = function()
  8. {
  9.    var _loc3_ = this;
  10.    var valid = false;
  11.    var i1 = _url.indexOf("//") + 2;
  12.    _loc3_.protocol = _url.substring(0,i1);
  13.    trace("protocol: " + _loc3_.protocol);
  14.    if(_loc3_.protocol eq "file://")
  15.    {
  16.       _loc3_.domain = "file:" + _url.substr(i1).split("/").pop();
  17.       _loc3_.domainWildcard = "file:*";
  18.    }
  19.    else
  20.    {
  21.       var a = _url.substring(i1,i1 + _url.substr(i1,_url.length).indexOf("/")).split(".");
  22.       _loc3_.domain = a[a.length - 2] + "." + a[a.length - 1];
  23.       _loc3_.domainWildcard = a[a.length - 2] + ".*";
  24.    }
  25.    var i = 0;
  26.    while(i < _loc3_.sites.length)
  27.    {
  28.       var _loc2_ = _loc3_.sites[i];
  29.       var _loc1_ = 0;
  30.       while(_loc1_ < _loc2_.domains.length)
  31.       {
  32.          if(_loc3_.domain eq _loc2_.domains[_loc1_] || _loc3_.domainWildcard eq _loc2_.domains[_loc1_])
  33.          {
  34.             valid = true;
  35.             _loc3_.site = _loc2_;
  36.             break;
  37.          }
  38.          _loc1_ = _loc1_ + 1;
  39.       }
  40.       if(valid)
  41.       {
  42.          break;
  43.       }
  44.       i++;
  45.    }
  46.    _loc3_.valid = valid;
  47.    trace("valid: " + _loc3_.valid);
  48.    return _loc3_.valid;
  49. };
  50. copyProtection.addSite("miniclip",new Array("miniclip.*","file:*"),{moreGamesUrl:"http://www.miniclip.com",highscoresUrl:"http://www.neodelight.com/index.php?topic=scores&game=" + _root.game,branding:"miniclip"});
  51. if(copyProtection.validate())
  52. {
  53.    fullVersion = true;
  54. }
  55. else
  56. {
  57.    getUrl("/", "_top");
  58.    fullVersion = false;
  59. }
  60.