1
0
Fork 0
mirror of https://github.com/marcrobledo/RomPatcher.js.git synced 2025-06-27 16:25:54 +00:00

added zip support

This commit is contained in:
Marc Robledo 2019-05-31 21:00:39 +02:00
parent c59a8cbfd0
commit 94529e1a52
19 changed files with 473 additions and 188 deletions

View file

@ -0,0 +1,29 @@
<?php
/*
this template code should build a valid PREDEFINED_PATCHES object structure for Rom Patcher JS
it's intended for sites that host multiple patches (like www.romhacking.net)
note: this has not been tested!
*/
if(isset($_GET["patch"])){
$patchFile=$_GET["patch"];
if(isset($_GET["compressed"])){
$patchFile.="#".$_GET["compressed"];
}
if(isset($_GET["name"])){
$patchName=addslashes($_GET["name"]);
}else{
$patchName=$_GET["patch"];
}
echo "var PREDEFINED_PATCHES=[";
echo "{patch:'".$patchFile."',name:'".$patchName."'";
if(isset($_GET["crc"]) && preg_match("/^[0-9a-f]{1,8}$/i", $_GET["crc"])){
echo ", crc:0x".$_GET["crc"];
}
echo "}";
echo "];";
}
?>