Help with sitelock

Subscribe to Help with sitelock 8 posts

avatar for clasher235 clasher235 586 posts
Flag Post

Hi, everyone. I recently released my first flash game on Kongregate, and found that it had been stolen by flashgamevault. As it turns out, the version I uploaded did not have the sitelock added. Attempting to limit further stealing, I coded my own sitelock, but it seems to block the game on kongregate as well. can someone tell me what I’m doing wrong, and how to fix it?

package 
{
	import APIs.Kongregate;
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.KeyboardEvent;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	
	/**
	 * ...
	 * @author Clasher235
	 */
	public class Main extends Sprite 
	{
		private var thegame:Game;
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
			stage.showDefaultContextMenu = false;
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			
			var url:String = stage.loaderInfo.url;
			if (url.indexOf("www.kongregate.com") != -1)
			{
				// spawn game class
				thegame = new Game(stage.stageWidth, stage.stageHeight);
				new Kongregate(stage);
			
				//add game bitmap to the screen
				addChild(thegame.gamebitmap);
			
				// Create the game loop
				addEventListener(Event.ENTER_FRAME, rungame);
				
				//detect keyboard events
				stage.addEventListener(KeyboardEvent.KEY_UP, thegame.keyup);
				stage.addEventListener(KeyboardEvent.KEY_DOWN, thegame.keydown);
			
				stage.addEventListener(MouseEvent.MOUSE_DOWN, thegame.mousepress);
				stage.addEventListener(MouseEvent.MOUSE_UP, thegame.mouserelease);
				stage.addEventListener(MouseEvent.MOUSE_MOVE, thegame.changemouseposition);
			}
		}
		private function  rungame(theevent:Event):void 
		{
			thegame.update();
			thegame.render();
		}
	}
	
}
 
avatar for Aaants Aaants 158 posts
Flag Post

I think games are hosted on chat.kongregate.com – not www.

 
avatar for Aesica Aesica 952 posts
Flag Post

Personally, I’d suggest checking for just “kongregate.com” — don’t even bother matching subdomains.

 
avatar for Outstream Outstream 64 posts
Flag Post

Just google my game name and found out this happened to me too on a bunch of sites. Which is weird cause my game is pretty basic and not fun :p

 
avatar for Ace_Blue Ace_Blue 1094 posts
Flag Post

The collection is performed automatically by bots. Either that or the Russians are really fond of crummy, half-finished platformers like mine…

 
avatar for clasher235 clasher235 586 posts
Flag Post
Originally posted by Aesica:

Personally, I’d suggest checking for just “kongregate.com” — don’t even bother matching subdomains.

Worked perfectly. Thank you for the help.

 
avatar for UnknownGuardian UnknownGuardian 8144 posts
Flag Post

I can’t resist this opportunity to promote a AS3 sitelock I wrote.

 
avatar for Shadyman666 Shadyman666 6 posts
Flag Post

You can add this AS3 site lock code directly on your timeline maybe right after the kong API code (Much easier according to me):
http://www.benoitfreslon.com/actionscript-protect-your-flash-games-on-the-web-sitelock-all-your-games