Author Topic: Need help protecting my game for FGL(SOLVED)  (Read 3478 times)

Esti

  • Active Member
  • ***
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Need help protecting my game for FGL(SOLVED)
« on: Mon, Apr 23, 2012 »
I finished my first game and I tried to use the on-site secure swf protection but I had issues.

First of all with the on-site thing I got a blank screen so I decided to follow some help seen in similar topics here, like http://forums.flixel.org/index.php/topic,6048.msg34187.html#msg34187 and http://forums.flixel.org/index.php/topic,5684.msg32046.html#msg32046 but without any luck. I still have a blank screen.

I tried everything, I disabled the preloader (I am using the flixel one) , downloaded the secure swf demo and played with the settings , like adding an exception for org.Flixel.* etc.

 I also found this http://www.adva.com.ar/foro/index.php?topic=8249.0 . It is in spanish but the traduction is: "I created a FlashDevelop as3 project with preloader, copied that to my game and in Project -> Properties -> Compiler options -> Additional Compiler Options put the following line-Main frame 2, where Main is the class Main inherited from FlxGame. Also you have to put it in the preloader in the function startup ()."

The problem with this solution is that I don't know how to add that line("-Main frame ") into the startup() function.

I don't know what else to do. Thanks.
« Last Edit: Thu, Apr 26, 2012 by Esti »

Check it out on Mochi!

wg/funstorm

  • Global Moderator
  • Key Contributor
  • *****
  • Posts: 596
  • Karma: +0/-0
    • View Profile
    • Funstorm
Re: Need help protecting my game for FGL
« Reply #1 on: Mon, Apr 23, 2012 »
Sorry I can't help you with your issue directly but you should try posting also in the code talk section on FGL, some of those guys have dealt with a million different setups and know a lot about this stuffs http://www.flashgamelicense.com/view_forum.php?forum_id=8

Esti

  • Active Member
  • ***
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: Need help protecting my game for FGL
« Reply #2 on: Mon, Apr 23, 2012 »
thanks.Posting right now.

Check it out on Mochi!

Esti

  • Active Member
  • ***
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: Need help protecting my game for FGL
« Reply #3 on: Mon, Apr 23, 2012 »
I made the encryption work but not the site locking.

I didn't add the urls and it worked, also looks like the kindisoft preloader overrides mine but is ok.

Is there a way to site lock my game to FGL with flixel?

Check it out on Mochi!

wg/funstorm

  • Global Moderator
  • Key Contributor
  • *****
  • Posts: 596
  • Karma: +0/-0
    • View Profile
    • Funstorm
Re: Need help protecting my game for FGL
« Reply #4 on: Tue, Apr 24, 2012 »
There is actually, check out FlxPreloader. I've never used it, so I can't comment on how well it works / how secure it is, but it's there

Code: [Select]
/**
* Set this to your game's URL to use built-in site-locking.
*/
public var myURL:String;

... but then again since the online kindisoft thingy overrides your preloader, maybe it won't work? Worth a try. And if not you can always copy Flixel's method and put it somewhere else:

Code: [Select]
(root.loaderInfo.url.indexOf(myURL) < 0)

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Re: Need help protecting my game for FGL
« Reply #5 on: Tue, Apr 24, 2012 »
can you post the solution? how did you manage to get the game working with FGL onsite encryption?

Esti

  • Active Member
  • ***
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: Need help protecting my game for FGL
« Reply #6 on: Tue, Apr 24, 2012 »
Well, I just used the funstorm settings he shows here http://forums.flixel.org/index.php/topic,6048.msg34187.html#msg34187 but I didn't put the urls to lock, that was the problem in the first time.

There is actually, check out FlxPreloader. I've never used it, so I can't comment on how well it works / how secure it is, but it's there

Code: [Select]
/**
* Set this to your game's URL to use built-in site-locking.
*/
public var myURL:String;

... but then again since the online kindisoft thingy overrides your preloader, maybe it won't work? Worth a try. And if not you can always copy Flixel's method and put it somewhere else:

Code: [Select]
(root.loaderInfo.url.indexOf(myURL) < 0)

Thanks, I tried this yesterday but didn't work, I think you are right and it's because the override.

Check it out on Mochi!

wg/funstorm

  • Global Moderator
  • Key Contributor
  • *****
  • Posts: 596
  • Karma: +0/-0
    • View Profile
    • Funstorm
Re: Need help protecting my game for FGL
« Reply #7 on: Tue, Apr 24, 2012 »
Why can't you just do it elsewhere then? You should be able to check the url yourself at any point by copying flixel's method.

Esti

  • Active Member
  • ***
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: Need help protecting my game for FGL
« Reply #8 on: Tue, Apr 24, 2012 »
Because I am stupid. I didn't think about that. :o

Anyway, I have a question, I will need to lock some subdomains and I saw this http://forums.flixel.org/index.php/topic,1908.msg11938.html#msg11938

do you think this is ok?

private var myURLs:Array;

