From 9d1204f5b96960bcb21db5f9b9763ed4d8c3031e Mon Sep 17 00:00:00 2001 From: YTBJero Date: Mon, 25 Apr 2022 19:35:40 +0700 Subject: [PATCH] Rename file --- src/updater/Utils.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/updater/Utils.php b/src/updater/Utils.php index 13bdf7f..947b3f9 100644 --- a/src/updater/Utils.php +++ b/src/updater/Utils.php @@ -36,7 +36,7 @@ public static function handleUpdateInfo(Array $data): void Server::getInstance()->getLogger()->warning(" §c" .$lines[$i]); } Server::getInstance()->getLogger()->warning("§dUpdate Link :: " . $data["Response"]["link"]); - Server::getInstance()->getLogger()->warning("Update file was install in plugin_data/MultiPlayerCounter"); + Server::getInstance()->getLogger()->warning("Update file was install in plugin_data/Clothes"); } else { if ($update < 0) Server::getInstance()->getLogger()->debug("Running a build not yet released, this can cause un intended side effects (including possible data loss)"); return; @@ -57,9 +57,9 @@ public static function handleUpdateInfo(Array $data): void * @return void */ protected static function downloadUpdate(string $url) : void { - $plugin = Server::getInstance()->getPluginManager()->getPlugin("MultiPlayerCounter"); + $plugin = Clothes::getInstance(); @mkdir($plugin->getDataFolder()."tmp/"); - $path = $plugin->getDataFolder()."tmp/MultiPlayerCounter.phar"; + $path = $plugin->getDataFolder()."tmp/Clothes.phar"; Server::getInstance()->getAsyncPool()->submitTask(new DownloadFile($plugin, $url, $path)); } /** @@ -127,14 +127,14 @@ public static function handleDownload(string $path, int $status) : void { Utils::rmalldir($plugin->getDataFolder()."/tmp"); return; } - @rename($path, Server::getInstance()->getPluginPath()."/MultiPlayerCounter.phar"); + @rename($path, Server::getInstance()->getPluginPath()."/Clothes.phar"); if(Utils::getFileName() === null){ - Server::getInstance()->getLogger()->debug("Deleting previous MultiPlayerCounter version..."); + Server::getInstance()->getLogger()->debug("Deleting previous Clothes version..."); Utils::rmalldir($plugin->getFileHack()); Server::getInstance()->getLogger()->warning("Update complete, restart your server to load the new updated version."); return; } - @rename(Server::getInstance()->getPluginPath()."/".Utils::getFileName(), Server::getInstance()->getPluginPath()."/MultiPlayerCounter.phar.old"); //failsafe i guess. + @rename(Server::getInstance()->getPluginPath()."/".Utils::getFileName(), Server::getInstance()->getPluginPath()."/Clothes.phar.old"); //failsafe i guess. Server::getInstance()->getLogger()->warning("Update complete, restart your server to load the new updated version."); return; } @@ -173,4 +173,4 @@ private static function getFileName(){ $tmp = end($tmp); //requires reference, so cant do all in one return str_replace("/","",$tmp); } -} \ No newline at end of file +}