This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ---- PLEASE MAKE SURE YOUR ENCODING IS: UTF-8 (without BOM) ---- */ | |
$jsonString = file_get_contents("php://input"); /* Get the RAW POST DATA */ | |
/* Validate signature */ | |
if ( ! ( isset($_SERVER['HTTP_MINI_SIGNATURE']) | |
&& $_SERVER['HTTP_MINI_SIGNATURE'] == md5("[YOUR_API_KEY]".$jsonString) )) { | |
throw new Exception("Invalid signature"); | |
} | |
/* Decode the JSON string received and convert it to an associative array */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ---- PLEASE MAKE SURE YOUR ENCODING IS: UTF-8 (without BOM) ---- */ | |
$jsonString = file_get_contents("php://input"); /* Get the RAW POST DATA */ | |
/* Validate signature */ | |
if ( ! ( isset($_SERVER['HTTP_MINI_SIGNATURE']) | |
&& $_SERVER['HTTP_MINI_SIGNATURE'] == md5("[YOUR_API_KEY]".$jsonString) )) { | |
throw new Exception("Invalid signature"); | |
} | |
/* Decode the JSON string received and convert it to an associative array */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* NOTICE: For miniplay connect to work, your domain must be allowed by us, contact us to request access */ | |
/* 1. Parameters decoding ============================================================================================ */ | |
/* Only if your system configuration or language doesn't automatically decodes it */ | |
foreach ($_GET as $key => $value) $_GET[$key] = urldecode($value); | |
/* 2. Parameters validation (mp_*) =================================================================================== */ | |
/* External games doesn't receive neither parameters or signature, no validation needed */ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 1. Imports */ | |
import flash.display.LoaderInfo; | |
import flash.display.Loader; | |
import flash.net.URLRequest; | |
import flash.events.Event; | |
import flash.system.Security; | |
/* 2. Get the url from the flashvars */ | |
var params:Object = LoaderInfo(root.loaderInfo).parameters; /* Access to the root object is required */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 1. Imports */ | |
import flash.display.LoaderInfo; | |
import flash.display.Loader; | |
import flash.net.URLRequest; | |
import flash.events.Event; | |
import flash.system.Security; | |
/* 2. Get the url from the flashvars */ | |
var params:Object = LoaderInfo(root.loaderInfo).parameters; /* Access to the root object is required */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MiniTemplateEngine() { | |
this.compile = function(templateContents) { | |
var parentTemplate = '<li class="tt-suggestion">%body</li>'; | |
switch(templateContents) { | |
case parentTemplate.replace("%body", "test"): | |
return new MiniTemplateSample(); | |
break; | |
default: | |
return new MiniTemplateSample(); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* 1. Game api_key =================================================================================================== */ | |
if (!empty($_GET['mp_game_devel']) && !!$_GET['mp_game_devel']) { | |
define("API_KEY","## YOUR_SECURE_DEVELOPMENT_API_KEY ##"); /* Set this to the development api_key we've provided you. DO NOT DISPLAY IT!!! */ | |
} else { | |
define("API_KEY","## YOUR_SECURE_PRODUCTION_API_KEY ##"); /* Set this to the production api_key we've provided you. DO NOT DISPLAY IT!!! */ | |
} | |
/* 2. Parameters decoding ============================================================================================ */ | |
// Only if your system configuration or language doesn't automatically decodes it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* 1. Game api_key =================================================================================================== */ | |
if (!empty($_GET['mp_game_devel']) && !!$_GET['mp_game_devel']) { | |
define("API_KEY","## YOUR_SECURE_DEVELOPMENT_API_KEY ##"); /* Set this to the development api_key we've provided you. DO NOT DISPLAY IT!!! */ | |
} else { | |
define("API_KEY","## YOUR_SECURE_PRODUCTION_API_KEY ##"); /* Set this to the production api_key we've provided you. DO NOT DISPLAY IT!!! */ | |
} | |
/* 2. Parameters decoding ============================================================================================ */ | |
// Only if your system configuration or language doesn't automatically decodes it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* 1. Game api_key ================================================================================================== */ | |
define("API_KEY","## YOUR_SECURE_API_KEY ##"); /* Set this to the api_key we've provided you. DO NOT DISPLAY IT!! */ | |
/* 2. Flash game configuration ====================================================================================== */ | |
define("FLASH_GAME_URL","http://your.host/your_flash_game.swf"); /* Set this to your swf file */ | |
define("FLASH_GAME_WIDTH","100%"); | |
define("FLASH_GAME_HEIGHT","100%"); | |
define("FLASH_GAME_SWFVERSION","10.0"); /* For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. */ | |
define("FLASH_GAME_PLAYERINSTALL","http://api.minijuegos.com/lechuck/static/as3/swfobject/playerProductInstall.swf"); /* To use express install, set to playerProductInstall.swf, otherwise the empty string. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* 1. Decode all get parameters */ | |
// Only if your system configuration or language doesn't automatically decodes it | |
// foreach ($_GET as $key => $value) $_GET[$key] = urldecode($value); | |
/* 2. Check signature */ | |
if ($_GET['mini_signature'] != signParameters("YOUR_API_KEY",$_GET)) { | |
die("The 'mp_*' parameters signature is invalid"); | |
} else { | |
echo "The 'mp_*' parameters signature is valid!"; | |
} |
NewerOlder