myURLs[0] = "http://www.flashgamelicense.com";
myURLs[1] = "https://www.flashgamelicense.com.";
myURLs[2] = "www.flashgamelicense.com.";
myURLs[3] = "flashgamelicense.com.";


Code: [Select]
var isOk:Boolean = true;
if (myURLs!=null && myURLs.length > 0)
{
isOk = false;
for (var i:int = 0; i<myURLs.length; i++)
if (root.loaderInfo.url.indexOf(myURLs[i]) < 0)
{
isOk = true;
break;
}
}
if(!FlxG.debug && !isOk) // the ! was missing


Edit: I copied the code to the main menu but I am getting "col: 9 Error: Access of undefined property root." at this line
Code: [Select]
if (root.loaderInfo.url.indexOf(myURLs[i]) < 0) even though I imported everything that was on the preloader.
« Last Edit: Tue, Apr 24, 2012 by Esti »

Check it out on Mochi!

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Re: Need help protecting my game for FGL
« Reply #9 on: Tue, Apr 24, 2012 »
I kindly ask you, if you can, to post the solution of onsite encryption on FGL.
For me if I add in additional compiler options the line -frame2 Jumper
the  following error   occurs:
command line: Error: unknown configuration variable 'frame2'
Use 'mxmlc -help' for information about using the command line.
Build halted with errors (fcsh).
Done(1)


if I add only 
frame2 Jumper
another error:
command line: Error: unknown configuration variable 'frame2'
Use 'mxmlc -help' for information about using the command line.
Build halted with errors (fcsh).
Done(1)


This is my preloader:
Code: [Select]
package 
{
import org.flixel.system.FlxPreloader;
import org.flixel.*
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.DisplayObject;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.utils.getDefinitionByName;
import flash.utils.getTimer;
import Playtomic.*

public class Preloader2 extends FlxPreloader
{

//[Embed(source = 'KongLoader45.swf')] private var SwfClass:Class;
public function Preloader2()
{

//Log.View(3121, "a177ad5190f7475d", root.loaderInfo.loaderURL);
//var myMovieClip:MovieClip = new SwfClass();
//parent.addChildAt(myMovieClip, 0);
//myURL = "flashgamelicense.com";
className = "Jumper";
//frame2 Jumper
super();

minDisplayTime = 0;
//myURL = "www.flashgamelicence2.com";
}
// override public function startup():void
//{
// frame2 Jumper
//}
// override protected function create():void {


// }
//_buffer = new Sprite();
//addChild(_buffer);
//Add stuff to the buffer...
//}
/*override protected function update(Percent:Number):void {
//Update the graphics...
}*/

}

}

Where did you put -frame2 Jumper on your preloader to make the encryption work?

Esti

  • Active Member
  • ***
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: Need help protecting my game for FGL
« Reply #10 on: Tue, Apr 24, 2012 »
I never used that solution so I didn't do anything of that. I had to quit my preloader. Also I didn't used the on site encription, I ended up downloading the secureSWF demo and encrypting it with the funstorm settings you can see in a previous post.

With this method you can protect the code but without sitelocking is pretty useless.

Check it out on Mochi!

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Re: Need help protecting my game for FGL
« Reply #11 on: Tue, Apr 24, 2012 »
maybe is better to use mochi liveupdates and encryption...

test84

  • Key Contributor
  • *****
  • Posts: 1328
  • Karma: +0/-0
  • ت
    • View Profile
    • My personal site.
Re: Need help protecting my game for FGL
« Reply #12 on: Tue, Apr 24, 2012 »
BTW you can use SecureSWF's trial software to put your game on FGL.
blog, twitter, Check out my award winning game, Rot Gut:

paala

  • Contributor
  • ****
  • Posts: 250
  • Karma: +0/-1
    • View Profile
Re: Need help protecting my game for FGL
« Reply #13 on: Wed, Apr 25, 2012 »
which expires in 30 days puts an ugly banner on your game. I use mochi encryption.

wg/funstorm

  • Global Moderator
  • Key Contributor
  • *****
  • Posts: 596
  • Karma: +0/-0
    • View Profile
    • Funstorm
Re: Need help protecting my game for FGL
« Reply #14 on: Wed, Apr 25, 2012 »
Esti, a couple things look off to me in your code.

- Why do some of the myUrls have a . after the .com?
- If indexOf(url) < 0 that actually means the domain was NOT recognized, so if you're setting isOk to true I think you should be checking if indexOf(url) > 0.
- YOU HAVE TO TEST THIS! I just found 2 big errors in 30 seconds of looking at it, so there are probably more!

To get to the stage's root from flixel you can use FlxG.stage.root

Esti

  • Active Member
  • ***
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: Need help protecting my game for FGL
« Reply #15 on: Wed, Apr 25, 2012 »
Thanks! I wont be using the flixel site locking anyway. The secure swf demo site locking worked just fine, I thought it wasn't because I tested with the preview link everytime I uploaded the game and I didn't refresh the cache with F5 so I was seeing an older version of my game.

The preloader started working!
« Last Edit: Wed, Apr 25, 2012 by Esti »

Check it out on Mochi!