\GSPPanel\Backup
This class allows interaction with gameserver backups
Methods
CreateBackup( $params = array()) : arrayBacks up a users game Strings->GameReplaceVars is called on $location
$params requires the following:
- ugid: The user's game id (REQUIRED)
 - pingback: The URL to ping once the backup is completed(Not required)
 - location: The location for the file to go to(Not required, default is "{BackupDir}/{ugid}-{backupid}.tar")
 - rootbackup: Perform the backup as root(true/false, Linux only, Not required)
 - bypass: Setting this to true will bypass the count limit setup for the game and will not add it to the backup list (Used for moving games, Not required)
 - deleteoldest: Delete the oldest backup if the backup limit is reached
 
Returns one of the following in an array format:
- error
     
- -1 - No user game id
 - -2 - Users game does not exist
 - -3 - Users game is not installed
 - -4 - Users game is already being backed up
 - -5 - Error connecting to server
 - -6 - Game backups are disabled
 - -7 - Backup limit reached
 - 0 - Backup started
 
 - taskid - The taskid if error is 0
 
| Name | Type | Description | 
|---|---|---|
| $params | 
| Type | Description | 
|---|---|
| array | 
DeleteBackup(integer $backupid) : arrayDeletes a gameserver backup
Returns one of the following in an array format:
- error
     
- -1 - No backup id
 - -2 - Backup not found
 - -3 - Backup is in progress
 - -4 - Unable to delete file
 - 0 - Backup deleted
 
 
| Name | Type | Description | 
|---|---|---|
| $backupid | integer | The backup ID for the server  | 
| Type | Description | 
|---|---|
| array | 
ListBackups(array $params = array()) : arrayLists the game server backups
$params requires the following:
- sid: The server id to list backups for (OPTIONAL)
 - ugid: The game servers id to list backups for (OPTIONAL)
 
Returns one of the following in an array format:
- error
     
- -1 - No backups found
 - 0 - Successful
 
 - data - array returned if error = 0
 
| Name | Type | Description | 
|---|---|---|
| $params | array | 
| Type | Description | 
|---|---|
| array | 
RestoreBackup(integer $backupid) : arrayRestores a gameserver backup
Returns one of the following in an array format:
- error
     
- -1 - No backup id
 - -2 - Backup not found
 - -3 - Backup is in progress
 - -4 - Game server is currently locked
 - 0 - Backup being restored
 
 
| Name | Type | Description | 
|---|---|---|
| $backupid | integer | The backup ID for the server  | 
| Type | Description | 
|---|---|
| array |