Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ func main() {
// Prepare the output file name with the new version, branch, and platform
var outputName string
if config.Branch == "release" {
outputName = fmt.Sprintf("StationeersServerControl%s", newVersion)
outputName = fmt.Sprintf("StationeersServerControlv%s", newVersion)
} else {
outputName = fmt.Sprintf("StationeersServerControl%s_%s", newVersion, config.Branch)
outputName = fmt.Sprintf("StationeersServerControlv%s_%s", newVersion, config.Branch)
}

// Append appropriate extension based on platform
Expand Down
3 changes: 3 additions & 0 deletions src/backupmgr/backuphttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"net/http"
"strconv"
"strings"

"github.com/JacksonTheMaster/StationeersServerUI/v5/src/logger"
)

// HTTPHandler provides HTTP endpoints for backup operations
Expand Down Expand Up @@ -65,6 +67,7 @@ func (h *HTTPHandler) ListBackupsHandler(w http.ResponseWriter, r *http.Request)

// RestoreBackupHandler handles requests to restore a backup
func (h *HTTPHandler) RestoreBackupHandler(w http.ResponseWriter, r *http.Request) {
logger.Web.Debug("Received restore request")
indexStr := r.URL.Query().Get("index")
if indexStr == "" {
http.Error(w, "index parameter is required", http.StatusBadRequest)
Expand Down
7 changes: 6 additions & 1 deletion src/backupmgr/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ import (
"fmt"
"os"
"path/filepath"

"github.com/JacksonTheMaster/StationeersServerUI/v5/src/config"
"github.com/JacksonTheMaster/StationeersServerUI/v5/src/logger"
)

// RestoreBackup restores a backup with the given index
func (m *BackupManager) RestoreBackup(index int) error {
m.mu.Lock()
defer m.mu.Unlock()
logger.Backup.Info("Restoring backup with index " + fmt.Sprintf("%d", index))

files := []struct {
backupName string
Expand All @@ -25,7 +29,7 @@ func (m *BackupManager) RestoreBackup(index int) error {

for _, file := range files {
backupFile := filepath.Join(m.config.SafeBackupDir, file.backupName)
destFile := filepath.Join(m.config.BackupDir, file.destName)
destFile := filepath.Join("./saves/"+config.WorldName, file.destName)

if err := copyFile(backupFile, destFile); err != nil {
// Try alternative name
Expand All @@ -38,6 +42,7 @@ func (m *BackupManager) RestoreBackup(index int) error {
}
restoredFiles[destFile] = backupFile
}
logger.Backup.Debug(fmt.Sprintf("%v", restoredFiles))

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

var (
// All configuration variables can be found in vars.go
Version = "5.4.33"
Version = "5.4.34"
Branch = "release"
)

Expand Down
Loading