From 7d815df577e592492237da53f77f050319d3867c Mon Sep 17 00:00:00 2001 From: Zachary Claret-Scott Date: Wed, 7 Feb 2018 18:09:02 +0000 Subject: [PATCH 1/3] Removed slashes from commands Slashes are no longer needed in commands when running from the CLI. This caused the backups to not safely stop saving or send messages. --- backup-run.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backup-run.php b/backup-run.php index 2fe3d78..2cfc0b8 100644 --- a/backup-run.php +++ b/backup-run.php @@ -54,14 +54,14 @@ exit('Server not running\r\n'); } -server_cmd($user['user'], "/save-all"); +server_cmd($user['user'], "save-all"); //Give the server a chance to save sleep(30); //Prevent auto-saves while we run the backup -server_cmd($user['user'], "/save-off"); +server_cmd($user['user'], "save-off"); //Notify players the world is backing up -server_cmd($user['user'], "/say [MCBackup] Starting backup..."); +server_cmd($user['user'], "say [MCBackup] Starting backup..."); if(!is_dir($user['home'] . "/" . "backups")){ mkdir($user['home'] . "/" . "backups"); @@ -98,10 +98,10 @@ } //Notify players the backup is done -server_cmd($user['user'], "/say [MCBackup] Backup complete"); +server_cmd($user['user'], "say [MCBackup] Backup complete"); //Turn auto-saves back on -server_cmd($user['user'], "/save-on"); +server_cmd($user['user'], "save-on"); echo "MCHostPanel Backup Success\r\n"; From 561359f131e8335e6b57b136a9c3740ae86c48c2 Mon Sep 17 00:00:00 2001 From: Zachary Claret-Scott Date: Wed, 7 Feb 2018 18:09:45 +0000 Subject: [PATCH 2/3] Updated error message --- backup-run.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup-run.php b/backup-run.php index 2cfc0b8..5140fe7 100644 --- a/backup-run.php +++ b/backup-run.php @@ -10,7 +10,7 @@ if(!isset($argv[2])) { error_log("MCHostPanel Backup: No secret supplied!"); - exit("No user supplied!\r\n"); + exit("No secret supplied!\r\n"); } if(!isset($argv[1])) { From 70f2b36e9dd6be4e27d6d7b657ecc625babf7bd7 Mon Sep 17 00:00:00 2001 From: Zachary Claret-Scott Date: Wed, 7 Feb 2018 18:11:55 +0000 Subject: [PATCH 3/3] Updated ingame messages Updated messages to be tellraw: - This stops the the [server][MCBackup] being in chat and just shows [MCBackup] - This also allows for a hover over message on starting with a performance warning --- backup-run.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup-run.php b/backup-run.php index 5140fe7..146c708 100644 --- a/backup-run.php +++ b/backup-run.php @@ -61,7 +61,7 @@ server_cmd($user['user'], "save-off"); //Notify players the world is backing up -server_cmd($user['user'], "say [MCBackup] Starting backup..."); +server_cmd($user['user'], 'tellraw @a ["",{"text":"[MCBackup]","color":"yellow"},{"text":" "},{"text":"Starting backup!","bold":true,"hoverEvent":{"action":"show_text","value":"You may experience slight performance drops while this takes place."}}]'); if(!is_dir($user['home'] . "/" . "backups")){ mkdir($user['home'] . "/" . "backups"); @@ -98,7 +98,7 @@ } //Notify players the backup is done -server_cmd($user['user'], "say [MCBackup] Backup complete"); +server_cmd($user['user'], 'tellraw @a ["",{"text":"[MCBackup] ","color":"yellow"},{"text":"Backup finished!"}]'); //Turn auto-saves back on server_cmd($user['user'], "save-on");