Version 2 trouvée
This commit is contained in:
parent
54c24457e9
commit
bba4b09ee9
|
@ -20,7 +20,7 @@ function addRelease($input) {
|
||||||
$url = 'http://s3.amazonaws.com/MinecraftDownload/minecraft.jar';
|
$url = 'http://s3.amazonaws.com/MinecraftDownload/minecraft.jar';
|
||||||
} else {
|
} else {
|
||||||
$type = 'apr';
|
$type = 'apr';
|
||||||
$url = 'http://assets.minecraft.net/'.$input.'/minecraft.zip';
|
$url = 'http://assets.minecraft.net/'.$input.'/minecraft.jar';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chargement du XML
|
// Chargement du XML
|
||||||
|
@ -43,28 +43,13 @@ function addRelease($input) {
|
||||||
// Extraction et copie de minecraft.jar
|
// Extraction et copie de minecraft.jar
|
||||||
$directory = $id.' - '.$lastVersions_e[0].' ('.rand(1, 1000).')';
|
$directory = $id.' - '.$lastVersions_e[0].' ('.rand(1, 1000).')';
|
||||||
if (!mkdir($directory) OR !copy($url, $directory.'/minecraft.jar')) { return 'ERREUR Impossible de copier le fichier ou de cr<63>er un nouveau dossier.';}
|
if (!mkdir($directory) OR !copy($url, $directory.'/minecraft.jar')) { return 'ERREUR Impossible de copier le fichier ou de cr<63>er un nouveau dossier.';}
|
||||||
if ($type == 'r') {
|
$zip = new ZipArchive;
|
||||||
$zip = new ZipArchive;
|
if ($zip->open($directory.'/minecraft.jar') AND mkdir($directory.'/content')) {
|
||||||
if ($zip->open($directory.'/minecraft.jar') AND mkdir($directory.'/content')) {
|
$zip->extractTo($directory.'/content');
|
||||||
$zip->extractTo($directory.'/content');
|
$zip->close();
|
||||||
$zip->close();
|
} else {
|
||||||
}
|
return 'ERREUR Impossible d\'extraire le fichier ou de cr<63>er un nouveau dossier.';
|
||||||
} else {
|
}
|
||||||
$zip = new ZipArchive;
|
|
||||||
if ($zip->open($directory.'/minecraft.jar') AND mkdir($directory.'/extract')) {
|
|
||||||
$zip->extractTo($directory.'/extract');
|
|
||||||
$zip->close();
|
|
||||||
$zip2 = new ZipArchive;
|
|
||||||
if ($zip2->open($directory.'/extract/bin/minecraft.jar') AND mkdir($directory.'/content')) {
|
|
||||||
$zip2->extractTo($directory.'/content');
|
|
||||||
$zip2->close();
|
|
||||||
} else {
|
|
||||||
return 'ERREUR Impossible d\'extraire le fichier ou de cr<63>er un nouveau dossier².';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return 'ERREUR Impossible d\'extraire le fichier ou de cr<63>er un nouveau dossier.';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$md5 = md5_file($directory.'/minecraft.jar');
|
$md5 = md5_file($directory.'/minecraft.jar');
|
||||||
directoryConstruct($directory.'/content', $files, $data, directoryOld($release));
|
directoryConstruct($directory.'/content', $files, $data, directoryOld($release));
|
||||||
|
|
||||||
|
|
470
index.php
470
index.php
|
@ -1,236 +1,236 @@
|
||||||
<?php
|
<?php
|
||||||
$data = new DomDocument();
|
$data = new DomDocument();
|
||||||
$data->load('data.xml');
|
$data->load('data.xml');
|
||||||
$dataNode = $data->getElementsByTagName('data')->item(0);
|
$dataNode = $data->getElementsByTagName('data')->item(0);
|
||||||
$mcupdatesNode = $dataNode->getElementsByTagName('mcupdates')->item(0);
|
$mcupdatesNode = $dataNode->getElementsByTagName('mcupdates')->item(0);
|
||||||
$releaseS = $mcupdatesNode->getElementsByTagName('release');
|
$releaseS = $mcupdatesNode->getElementsByTagName('release');
|
||||||
$text = '';
|
$text = '';
|
||||||
for ($i = $releaseS->length; $i > 1; $i--) {
|
for ($i = $releaseS->length; $i > 1; $i--) {
|
||||||
$release = $releaseS->item($i-1);
|
$release = $releaseS->item($i-1);
|
||||||
$releaseInfos = $release->getElementsByTagName('infos')->item(0);
|
$releaseInfos = $release->getElementsByTagName('infos')->item(0);
|
||||||
$text .= '<h3>Minecraft '.$release->getAttribute('name').' ';
|
$text .= '<h3>Minecraft '.$release->getAttribute('name').' ';
|
||||||
if (isset($prevRelease)) {
|
if (isset($prevRelease)) {
|
||||||
if ($release->getAttribute('name') == $prevRelease->getAttribute('name')) {
|
if ($release->getAttribute('name') == $prevRelease->getAttribute('name')) {
|
||||||
$text .= '(version enterrée) ';
|
$text .= '(version enterrée) ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$shortDescription = $releaseInfos->getAttribute('shortDescription');
|
$shortDescription = $releaseInfos->getAttribute('shortDescription');
|
||||||
if ($shortDescription == 'false') {
|
if ($shortDescription == 'false') {
|
||||||
$shortDescription = 'Pas de description.';
|
$shortDescription = 'Pas de description.';
|
||||||
}
|
}
|
||||||
$text .= '</h3><div class="release" id="R'.$release->getAttribute('id').'"><div class="shortDescription">'.$shortDescription.' <input type="button" value="+" class="more" /></div><div class="content"></div></div>';
|
$text .= '</h3><div class="release" id="R'.$release->getAttribute('id').'"><div class="shortDescription">'.$shortDescription.' <input type="button" value="+" class="more" /></div><div class="content"></div></div>';
|
||||||
$prevRelease = $release;
|
$prevRelease = $release;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
<head>
|
<head>
|
||||||
<title>Minecraft Checker</title>
|
<title>Minecraft Checker</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<link rel="stylesheet" media="screen" type="text/css" title="design" href="design.css">
|
<link rel="stylesheet" media="screen" type="text/css" title="design" href="design.css">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var checkIntervalForm;
|
var checkIntervalForm;
|
||||||
var checkState;
|
var checkState;
|
||||||
var checkTimeout;
|
var checkTimeout;
|
||||||
var addXhr;
|
var addXhr;
|
||||||
var allReleases;
|
var allReleases;
|
||||||
var checkXhr;
|
var checkXhr;
|
||||||
var lastId = <?php echo $mcupdatesNode->getAttribute('total'); ?>;
|
var lastId = <?php echo $mcupdatesNode->getAttribute('total'); ?>;
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
checkIntervalForm = document.getElementById('checkActivate');
|
checkIntervalForm = document.getElementById('checkActivate');
|
||||||
checkState = document.getElementById('checkState');
|
checkState = document.getElementById('checkState');
|
||||||
checkIntervalForm.addEventListener('change', function(e) {
|
checkIntervalForm.addEventListener('change', function(e) {
|
||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
checkState.innerHTML = 'activé';
|
checkState.innerHTML = 'activé';
|
||||||
checkTimeout = true;
|
checkTimeout = true;
|
||||||
check();
|
check();
|
||||||
console.log('Checking activated');
|
console.log('Checking activated');
|
||||||
} else {
|
} else {
|
||||||
checkState.innerHTML = 'désactivé';
|
checkState.innerHTML = 'désactivé';
|
||||||
clearTimeout(checkTimeout); // TODO Annulation de checkXhr
|
clearTimeout(checkTimeout); // TODO Annulation de checkXhr
|
||||||
checkTimeout = false;
|
checkTimeout = false;
|
||||||
checkXhr.abort();
|
checkXhr.abort();
|
||||||
console.log('Checking stopped');
|
console.log('Checking stopped');
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
allReleases = document.getElementById('allreleases');
|
allReleases = document.getElementById('allreleases');
|
||||||
allReleaseS = allReleases.getElementsByClassName('more');
|
allReleaseS = allReleases.getElementsByClassName('more');
|
||||||
for (var allReleaseI = 0; allReleaseI < allReleaseS.length; allReleaseI++) {
|
for (var allReleaseI = 0; allReleaseI < allReleaseS.length; allReleaseI++) {
|
||||||
allReleaseS[allReleaseI].addEventListener('click', releaseOpen, false);
|
allReleaseS[allReleaseI].addEventListener('click', releaseOpen, false);
|
||||||
}
|
}
|
||||||
console.log('System initialised');
|
console.log('System initialised');
|
||||||
}
|
}
|
||||||
function releaseOpen(e) {
|
function releaseOpen(e) {
|
||||||
e.target.value = '...';
|
e.target.value = '...';
|
||||||
var releaseXhr = new XMLHttpRequest();
|
var releaseXhr = new XMLHttpRequest();
|
||||||
releaseXhr.onreadystatechange = function() {
|
releaseXhr.onreadystatechange = function() {
|
||||||
if (releaseXhr.readyState == 4 && (releaseXhr.status == 200 || releaseXhr.status == 0)) {
|
if (releaseXhr.readyState == 4 && (releaseXhr.status == 200 || releaseXhr.status == 0)) {
|
||||||
e.target.removeEventListener('click', releaseOpen, false);
|
e.target.removeEventListener('click', releaseOpen, false);
|
||||||
console.log(' Infos recevied');
|
console.log(' Infos recevied');
|
||||||
var content = e.target.parentNode.parentNode.getElementsByClassName('content')[0];
|
var content = e.target.parentNode.parentNode.getElementsByClassName('content')[0];
|
||||||
content.innerHTML = releaseXhr.responseText;
|
content.innerHTML = releaseXhr.responseText;
|
||||||
if (content.getElementsByClassName('releaseFiles')[0]) {
|
if (content.getElementsByClassName('releaseFiles')[0]) {
|
||||||
content.getElementsByClassName('releaseFilesButton')[0].addEventListener('click', releaseFilesOpen, false);
|
content.getElementsByClassName('releaseFilesButton')[0].addEventListener('click', releaseFilesOpen, false);
|
||||||
filesDirExpandS = content.getElementsByClassName('dir');
|
filesDirExpandS = content.getElementsByClassName('dir');
|
||||||
for (var filesDirExpandI = 0; filesDirExpandI < filesDirExpandS.length; filesDirExpandI++) {
|
for (var filesDirExpandI = 0; filesDirExpandI < filesDirExpandS.length; filesDirExpandI++) {
|
||||||
filesDirExpandS[filesDirExpandI].addEventListener('click', releaseFilesDirOpen, false);
|
filesDirExpandS[filesDirExpandI].addEventListener('click', releaseFilesDirOpen, false);
|
||||||
}
|
}
|
||||||
var releaseFilesSelectionS = content.getElementsByClassName('releaseFiles')[0].getElementsByTagName('input');
|
var releaseFilesSelectionS = content.getElementsByClassName('releaseFiles')[0].getElementsByTagName('input');
|
||||||
for (var releaseFilesSelectionI = 0; releaseFilesSelectionI < releaseFilesSelectionS.length; releaseFilesSelectionI++) {
|
for (var releaseFilesSelectionI = 0; releaseFilesSelectionI < releaseFilesSelectionS.length; releaseFilesSelectionI++) {
|
||||||
if (releaseFilesSelectionS[releaseFilesSelectionI].name == 'filesSelectionChangement' || releaseFilesSelectionS[releaseFilesSelectionI].name == 'filesSelectionClass') {
|
if (releaseFilesSelectionS[releaseFilesSelectionI].name == 'filesSelectionChangement' || releaseFilesSelectionS[releaseFilesSelectionI].name == 'filesSelectionClass') {
|
||||||
releaseFilesSelectionS[releaseFilesSelectionI].addEventListener('click', releaseFilesOrderEvent, false);
|
releaseFilesSelectionS[releaseFilesSelectionI].addEventListener('click', releaseFilesOrderEvent, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.target.value = '-';
|
e.target.value = '-';
|
||||||
e.target.addEventListener('click', releaseClose, false);
|
e.target.addEventListener('click', releaseClose, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var releaseId = e.target.parentNode.parentNode.id.split('R')[1];
|
var releaseId = e.target.parentNode.parentNode.id.split('R')[1];
|
||||||
console.log('Searching details for release ID = '+releaseId+'.');
|
console.log('Searching details for release ID = '+releaseId+'.');
|
||||||
releaseXhr.open('GET', 'moreinfos.php?i='+releaseId, true);
|
releaseXhr.open('GET', 'moreinfos.php?i='+releaseId, true);
|
||||||
releaseXhr.send(null);
|
releaseXhr.send(null);
|
||||||
}
|
}
|
||||||
function releaseFilesDirOpen(e) {
|
function releaseFilesDirOpen(e) {
|
||||||
e.target.parentNode.getElementsByClassName('dirUl')[0].style.display = '';
|
e.target.parentNode.getElementsByClassName('dirUl')[0].style.display = '';
|
||||||
e.target.className = 'dir opened';
|
e.target.className = 'dir opened';
|
||||||
e.target.removeEventListener('click', releaseFilesDirOpen, false);
|
e.target.removeEventListener('click', releaseFilesDirOpen, false);
|
||||||
e.target.addEventListener('click', releaseFilesDirClose, false);
|
e.target.addEventListener('click', releaseFilesDirClose, false);
|
||||||
}
|
}
|
||||||
function releaseFilesDirClose(e) {
|
function releaseFilesDirClose(e) {
|
||||||
e.target.parentNode.getElementsByClassName('dirUl')[0].style.display = 'none';
|
e.target.parentNode.getElementsByClassName('dirUl')[0].style.display = 'none';
|
||||||
e.target.className = 'dir closed';
|
e.target.className = 'dir closed';
|
||||||
e.target.removeEventListener('click', releaseFilesDirClose, false);
|
e.target.removeEventListener('click', releaseFilesDirClose, false);
|
||||||
e.target.addEventListener('click', releaseFilesDirOpen, false);
|
e.target.addEventListener('click', releaseFilesDirOpen, false);
|
||||||
}
|
}
|
||||||
function releaseClose(e) {
|
function releaseClose(e) {
|
||||||
e.target.value = '...';
|
e.target.value = '...';
|
||||||
e.target.parentNode.parentNode.getElementsByClassName('content')[0].innerHTML = '';
|
e.target.parentNode.parentNode.getElementsByClassName('content')[0].innerHTML = '';
|
||||||
e.target.removeEventListener('click', releaseClose, false);
|
e.target.removeEventListener('click', releaseClose, false);
|
||||||
e.target.addEventListener('click', releaseOpen, false);
|
e.target.addEventListener('click', releaseOpen, false);
|
||||||
e.target.value = '+';
|
e.target.value = '+';
|
||||||
}
|
}
|
||||||
function releaseFilesOpen(e) {
|
function releaseFilesOpen(e) {
|
||||||
e.target.value = '...';
|
e.target.value = '...';
|
||||||
var releaseFiles = e.target.parentNode.parentNode.getElementsByClassName('releaseFiles')[0];
|
var releaseFiles = e.target.parentNode.parentNode.getElementsByClassName('releaseFiles')[0];
|
||||||
releaseFiles.style.display = '';
|
releaseFiles.style.display = '';
|
||||||
releaseFilesOrder(releaseFiles);
|
releaseFilesOrder(releaseFiles);
|
||||||
e.target.removeEventListener('click', releaseFilesOpen, false);
|
e.target.removeEventListener('click', releaseFilesOpen, false);
|
||||||
e.target.addEventListener('click', releaseFilesClose, false);
|
e.target.addEventListener('click', releaseFilesClose, false);
|
||||||
e.target.value = '-';
|
e.target.value = '-';
|
||||||
}
|
}
|
||||||
function releaseFilesOrder(releaseFiles) {
|
function releaseFilesOrder(releaseFiles) {
|
||||||
var releaseFilesFileS = releaseFiles.getElementsByClassName('file');
|
var releaseFilesFileS = releaseFiles.getElementsByClassName('file');
|
||||||
var releaseFilesSelectionClassAll = releaseFiles.getElementsByClassName('fileSelectionClassAll')[0].checked;
|
var releaseFilesSelectionClassAll = releaseFiles.getElementsByClassName('fileSelectionClassAll')[0].checked;
|
||||||
var releaseFilesSelectionClassNonTechnic = releaseFiles.getElementsByClassName('fileSelectionClassNontechnic')[0].checked;
|
var releaseFilesSelectionClassNonTechnic = releaseFiles.getElementsByClassName('fileSelectionClassNontechnic')[0].checked;
|
||||||
var releaseFilesSelectionClassNone = releaseFiles.getElementsByClassName('fileSelectionClassNone')[0].checked;
|
var releaseFilesSelectionClassNone = releaseFiles.getElementsByClassName('fileSelectionClassNone')[0].checked;
|
||||||
var releaseFilesSelectionChangementAll = releaseFiles.getElementsByClassName('fileSelectionChangementAll')[0].checked;
|
var releaseFilesSelectionChangementAll = releaseFiles.getElementsByClassName('fileSelectionChangementAll')[0].checked;
|
||||||
var releaseFilesSelectionChangementChanged = releaseFiles.getElementsByClassName('fileSelectionChangementChanged')[0].checked;
|
var releaseFilesSelectionChangementChanged = releaseFiles.getElementsByClassName('fileSelectionChangementChanged')[0].checked;
|
||||||
var releaseFilesSelectionChangementAdded = releaseFiles.getElementsByClassName('fileSelectionChangementAdded')[0].checked;
|
var releaseFilesSelectionChangementAdded = releaseFiles.getElementsByClassName('fileSelectionChangementAdded')[0].checked;
|
||||||
for (var releaseFilesFileI = 0; releaseFilesFileI < releaseFilesFileS.length; releaseFilesFileI++) {
|
for (var releaseFilesFileI = 0; releaseFilesFileI < releaseFilesFileS.length; releaseFilesFileI++) {
|
||||||
var releaseFilesFileClassE = releaseFilesFileS[releaseFilesFileI].className.split(' ');
|
var releaseFilesFileClassE = releaseFilesFileS[releaseFilesFileI].className.split(' ');
|
||||||
var releaseFilesFileTechnic = in_array('technic', releaseFilesFileClassE);
|
var releaseFilesFileTechnic = in_array('technic', releaseFilesFileClassE);
|
||||||
var releaseFilesFileClass = in_array('class', releaseFilesFileClassE);
|
var releaseFilesFileClass = in_array('class', releaseFilesFileClassE);
|
||||||
var releaseFilesFileChanged = in_array('change', releaseFilesFileClassE);
|
var releaseFilesFileChanged = in_array('change', releaseFilesFileClassE);
|
||||||
var releaseFilesFileAdded = in_array('added', releaseFilesFileClassE);
|
var releaseFilesFileAdded = in_array('added', releaseFilesFileClassE);
|
||||||
if ((releaseFilesSelectionClassAll || (releaseFilesSelectionClassNonTechnic && (!releaseFilesFileTechnic)) || (releaseFilesSelectionClassNone && (!releaseFilesFileClass))) && (releaseFilesSelectionChangementAll || (releaseFilesSelectionChangementChanged && (releaseFilesFileChanged || releaseFilesFileAdded)) || (releaseFilesSelectionChangementAdded && releaseFilesFileAdded))) {
|
if ((releaseFilesSelectionClassAll || (releaseFilesSelectionClassNonTechnic && (!releaseFilesFileTechnic)) || (releaseFilesSelectionClassNone && (!releaseFilesFileClass))) && (releaseFilesSelectionChangementAll || (releaseFilesSelectionChangementChanged && (releaseFilesFileChanged || releaseFilesFileAdded)) || (releaseFilesSelectionChangementAdded && releaseFilesFileAdded))) {
|
||||||
releaseFilesFileS[releaseFilesFileI].parentNode.style.display = '';
|
releaseFilesFileS[releaseFilesFileI].parentNode.style.display = '';
|
||||||
} else {
|
} else {
|
||||||
releaseFilesFileS[releaseFilesFileI].parentNode.style.display = 'none';
|
releaseFilesFileS[releaseFilesFileI].parentNode.style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function releaseFilesOrderEvent(e) {
|
function releaseFilesOrderEvent(e) {
|
||||||
releaseFilesOrder(e.target.parentNode.parentNode);
|
releaseFilesOrder(e.target.parentNode.parentNode);
|
||||||
}
|
}
|
||||||
function releaseFilesClose(e) {
|
function releaseFilesClose(e) {
|
||||||
e.target.value = '+';
|
e.target.value = '+';
|
||||||
e.target.parentNode.parentNode.getElementsByClassName('releaseFiles')[0].style.display = 'none';
|
e.target.parentNode.parentNode.getElementsByClassName('releaseFiles')[0].style.display = 'none';
|
||||||
e.target.removeEventListener('click', releaseFilesClose, false);
|
e.target.removeEventListener('click', releaseFilesClose, false);
|
||||||
e.target.addEventListener('click', releaseFilesOpen, false);
|
e.target.addEventListener('click', releaseFilesOpen, false);
|
||||||
}
|
}
|
||||||
function check() {
|
function check() {
|
||||||
checkXhr = new XMLHttpRequest();
|
checkXhr = new XMLHttpRequest();
|
||||||
checkXhr.onreadystatechange = function() {
|
checkXhr.onreadystatechange = function() {
|
||||||
if (checkXhr.readyState == 4 && (checkXhr.status == 200 || checkXhr.status == 0)) {
|
if (checkXhr.readyState == 4 && (checkXhr.status == 200 || checkXhr.status == 0)) {
|
||||||
console.log('Check finished, with information : '+checkXhr.responseText);
|
console.log('Check finished, with information : '+checkXhr.responseText);
|
||||||
var newReleaseE = checkXhr.responseText.split('|');
|
var newReleaseE = checkXhr.responseText.split('|');
|
||||||
if (newReleaseE.length == 8 && checkTimeout) {
|
if (newReleaseE.length == 8 && checkTimeout) {
|
||||||
if (newReleaseE[5] == lastId) {
|
if (newReleaseE[5] == lastId) {
|
||||||
console.log(' Information analysed : no new release (date: '+newReleaseE[0]+').');
|
console.log(' Information analysed : no new release (date: '+newReleaseE[0]+').');
|
||||||
checkState.innerHTML = 'attente';
|
checkState.innerHTML = 'attente';
|
||||||
} else if (newReleaseE[5] > lastId) {
|
} else if (newReleaseE[5] > lastId) {
|
||||||
console.log(' Information analysed : new release.');
|
console.log(' Information analysed : new release.');
|
||||||
checkState.innerHTML = 'nouvelle version';
|
checkState.innerHTML = 'nouvelle version';
|
||||||
// TODO Vérifier si (newReleaseE[5] == lastId+1)
|
// TODO Vérifier si (newReleaseE[5] == lastId+1)
|
||||||
lastRelease = newReleaseE[6];
|
lastRelease = newReleaseE[6];
|
||||||
if (newReleaseE[7] == 'r' && newReleaseE[5] == lastId+1) {
|
if (newReleaseE[7] == 'r' && newReleaseE[5] == lastId+1) {
|
||||||
var newReleaseAlertType = 'La release complète';
|
var newReleaseAlertType = 'La release complète';
|
||||||
} else if (newReleaseE[7] == 'apr' && newReleaseE[5] == lastId+1) {
|
} else if (newReleaseE[7] == 'apr' && newReleaseE[5] == lastId+1) {
|
||||||
var newReleaseAlertType = 'La pre-release automatique';
|
var newReleaseAlertType = 'La pre-release automatique';
|
||||||
} else if (newReleaseE[7] == 'pr' && newReleaseE[5] == lastId+1) {
|
} else if (newReleaseE[7] == 'pr' && newReleaseE[5] == lastId+1) {
|
||||||
var newReleaseAlertType = 'La pre-release';
|
var newReleaseAlertType = 'La pre-release';
|
||||||
} else {
|
} else {
|
||||||
console.error(' Bad informations on the new release. Reloading page.');
|
console.error(' Bad informations on the new release. Reloading page.');
|
||||||
checkState.innerHTML = 'erreur';
|
checkState.innerHTML = 'erreur';
|
||||||
location.reload();
|
location.reload();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
lastId = newReleaseE[5];
|
lastId = newReleaseE[5];
|
||||||
console.info('New release: name: '+lastRelease+' id:'+newReleaseE[5]+' type: '+newReleaseE[7]+'.');
|
console.info('New release: name: '+lastRelease+' id:'+newReleaseE[5]+' type: '+newReleaseE[7]+'.');
|
||||||
checkState.innerHTML = 'nouvelle version';
|
checkState.innerHTML = 'nouvelle version';
|
||||||
document.title='Version '+lastRelease+' sortie !';
|
document.title='Version '+lastRelease+' sortie !';
|
||||||
alert(newReleaseAlertType+' '+lastRelease+' est sortie !');
|
alert(newReleaseAlertType+' '+lastRelease+' est sortie !');
|
||||||
location.reload();
|
location.reload();
|
||||||
} else {
|
} else {
|
||||||
console.error('Database upset. Reloading page.');
|
console.error('Database upset. Reloading page.');
|
||||||
checkState.innerHTML = 'erreur';
|
checkState.innerHTML = 'erreur';
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
checkTimeout = setTimeout('check()', 5000);
|
checkTimeout = setTimeout('check()', 5000);
|
||||||
} else if (!checkTimeout) {
|
} else if (!checkTimeout) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
console.error('Error comited server-side.');
|
console.error('Error comited server-side.');
|
||||||
checkState.innerHTML = 'erreur';
|
checkState.innerHTML = 'erreur';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
checkXhr.open('GET', 'test.php', true);
|
checkXhr.open('GET', 'test.php', true);
|
||||||
checkState.innerHTML = 'recherche';
|
checkState.innerHTML = 'recherche';
|
||||||
checkXhr.send(null);
|
checkXhr.send(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
function in_array(needle, haystack) {
|
function in_array(needle, haystack) {
|
||||||
for (key in haystack) {
|
for (key in haystack) {
|
||||||
if (haystack[key] == needle) {
|
if (haystack[key] == needle) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Minecraft Checker</h1>
|
<h1>Minecraft Checker</h1>
|
||||||
<div id="body">
|
<div id="body">
|
||||||
<h2>Rechercher des versions</h2>
|
<h2>Rechercher des versions</h2>
|
||||||
<p class="RL_search"><input type="checkbox" id="checkActivate" name="checkActivate"/><label for="checkActivate"> Rechercher les nouvelles releases (<span id="checkState">désactivé</span>)</label></p>
|
<p class="RL_search"><input type="checkbox" id="checkActivate" name="checkActivate"/><label for="checkActivate"> Rechercher les nouvelles releases (<span id="checkState">désactivé</span>)</label></p>
|
||||||
|
|
||||||
<h2>Versions référencées</h2>
|
<h2>Versions référencées</h2>
|
||||||
<div id="allreleases">
|
<div id="allreleases">
|
||||||
<?php echo $text; ?>
|
<?php echo $text; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p id="copyright">Copyright © <a href="https://twitter.com/#!/WebFrogeye">WebFrogeye</a> 2012</p>
|
<p id="copyright">Copyright © <a href="https://twitter.com/#!/WebFrogeye">WebFrogeye</a> 2012</p>
|
||||||
<p>Créé par <a href="https://twitter.com/#!/WebFrogeye">@WebFrogeye</a>.<br/>
|
<p>Créé par <a href="https://twitter.com/#!/WebFrogeye">@WebFrogeye</a>.<br/>
|
||||||
Avec l'aide d'<a href="https://twitter.com/#!/EphysPotato">@EphysPotato</a>.<br/>
|
Avec l'aide d'<a href="https://twitter.com/#!/EphysPotato">@EphysPotato</a>.<br/>
|
||||||
Sur un design de <a href="http://dlp.host56.com/">DLProduction</a>.<br/>
|
Sur un design de <a href="http://dlp.host56.com/">DLProduction</a>.<br/>
|
||||||
D'après un script de <a href="https://twitter.com/#!/shellgratuit">@shellgratuit</a>.</p>
|
D'après un script de <a href="https://twitter.com/#!/shellgratuit">@shellgratuit</a>.</p>
|
||||||
</footer>
|
</footer>
|
||||||
<div id="cache" style="display: none;"></div>
|
<div id="cache" style="display: none;"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1 +1 @@
|
||||||
1336223378|1.2.5|8e8778078a175a33603a585257f28563|12w18a|37d778548796dd95c4d0ea49a015be06|27|12w18a|apr
|
1341566731|1.2.5|8e8778078a175a33603a585257f28563|UP|ac908492cdfe6c1d81183d2d2d7959a1|34|12w24a|apr
|
354
preRelease.php
354
preRelease.php
|
@ -1,178 +1,178 @@
|
||||||
<?php
|
<?php
|
||||||
set_time_limit('240');
|
set_time_limit('240');
|
||||||
addRelease('1_2_5');
|
addRelease('1_2_5');
|
||||||
function addRelease($input) {
|
function addRelease($input) {
|
||||||
$debug = false;
|
$debug = false;
|
||||||
// Définition des variables de travail
|
// Définition des variables de travail
|
||||||
$lastVersions_e = explode('|', file_get_contents('lastVersions.txt'));
|
$lastVersions_e = explode('|', file_get_contents('lastVersions.txt'));
|
||||||
$lastVersions_e_backup = $lastVersions_e;
|
$lastVersions_e_backup = $lastVersions_e;
|
||||||
if ($input == 'r') {
|
if ($input == 'r') {
|
||||||
$lastVersions_e[1] = 'UP';
|
$lastVersions_e[1] = 'UP';
|
||||||
} else {
|
} else {
|
||||||
$lastVersions_e[3] = 'UP';
|
$lastVersions_e[3] = 'UP';
|
||||||
}
|
}
|
||||||
// Enregistrement des données d'ajout
|
// Enregistrement des données d'ajout
|
||||||
$lastVersions_e[0] = time();
|
$lastVersions_e[0] = time();
|
||||||
$lastVersions_txt = fopen('lastVersions.txt', 'w');
|
$lastVersions_txt = fopen('lastVersions.txt', 'w');
|
||||||
fwrite($lastVersions_txt, implode('|', $lastVersions_e));
|
fwrite($lastVersions_txt, implode('|', $lastVersions_e));
|
||||||
fclose($lastVersions_txt);
|
fclose($lastVersions_txt);
|
||||||
if ($input == 'r') {
|
if ($input == 'r') {
|
||||||
$type = 'r';
|
$type = 'r';
|
||||||
$url = 'http://s3.amazonaws.com/MinecraftDownload/minecraft.jar';
|
$url = 'http://s3.amazonaws.com/MinecraftDownload/minecraft.jar';
|
||||||
} else {
|
} else {
|
||||||
$type = 'pr';
|
$type = 'pr';
|
||||||
$url = 'http://assets.minecraft.net/'.$input.'/minecraft.jar';
|
$url = 'http://assets.minecraft.net/'.$input.'/minecraft.jar';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chargement du XML
|
// Chargement du XML
|
||||||
$data = new DomDocument();
|
$data = new DomDocument();
|
||||||
$data->load('data.xml');
|
$data->load('data.xml');
|
||||||
$dataNode = $data->getElementsByTagName('data')->item(0);
|
$dataNode = $data->getElementsByTagName('data')->item(0);
|
||||||
$mcupdatesNode = $dataNode->getElementsByTagName('mcupdates')->item(0);
|
$mcupdatesNode = $dataNode->getElementsByTagName('mcupdates')->item(0);
|
||||||
$id = $mcupdatesNode->getAttribute('total')+1;
|
$id = $mcupdatesNode->getAttribute('total')+1;
|
||||||
$releaseS = $mcupdatesNode->getElementsByTagName('release');
|
$releaseS = $mcupdatesNode->getElementsByTagName('release');
|
||||||
$release = $releaseS->item($releaseS->length-1);
|
$release = $releaseS->item($releaseS->length-1);
|
||||||
|
|
||||||
// Creation du noeud XML
|
// Creation du noeud XML
|
||||||
$releaseNode = $data->createElement('release');
|
$releaseNode = $data->createElement('release');
|
||||||
$mcupdatesNode->appendChild($releaseNode);
|
$mcupdatesNode->appendChild($releaseNode);
|
||||||
$infosNode = $data->createElement('infos');
|
$infosNode = $data->createElement('infos');
|
||||||
$releaseNode->appendChild($infosNode);
|
$releaseNode->appendChild($infosNode);
|
||||||
$files = $data->createElement('files');
|
$files = $data->createElement('files');
|
||||||
$releaseNode->appendChild($files);
|
$releaseNode->appendChild($files);
|
||||||
|
|
||||||
// Extraction et copie de minecraft.jar
|
// Extraction et copie de minecraft.jar
|
||||||
$directory = $id.' - '.$lastVersions_e[0].' ('.rand(1, 1000).')';
|
$directory = $id.' - '.$lastVersions_e[0].' ('.rand(1, 1000).')';
|
||||||
if (!mkdir($directory) OR !copy($url, $directory.'/minecraft.jar')) { return 'ERREUR Impossible de copier le fichier ou de créer un nouveau dossier.';}
|
if (!mkdir($directory) OR !copy($url, $directory.'/minecraft.jar')) { return 'ERREUR Impossible de copier le fichier ou de créer un nouveau dossier.';}
|
||||||
$zip = new ZipArchive;
|
$zip = new ZipArchive;
|
||||||
if ($zip->open($directory.'/minecraft.jar') AND mkdir($directory.'/content')) {
|
if ($zip->open($directory.'/minecraft.jar') AND mkdir($directory.'/content')) {
|
||||||
$zip->extractTo($directory.'/content');
|
$zip->extractTo($directory.'/content');
|
||||||
$zip->close();
|
$zip->close();
|
||||||
} else {
|
} else {
|
||||||
return 'ERREUR Impossible d\'extraire le fichier ou de créer un nouveau dossier.';
|
return 'ERREUR Impossible d\'extraire le fichier ou de créer un nouveau dossier.';
|
||||||
}
|
}
|
||||||
$md5 = md5_file($directory.'/minecraft.jar');
|
$md5 = md5_file($directory.'/minecraft.jar');
|
||||||
directoryConstruct($directory.'/content', $files, $data, directoryOld($release));
|
directoryConstruct($directory.'/content', $files, $data, directoryOld($release));
|
||||||
|
|
||||||
// Detection de $givenName
|
// Detection de $givenName
|
||||||
// Code par @EphysPatato
|
// Code par @EphysPatato
|
||||||
$minecraft_class = file_get_contents($directory.'/content/net/minecraft/client/Minecraft.class');
|
$minecraft_class = file_get_contents($directory.'/content/net/minecraft/client/Minecraft.class');
|
||||||
$givenName = 'false';
|
$givenName = 'false';
|
||||||
if (preg_match('/Minecraft Minecraft (.+)Minecraft main/', $minecraft_class, $matches)) {
|
if (preg_match('/Minecraft Minecraft (.+)Minecraft main/', $minecraft_class, $matches)) {
|
||||||
$givenName = '';
|
$givenName = '';
|
||||||
$givenName_w = $matches[count($matches)-1];
|
$givenName_w = $matches[count($matches)-1];
|
||||||
for( $i = 0 ; $i < strlen($givenName_w) ; $i++ )
|
for( $i = 0 ; $i < strlen($givenName_w) ; $i++ )
|
||||||
{
|
{
|
||||||
$givenName_cw = substr($givenName_w, $i, 1);
|
$givenName_cw = substr($givenName_w, $i, 1);
|
||||||
if(($givenName_cw >= 'a' && $givenName_cw <= 'z') || ($givenName_cw >= 'A' && $givenName_cw <= 'Z') || ($givenName_cw >= '0' && $givenName_cw <= '9') || $givenName_cw == '|' || $givenName_cw == '.' || $givenName_cw == '_' || $givenName_cw == '-')
|
if(($givenName_cw >= 'a' && $givenName_cw <= 'z') || ($givenName_cw >= 'A' && $givenName_cw <= 'Z') || ($givenName_cw >= '0' && $givenName_cw <= '9') || $givenName_cw == '|' || $givenName_cw == '.' || $givenName_cw == '_' || $givenName_cw == '-')
|
||||||
$givenName .= $givenName_cw;
|
$givenName .= $givenName_cw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Spécifications selon le type de release
|
// Spécifications selon le type de release
|
||||||
if ($type == 'r') {
|
if ($type == 'r') {
|
||||||
$name = $givenName;
|
$name = $givenName;
|
||||||
$lastVersions_e[1] = $name;
|
$lastVersions_e[1] = $name;
|
||||||
$lastVersions_e[2] = $md5;
|
$lastVersions_e[2] = $md5;
|
||||||
$infosNode->setAttribute('wiki', 'http://www.minecraftwiki.net/wiki/Version_history#'.$name);
|
$infosNode->setAttribute('wiki', 'http://www.minecraftwiki.net/wiki/Version_history#'.$name);
|
||||||
} else {
|
} else {
|
||||||
$name = $input;
|
$name = $input;
|
||||||
$lastVersions_e[3] = $name;
|
$lastVersions_e[3] = $name;
|
||||||
$lastVersions_e[4] = $md5;
|
$lastVersions_e[4] = $md5;
|
||||||
$infosNode->setAttribute('wiki', 'http://www.minecraftwiki.net/wiki/Version_history/Development_versions#'.$name);
|
$infosNode->setAttribute('wiki', 'http://www.minecraftwiki.net/wiki/Version_history/Development_versions#'.$name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mise des infos dans le XML
|
// Mise des infos dans le XML
|
||||||
$releaseNode->setAttribute('id', $id);
|
$releaseNode->setAttribute('id', $id);
|
||||||
$releaseNode->setAttribute('name', $name);
|
$releaseNode->setAttribute('name', $name);
|
||||||
$releaseNode->setAttribute('type', $type);
|
$releaseNode->setAttribute('type', $type);
|
||||||
$infosNode->setAttribute('givenName', $givenName);
|
$infosNode->setAttribute('givenName', $givenName);
|
||||||
$infosNode->setAttribute('directory', $directory);
|
$infosNode->setAttribute('directory', $directory);
|
||||||
$infosNode->setAttribute('link', $url);
|
$infosNode->setAttribute('link', $url);
|
||||||
$infosNode->setAttribute('size', filesize($directory.'/minecraft.jar'));
|
$infosNode->setAttribute('size', filesize($directory.'/minecraft.jar'));
|
||||||
$infosNode->setAttribute('md5', $md5);
|
$infosNode->setAttribute('md5', $md5);
|
||||||
$infosNode->setAttribute('sha1', sha1_file($directory.'/minecraft.jar'));
|
$infosNode->setAttribute('sha1', sha1_file($directory.'/minecraft.jar'));
|
||||||
$infosNode->setAttribute('date', $lastVersions_e[0]);
|
$infosNode->setAttribute('date', $lastVersions_e[0]);
|
||||||
$infosNode->setAttribute('shortDescription', 'false');
|
$infosNode->setAttribute('shortDescription', 'false');
|
||||||
$mcupdatesNode->setAttribute('total', $id);
|
$mcupdatesNode->setAttribute('total', $id);
|
||||||
|
|
||||||
// Sauvegarde finale
|
// Sauvegarde finale
|
||||||
$lastVersions_e[0] = time();
|
$lastVersions_e[0] = time();
|
||||||
$lastVersions_e[5] = $id;
|
$lastVersions_e[5] = $id;
|
||||||
$lastVersions_e[6] = $name;
|
$lastVersions_e[6] = $name;
|
||||||
$lastVersions_e[7] = $type;
|
$lastVersions_e[7] = $type;
|
||||||
$id = $mcupdatesNode->setAttribute('total', $id);
|
$id = $mcupdatesNode->setAttribute('total', $id);
|
||||||
$lastVersions_f = fopen('lastVersions.txt', 'w');
|
$lastVersions_f = fopen('lastVersions.txt', 'w');
|
||||||
$lastError = error_get_last();
|
$lastError = error_get_last();
|
||||||
if ($debug) { echo substr($lastError['file'], -14); }
|
if ($debug) { echo substr($lastError['file'], -14); }
|
||||||
if ($lastError /*AND $lastError['type']!= 2 */AND substr($lastError['file'], -14) == 'addrelease.php') {
|
if ($lastError /*AND $lastError['type']!= 2 */AND substr($lastError['file'], -14) == 'addrelease.php') {
|
||||||
fwrite($lastVersions_f, implode('|', $lastVersions_e_backup));
|
fwrite($lastVersions_f, implode('|', $lastVersions_e_backup));
|
||||||
rrmdir($directory);
|
rrmdir($directory);
|
||||||
return 'ERREUR "'.$lastError['message'].'" (type : '.$lastError['type'].') dans '.$lastError['file'].' ligne '.$lastError['line'].'.';
|
return 'ERREUR "'.$lastError['message'].'" (type : '.$lastError['type'].') dans '.$lastError['file'].' ligne '.$lastError['line'].'.';
|
||||||
} else {
|
} else {
|
||||||
$data->save('data.xml');
|
$data->save('data.xml');
|
||||||
fwrite($lastVersions_f, implode('|', $lastVersions_e));
|
fwrite($lastVersions_f, implode('|', $lastVersions_e));
|
||||||
fclose($lastVersions_f);
|
fclose($lastVersions_f);
|
||||||
return implode('|', $lastVersions_e);
|
return implode('|', $lastVersions_e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function directoryConstruct($directoryName, $XML, $data, $array) {
|
function directoryConstruct($directoryName, $XML, $data, $array) {
|
||||||
$directory = opendir($directoryName);
|
$directory = opendir($directoryName);
|
||||||
while($file = readdir($directory)) {
|
while($file = readdir($directory)) {
|
||||||
if ($file != '.' AND $file != '..') {
|
if ($file != '.' AND $file != '..') {
|
||||||
if (is_dir($directoryName.'/'.$file)) {
|
if (is_dir($directoryName.'/'.$file)) {
|
||||||
$newDirectory = $data->createElement('dir');
|
$newDirectory = $data->createElement('dir');
|
||||||
$XML->appendChild($newDirectory);
|
$XML->appendChild($newDirectory);
|
||||||
$newDirectory->setAttribute('name', $file);
|
$newDirectory->setAttribute('name', $file);
|
||||||
if (isset($array[$file])) {
|
if (isset($array[$file])) {
|
||||||
$newDirectory->setAttribute('comparaison', 'same');
|
$newDirectory->setAttribute('comparaison', 'same');
|
||||||
directoryConstruct($directoryName.'/'.$file, $newDirectory, $data, $array[$file]);
|
directoryConstruct($directoryName.'/'.$file, $newDirectory, $data, $array[$file]);
|
||||||
} else {
|
} else {
|
||||||
$newDirectory->setAttribute('comparaison', 'added');
|
$newDirectory->setAttribute('comparaison', 'added');
|
||||||
directoryConstruct($directoryName.'/'.$file, $newDirectory, $data, array());
|
directoryConstruct($directoryName.'/'.$file, $newDirectory, $data, array());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$fileXML = $data->createElement('file');
|
$fileXML = $data->createElement('file');
|
||||||
$XML->appendChild($fileXML);
|
$XML->appendChild($fileXML);
|
||||||
$fileXML->setAttribute('name', $file);
|
$fileXML->setAttribute('name', $file);
|
||||||
$fileXML->setAttribute('md5', md5_file($directoryName.'/'.$file));
|
$fileXML->setAttribute('md5', md5_file($directoryName.'/'.$file));
|
||||||
if (isset($array[$file])) {
|
if (isset($array[$file])) {
|
||||||
if ($array[$file] == md5_file($directoryName.'/'.$file)) {
|
if ($array[$file] == md5_file($directoryName.'/'.$file)) {
|
||||||
$fileXML->setAttribute('comparaison', 'same');
|
$fileXML->setAttribute('comparaison', 'same');
|
||||||
} else {
|
} else {
|
||||||
$fileXML->setAttribute('comparaison', 'change');
|
$fileXML->setAttribute('comparaison', 'change');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$fileXML->setAttribute('comparaison', 'added');
|
$fileXML->setAttribute('comparaison', 'added');
|
||||||
}
|
}
|
||||||
// TODO Verifier si un fichier a été supprimé
|
// TODO Verifier si un fichier a été supprimé
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function directoryOld($XML) {
|
function directoryOld($XML) {
|
||||||
$array = array();
|
$array = array();
|
||||||
$dirS = $XML->getElementsByTagName('dir');
|
$dirS = $XML->getElementsByTagName('dir');
|
||||||
for ($c = $dirS->length, $i = 0; $i < $c; $i++) {
|
for ($c = $dirS->length, $i = 0; $i < $c; $i++) {
|
||||||
$dir = $dirS->item($i);
|
$dir = $dirS->item($i);
|
||||||
$array[$dir->getAttribute('name')]= directoryOld($dir);
|
$array[$dir->getAttribute('name')]= directoryOld($dir);
|
||||||
}
|
}
|
||||||
$fileS = $XML->getElementsByTagName('file');
|
$fileS = $XML->getElementsByTagName('file');
|
||||||
for ($c = $fileS->length, $i = 0; $i < $c; $i++) {
|
for ($c = $fileS->length, $i = 0; $i < $c; $i++) {
|
||||||
$file = $fileS->item($i);
|
$file = $fileS->item($i);
|
||||||
$array[$file->getAttribute('name')] = $file->getAttribute('md5');
|
$array[$file->getAttribute('name')] = $file->getAttribute('md5');
|
||||||
}
|
}
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
function rrmdir($dir) { // Par holger1@NOSPAMzentralplan.de
|
function rrmdir($dir) { // Par holger1@NOSPAMzentralplan.de
|
||||||
if (is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
$objects = scandir($dir);
|
$objects = scandir($dir);
|
||||||
foreach ($objects as $object) {
|
foreach ($objects as $object) {
|
||||||
if ($object != "." && $object != "..") {
|
if ($object != "." && $object != "..") {
|
||||||
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
|
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reset($objects);
|
reset($objects);
|
||||||
rmdir($dir);
|
rmdir($dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
4
test.php
4
test.php
|
@ -50,7 +50,7 @@ if (substr($lastVersions_e[3], 0, 2) == substr(date('Y'), 2, 2) AND substr($last
|
||||||
if (true) {
|
if (true) {
|
||||||
// if (((date('D') == 'Thu') AND $nextAPR_firstOfWeek AND time()-$lastVersions_e[0] >= 5) OR time()-$lastVersions_e[0] >= 10) {
|
// if (((date('D') == 'Thu') AND $nextAPR_firstOfWeek AND time()-$lastVersions_e[0] >= 5) OR time()-$lastVersions_e[0] >= 10) {
|
||||||
debug('nextAPR check 1');
|
debug('nextAPR check 1');
|
||||||
if (@fopen('http://assets.minecraft.net/'.$nextAPR.'/minecraft.zip', 'r')) {
|
if (@fopen('http://assets.minecraft.net/'.$nextAPR.'/minecraft.jar', 'r')) {
|
||||||
include_once('addrelease.php');
|
include_once('addrelease.php');
|
||||||
echo addRelease($nextAPR);
|
echo addRelease($nextAPR);
|
||||||
exit();
|
exit();
|
||||||
|
@ -70,7 +70,7 @@ if (true) {
|
||||||
if (true) {
|
if (true) {
|
||||||
//if ((time()-$lastVersions_e[0] <= 20 AND !$nextAPR_firstOfWeek) OR (time()-$lastVersions_e[0] >= 60)) {
|
//if ((time()-$lastVersions_e[0] <= 20 AND !$nextAPR_firstOfWeek) OR (time()-$lastVersions_e[0] >= 60)) {
|
||||||
debug('lastAPR re-check');
|
debug('lastAPR re-check');
|
||||||
if (@md5_file('http://assets.minecraft.net/'.$lastVersions_e[3].'/minecraft.zip') != $lastVersions_e[4]) {
|
if (@md5_file('http://assets.minecraft.net/'.$lastVersions_e[3].'/minecraft.jar') != $lastVersions_e[4]) {
|
||||||
include_once('addrelease.php');
|
include_once('addrelease.php');
|
||||||
echo addRelease($lastVersions_e[3]);
|
echo addRelease($lastVersions_e[3]);
|
||||||
exit();
|
exit();
|
||||||
|
|
Reference in a new issue