From 1a771cf5ad800852fb9284710346aed85639d31b Mon Sep 17 00:00:00 2001 From: Li Date: Fri, 11 Aug 2023 12:30:29 +1200 Subject: [PATCH] Update common.php --- .gitignore | 1 + .htaccess | 0 404.php | 0 common.js | 0 common.php | 23 +++++++++++++++++++---- devtools.php | 0 faq.php | 0 favicon.ico | Bin header.php | 0 img/androiddev.png | Bin img/apk-icon.png | Bin img/cmbackup.png | Bin img/docs.png | Bin img/export.png | Bin img/games.png | Bin img/kernel-plugin.png | Bin img/logo.png | Bin img/mono.png | Bin img/pending_playable.png | Bin img/pkg.png | Bin img/playable.png | Bin img/ppk_icon.png | Bin img/psdp.png | Bin img/psm-drivers.png | Bin img/psm_bg.gif | Bin img/psm_bg.png | Bin img/psm_icon.png | Bin img/psmda_keys.png | Bin img/psmdev.png | Bin img/psmruntime.png | Bin img/sdk.png | Bin img/simulator.png | Bin img/sources.png | Bin img/tools.png | Bin img/twitter.png | Bin img/unity.png | Bin img/unity_icon.png | Bin img/unitydev.png | Bin img/user-plugin.png | Bin img/youtube.png | Bin img/zip_icon.png | Bin index.php | 0 libary.php | 0 redirect.php | 0 robots.txt | 0 sitemap.xml | 0 style.css | 0 videos/china.mp4 | Bin wget.php | 0 zrif.js | 0 50 files changed, 20 insertions(+), 4 deletions(-) mode change 100755 => 100644 .htaccess mode change 100755 => 100644 404.php mode change 100755 => 100644 common.js mode change 100755 => 100644 common.php mode change 100755 => 100644 devtools.php mode change 100755 => 100644 faq.php mode change 100755 => 100644 favicon.ico mode change 100755 => 100644 header.php mode change 100755 => 100644 img/androiddev.png mode change 100755 => 100644 img/apk-icon.png mode change 100755 => 100644 img/cmbackup.png mode change 100755 => 100644 img/docs.png mode change 100755 => 100644 img/export.png mode change 100755 => 100644 img/games.png mode change 100755 => 100644 img/kernel-plugin.png mode change 100755 => 100644 img/logo.png mode change 100755 => 100644 img/mono.png mode change 100755 => 100644 img/pending_playable.png mode change 100755 => 100644 img/pkg.png mode change 100755 => 100644 img/playable.png mode change 100755 => 100644 img/ppk_icon.png mode change 100755 => 100644 img/psdp.png mode change 100755 => 100644 img/psm-drivers.png mode change 100755 => 100644 img/psm_bg.gif mode change 100755 => 100644 img/psm_bg.png mode change 100755 => 100644 img/psm_icon.png mode change 100755 => 100644 img/psmda_keys.png mode change 100755 => 100644 img/psmdev.png mode change 100755 => 100644 img/psmruntime.png mode change 100755 => 100644 img/sdk.png mode change 100755 => 100644 img/simulator.png mode change 100755 => 100644 img/sources.png mode change 100755 => 100644 img/tools.png mode change 100755 => 100644 img/twitter.png mode change 100755 => 100644 img/unity.png mode change 100755 => 100644 img/unity_icon.png mode change 100755 => 100644 img/unitydev.png mode change 100755 => 100644 img/user-plugin.png mode change 100755 => 100644 img/youtube.png mode change 100755 => 100644 img/zip_icon.png mode change 100755 => 100644 index.php mode change 100755 => 100644 libary.php mode change 100755 => 100644 redirect.php mode change 100755 => 100644 robots.txt mode change 100755 => 100644 sitemap.xml mode change 100755 => 100644 style.css mode change 100755 => 100644 videos/china.mp4 mode change 100755 => 100644 wget.php mode change 100755 => 100644 zrif.js diff --git a/.gitignore b/.gitignore index 99a03f7..adb9462 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ pkg/* nps-backup/* decrypted-files/* gameinfo/* +dl4u/* # php-proxy, unrelated to psmreborn 1337/* diff --git a/.htaccess b/.htaccess old mode 100755 new mode 100644 diff --git a/404.php b/404.php old mode 100755 new mode 100644 diff --git a/common.js b/common.js old mode 100755 new mode 100644 diff --git a/common.php b/common.php old mode 100755 new mode 100644 index ad6729f..b5b203f --- a/common.php +++ b/common.php @@ -7,10 +7,25 @@ function update_rifs() if(time() > $npsTime + 60) { - rename("NpsPsm.tsv","nps-backup/NpsPsm_".strval($npsTime).".tsv"); - rename("NpsPendingPsm.tsv","nps-backup/NpsPendingPsm_".strval($npsPendingTime).".tsv"); - file_put_contents("NpsPsm.tsv", file_get_contents("http://nopaystation.com/tsv/PSM_GAMES.tsv")); - file_put_contents("NpsPendingPsm.tsv", file_get_contents("https://nopaystation.com/tsv/pending/PSM_GAMES.tsv")); + $nps_psm_games = file_get_contents("http://nopaystation.com/tsv/PSM_GAMES.tsv"); + $nps_psm_pending = file_get_contents("https://nopaystation.com/tsv/pending/PSM_GAMES.tsv"); + + $nps_psm_md5 = md5(file_get_contents("NpsPsm.tsv"), false); + $nps_psm_pending_md5 = md5(file_get_contents("NpsPendingPsm.tsv"), false); + + $nps_backup_path = "nps-backup/NpsPsm_".$nps_psm_md5.".tsv"; + $nps_pending_backup_path = "nps-backup/NpsPendingPsm_".$nps_psm_pending_md5.".tsv"; + + if(!file_exists($nps_backup_path)) { + rename("NpsPsm.tsv", $nps_backup_path); + } + + if(!file_exists($nps_pending_backup_path)) { + rename("NpsPendingPsm.tsv", $nps_pending_backup_path); + } + + file_put_contents("NpsPsm.tsv", $nps_psm_games); + file_put_contents("NpsPendingPsm.tsv", $nps_psm_pending); } } update_rifs(); diff --git a/devtools.php b/devtools.php old mode 100755 new mode 100644 diff --git a/faq.php b/faq.php old mode 100755 new mode 100644 diff --git a/favicon.ico b/favicon.ico old mode 100755 new mode 100644 diff --git a/header.php b/header.php old mode 100755 new mode 100644 diff --git a/img/androiddev.png b/img/androiddev.png old mode 100755 new mode 100644 diff --git a/img/apk-icon.png b/img/apk-icon.png old mode 100755 new mode 100644 diff --git a/img/cmbackup.png b/img/cmbackup.png old mode 100755 new mode 100644 diff --git a/img/docs.png b/img/docs.png old mode 100755 new mode 100644 diff --git a/img/export.png b/img/export.png old mode 100755 new mode 100644 diff --git a/img/games.png b/img/games.png old mode 100755 new mode 100644 diff --git a/img/kernel-plugin.png b/img/kernel-plugin.png old mode 100755 new mode 100644 diff --git a/img/logo.png b/img/logo.png old mode 100755 new mode 100644 diff --git a/img/mono.png b/img/mono.png old mode 100755 new mode 100644 diff --git a/img/pending_playable.png b/img/pending_playable.png old mode 100755 new mode 100644 diff --git a/img/pkg.png b/img/pkg.png old mode 100755 new mode 100644 diff --git a/img/playable.png b/img/playable.png old mode 100755 new mode 100644 diff --git a/img/ppk_icon.png b/img/ppk_icon.png old mode 100755 new mode 100644 diff --git a/img/psdp.png b/img/psdp.png old mode 100755 new mode 100644 diff --git a/img/psm-drivers.png b/img/psm-drivers.png old mode 100755 new mode 100644 diff --git a/img/psm_bg.gif b/img/psm_bg.gif old mode 100755 new mode 100644 diff --git a/img/psm_bg.png b/img/psm_bg.png old mode 100755 new mode 100644 diff --git a/img/psm_icon.png b/img/psm_icon.png old mode 100755 new mode 100644 diff --git a/img/psmda_keys.png b/img/psmda_keys.png old mode 100755 new mode 100644 diff --git a/img/psmdev.png b/img/psmdev.png old mode 100755 new mode 100644 diff --git a/img/psmruntime.png b/img/psmruntime.png old mode 100755 new mode 100644 diff --git a/img/sdk.png b/img/sdk.png old mode 100755 new mode 100644 diff --git a/img/simulator.png b/img/simulator.png old mode 100755 new mode 100644 diff --git a/img/sources.png b/img/sources.png old mode 100755 new mode 100644 diff --git a/img/tools.png b/img/tools.png old mode 100755 new mode 100644 diff --git a/img/twitter.png b/img/twitter.png old mode 100755 new mode 100644 diff --git a/img/unity.png b/img/unity.png old mode 100755 new mode 100644 diff --git a/img/unity_icon.png b/img/unity_icon.png old mode 100755 new mode 100644 diff --git a/img/unitydev.png b/img/unitydev.png old mode 100755 new mode 100644 diff --git a/img/user-plugin.png b/img/user-plugin.png old mode 100755 new mode 100644 diff --git a/img/youtube.png b/img/youtube.png old mode 100755 new mode 100644 diff --git a/img/zip_icon.png b/img/zip_icon.png old mode 100755 new mode 100644 diff --git a/index.php b/index.php old mode 100755 new mode 100644 diff --git a/libary.php b/libary.php old mode 100755 new mode 100644 diff --git a/redirect.php b/redirect.php old mode 100755 new mode 100644 diff --git a/robots.txt b/robots.txt old mode 100755 new mode 100644 diff --git a/sitemap.xml b/sitemap.xml old mode 100755 new mode 100644 diff --git a/style.css b/style.css old mode 100755 new mode 100644 diff --git a/videos/china.mp4 b/videos/china.mp4 old mode 100755 new mode 100644 diff --git a/wget.php b/wget.php old mode 100755 new mode 100644 diff --git a/zrif.js b/zrif.js old mode 100755 new mode 100644