Games

Docs For Class Games

Description

Method Summary
static array AddGame (array $params)
static array AddGameAddon (array $params)
static void AddGameConfig ( $params)
static array AddGameScript (array $params)
static array AddGameUpdate (array $params)
static array AddUserGame (array $params)
static array CheckMachines (array $params)
static array ControlGame (array $params)
static void DeleteAddon (int $gid, int $addonid)
static void DeleteConfig (int $gid, int $configid)
static void DeleteConfigurableOption (int $gid, int $optionid)
static array DeleteFromUser (int $ugid, [boolean $deletedb = true], [boolean $forceremove = false])
static array DeleteGame (mixed $gid)
static void DeleteScript (int $gid, int $scriptid)
static void DeleteUpdate (int $gid, int $updateid)
static boolean DisableGame (int $gid, int $sid)
static array DisableMaintenance (string $ugid)
static array downloadGameFile (int $gid, int $sid, int $fromsid)
static array EditGame (array $params)
static array EditGameAddon (array $params)
static array EditGameConfig (array $params)
static array EditGameScript (array $params)
static array EditGameUpdate (array $params)
static array EditUserGame (array $params)
static boolean EnableGame (int $gid, int $sid)
static array EnableMaintenance (string $ugid)
static array FindSuitableHost (array $params)
static array GetGameConsole (int $ugid)
static array GetGameInfo (int $gid)
static void GetUserGameInfo (int $ugid)
static array Import (string $data)
static boolean inMaintenance (string $ugid)
static array InstallAddon (int $ugid, int $addonid)
static array InstallToUser (array $params)
static array InstallUpdate (int $ugid, int $updateid, [string $pingback = "api/backendtask.php?taskid={taskid}"])
static boolean isLocked (string $ugid)
static array ListAddons (int $gid, [int $useraccess = null])
static array ListConfigs (int $gid)
static array ListGames ()
static array ListGameServers (array $params)
static array ListProtocols ()
static array ListScripts (int $gid)
static array ListUpdates (int $gid, [int $useraccess = null])
static array LockGame (string $ugid)
static array MoveUserGame (array $params)
static boolean needNewGameFiles (int $gid, int $sid, int $fileserver)
static array QueryGame (array $params)
static array Rcon (array $params)
static array RebuildStartMode (array $params)
static void RunCustomScript (int $ugid, string $event, int $gid)
static array SuspendServer (int $ugid)
static array UnlockGame (string $ugid)
static array UnsuspendServer (int $ugid)
static array WriteConfig (int $cfid, int $ugid)
Methods
static method AddGame

Adds a game to the database

$params requires the following:

  • gamename: The name of the game(REQUIRED)
  • files_path: The folder for the game files(REQUIRED)
  • linux_enable: 0/1 to enable for linux servers
  • linux_startmode: The startmode for linux(Required of linux_enable is 1)
  • linux_installtype: The type of installation to do for user game files(folder, zip, tar, tar.gz)
  • linux_logfile: The linux log file to display in the web console
  • windows_enable: 0/1 to enable for windows servers
  • windows_startmode: The startmode for windows
  • windows_exec: The startmode for windows(Required of windows_enable is 1)
  • windows_installtype: The type of installation to do for user game files(folder, zip)
  • windows_workingpath: The relative path to run the executable from (only some games require this)
  • windows_logfile: The windows log file to display in the web console
  • port_increment: Integer to increment the port count by for new servers
  • port_default: The game's default port
  • port_querydefault: The game's default query port(0 to disable)
  • port_rcondefault: The game's default rcon port(0 to disable)
  • port_custom1: The game's custom port(0 to disable)
  • port_custom2: The game's custom port(0 to disable)
  • port_custom3: The game's custom port(0 to disable)
  • port_custom4: The game's custom port(0 to disable)
  • reinstall_enable: 0/1 to allow users to reinstall the gameserver
  • ftp: 0/1 to enable the ftp server for this game
  • windows_console: 0/1 to enable the console logging in windows for this game
  • querycode: The GameQ query code for this game
  • maxslots: Array for the maxslots variable(value, control, name)
  • configoptions: Array of configurable options(option, name, control, fieldtype, order)
  • servermon: 0/1 to enable server monitor actions for this game
  • graphs: 0/1 to enable slot and uptime graphs for this game
  • redirectfolder: A folder for the FTP to redirect users to
  • alertdiskusage: The size in bytes the user is allowed to use on the disk
  • fastdl: 0/1 to enable Fast Download option for this game
  • fastdlurl: The path to append to the URL for Fast Download
  • fastdlallowed: Extensions that are allowed to be downloaded
  • fastdlexclude: Files that are not allowed to be downloaded(wildcard accepted)
  • rconprotocol: The protocol required for rcon commands
  • backups: 0/1 to enable game server backups for this game
  • backupclientaccess: Client permissions for backups (0 none, 1 backup, 2 backup and restore)
  • backuplimit: The number of backups that can be stored per game server
  • servermon_offline_1: Action to take if offline once
  • servermon_offline_2: Action to take if offline twice
  • servermon_offline_3: Action to take if offline three times
  • servermon_private_1: Action to take if not private once
  • servermon_private_2: Action to take if not private twice
  • servermon_private_3: Action to take if not private three times
  • servermon_slots_1: Action to take if slots exceeded once
  • servermon_slots_2: Action to take if slots exceeded twice
  • servermon_slots_3: Action to take if slots exceeded three times
  • servermon_cpulimit: CPU Limit Percentage (0-100)
  • servermon_cpu_1: Action to take if CPU exceeded once
  • servermon_cpu_2: Action to take if CPU exceeded twice
  • servermon_cpu_3: Action to take if CPU exceeded three times
  • servermon_ramlimit: RAM Limit Percentage (0-100)
  • servermon_ram_1: Action to take if RAM exceeded once
  • servermon_ram_2: Action to take if RAM exceeded twice
  • servermon_ram_3: Action to take if RAM exceeded three times
  • database_allowed: 0/1 Allow databases to be created for this game
  • database_autocreate: 0/1 Automatically create a database for this game
  • database_adminurl: URL to phpMyAdmin or a similar tool for clients to access
  • database_limit: The number of databases that can be created for a game server
Returns one of the following in an array format:
  • error
    • -1 - Field left empty
    • -2 - No linux startmode
    • -3 - No windows executable
    • -4 - No OS selected
    • 0 - Added successfully

  • access: public
static array AddGame (array $params)
  • array $params
static method AddGameAddon

Adds a game addon

$params uses the following:

  • gid: The games id (REQUIRED)
  • name: The updates name(REQUIRED)
  • copyfolder: 1 to copy folders, otherwise 0
  • windows_path: The windows path to copy
  • linux_path: The linux path to copy
  • systemcommands: 1 to run system commands, otherwise 0
  • windows_command: Windows commands(batch)
  • linux_command: Linux commands(bash)
  • userinstall: 1 to allow the user to install, otherwise 0
  • message: Message to be displayed after installed
  • description: Description of addon
  • restart: 1 to restart after install, otherwise 0
Returns one of the following in an array format:
  • error
    • -1 - No name specified
    • -2 - No addonid specified
    • 0 - Game addon saved successfully

  • access: public
static array AddGameAddon (array $params)
  • array $params
static method AddGameConfig
  • access: public
static void AddGameConfig ( $params)
  • $params
static method AddGameScript

Adds a game event script

$params uses the following:

  • gid: The games id (REQUIRED)
  • description: Description of the script
  • os: 0 for Linux, 1 for Windows
  • content: Script contents (batch/bash)
  • event: Event to run this script on (aftercreated, beforedeleted, beforestart, afterstart, beforestop, afterstop)
  • wait: Wait for the script to finish before continuing (true/false)
Returns one of the following in an array format:
  • error
    • -1 - No content specified
    • -2 - No gid specified
    • 0 - Game script saved successfully

  • access: public
static array AddGameScript (array $params)
  • array $params
static method AddGameUpdate

Adds a game update

$params uses the following:

  • gid: The games id (REQUIRED)
  • name: The updates name(REQUIRED)
  • copyfolder: 1 to copy folders, otherwise 0
  • windows_path: The windows path to copy
  • linux_path: The linux path to copy
  • systemcommands: 1 to run system commands, otherwise 0
  • windows_command: Windows commands(batch)
  • linux_command: Linux commands(bash)
  • userinstall: 1 to allow the user to install, otherwise 0
  • message: Message to be displayed after installed
  • description: Description of update
Returns one of the following in an array format:
  • error
    • -1 - No name specified
    • -2 - No gid specified
    • 0 - Game update saved successfully

  • access: public
static array AddGameUpdate (array $params)
  • array $params
static method AddUserGame

Adds a game to the user

$params requires the following:

  • uid: The user's ID to add the game to(REQUIRED)
  • sid: The server ID to add the game to(REQUIRED, location_[name], machine_[id], ip_[ipid], any)
  • gid: The Game's ID(REQUIRED)
  • maxslots: The maximum number of slots to allocate this game server
  • private: 0/1 to mark this server as a private server
  • affinity: The CPU core the game should run on(-1 disables affinity assignment)
  • priority: Controls the service priority(Below Normal, Normal, Above Normal, High, Real Time)
  • config: Array of configurable options(optionid, value)
  • install: Install the game server to the server(true/false)
  • email: Send an email to the user once the install is complete(true/false)
  • billingid: A reference ID sent from billing systems such as WHMCS
  • dedicatedip: 0/1 - 1 if the server should be on its own ip, 0 otherwise
  • fastdl: 0/1 - 1 if Fast Download should be enabled on this server, 0 otherwise
  • port_main: The port the server should use, this is NOT checked against existing servers
  • port_query: The port the server should use, this is NOT checked against existing servers
  • port_rcon: The port the server should use, this is NOT checked against existing servers
  • port_custom1: The port the server should use, this is NOT checked against existing servers
  • port_custom2: The port the server should use, this is NOT checked against existing servers
  • port_custom3: The port the server should use, this is NOT checked against existing servers
  • port_custom4: The port the server should use, this is NOT checked against existing servers
  • usermustownmachine: true/false, Make sure the server is owned by the specified user (uid). Default is false.
Returns one of the following in an array format:
  • error
    • -1 - Field left empty
    • -2 - No user
    • -3 - Game not found in database
    • -4 - Server not found in database (REMOVED)
    • -5 - Game does not exist on server (REMOVED)
    • -6 - Server is offline (REMOVED)
    • -7 - Error during installation
    • -8 - Unable to find matching server
    • -9 - Not enough slots available on the server (REMOVED)
    • -10 - Your license does not allow any more game or voice servers
    • -11 - The specified billingid is already associated with a server
    • -12 - No IPs added to the selected machine (REMOVED)
    • 0 - Added successfully
  • ugid: User's game id(supplied if there was no error, or if error was -7)

  • access: public
static array AddUserGame (array $params)
  • array $params
static method CheckMachines

Returns an array of servers with the game

$params requires the following:

  • gid: The game ID(REQUIRED)
Returns one of the following in an array format:
  • error
    • -1 - No game id provided
  • array of server information(serverid, serveralias, serverip, gamexists(true/false), folder, size)

  • access: public
static array CheckMachines (array $params)
  • array $params
static method ControlGame

Starts, stops, and restarts the users game server.

$params requires the following:

  • ugid: The user's game id to control(REQUIRED)
  • action: start,stop,restart(REQUIRED)
Returns one of the following in an array format:
  • error
    • -1 - No gameid or action provided
    • -2 - Unable to find users game
    • -3 - Unable to complete action
    • -4 - Cannot do the requested action, server suspended
    • 0 - Controlled successfully

  • access: public
static array ControlGame (array $params)
  • array $params
static method DeleteAddon

Deletes a game addon

  • access: public
static void DeleteAddon (int $gid, int $addonid)
  • int $gid: Games ID
  • int $addonid: The addon's ID
static method DeleteConfig

Deletes a game config

  • access: public
static void DeleteConfig (int $gid, int $configid)
  • int $gid: Games ID
  • int $configid: The configs's ID
static method DeleteConfigurableOption

Deletes a configurable option

  • access: public
static void DeleteConfigurableOption (int $gid, int $optionid)
  • int $gid: Games ID
  • int $optionid: The option's ID
static method DeleteFromUser

Deletes a game server from a user

Returns one of the following in an array format:

  • error
    • -1 - No user game supplied
    • -2 - User game not found in database
    • -3 - Server is offline
    • -4 - Unable to remove the game server
    • 0 - Deleted successfully

  • access: public
static array DeleteFromUser (int $ugid, [boolean $deletedb = true], [boolean $forceremove = false])
  • int $ugid: User's game server id
  • boolean $deletedb: Deletes the user's game from the database
  • boolean $forceremove: Deletes the user's game from the database(if deletedb = true) or sets it to not installed (if deletedb = false) even if the server is offline
static method DeleteGame

Deletes a game from the database

$params requires the following:

  • templateid: The template id to delete
Returns one of the following in an array format:
  • error
    • -1 - No game id provided
    • -2 - Game has servers installed
    • 0 - Deleted successfully

  • access: public
static array DeleteGame (mixed $gid)
  • mixed $gid: The Game's ID
static method DeleteScript

Deletes a game script

  • access: public
static void DeleteScript (int $gid, int $scriptid)
  • int $gid: Games ID
  • int $scriptid: The script's ID
static method DeleteUpdate

Deletes a game update

  • access: public
static void DeleteUpdate (int $gid, int $updateid)
  • int $gid: Games ID
  • int $updateid: The update's ID
static method DisableGame

Disables the game on the machine

  • access: public
static boolean DisableGame (int $gid, int $sid)
  • int $gid: The game's ID
  • int $sid: The server's ID
static method DisableMaintenance

Disables maintenance mode for the gameserver

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 already in maintenance
    • 0 - Server has been removed from maintenance

  • access: public
static array DisableMaintenance (string $ugid)
  • string $ugid: The users game id
static method downloadGameFile

Downloads game file from another server

Returns one of the following in an array format:

  • error
    • -1 - Server does not exist
    • -2 - Game does not exist
    • -3 - Unable to download files
    • -4 - Unable to download a folder
    • -5 - Already downloading
    • 0 - Download started
  • task - Task ID, specified if error is 0

  • access: public
static array downloadGameFile (int $gid, int $sid, int $fromsid)
  • int $gid: Game ID
  • int $sid: Machine ID
  • int $fromsid: Machine ID to download from
static method EditGame

Edits a game in the database

$params requires the following:

  • gid: GameID to edit(REQUIRED)
  • gamename: The name of the game(REQUIRED)
  • files_path: The folder for the game files(REQUIRED)
  • linux_enable: 0/1 to enable for linux servers
  • linux_startmode: The startmode for linux(Required of linux_enable is 1)
  • linux_installtype: The type of installation to do for user game files(folder, zip, tar, tar.gz)
  • linux_logfile: The linux log file to display in the web console
  • windows_enable: 0/1 to enable for windows servers
  • windows_startmode: The startmode for windows
  • windows_exec: The startmode for windows(Required of windows_enable is 1)
  • windows_installtype: The type of installation to do for user game files(folder, zip)
  • windows_workingpath: The relative path to run the executable from (only some games require this)
  • windows_logfile: The windows log file to display in the web console
  • port_increment: Integer to increment the port count by for new servers
  • port_default: The game's default port
  • port_querydefault: The game's default query port(0 to disable)
  • port_rcondefault: The game's default rcon port(0 to disable)
  • port_custom1: The game's custom port(0 to disable)
  • port_custom2: The game's custom port(0 to disable)
  • port_custom3: The game's custom port(0 to disable)
  • port_custom4: The game's custom port(0 to disable)
  • reinstall_enable: 0/1 to allow users to reinstall the gameserver
  • ftp: 0/1 to enable the ftp server for this game
  • windows_console: 0/1 to enable the console logging in windows for this game
  • querycode: The GameQ query code for this game
  • maxslots: Array for the maxslots variable(value, control, name)
  • configoptions: Array of configurable options(option, name, control, fieldtype, order)
  • servermon: 0/1 to enable server monitor actions for this game
  • graphs: 0/1 to enable slot and uptime graphs for this game
  • redirectfolder: A folder for the FTP to redirect users to
  • alertdiskusage: The size in bytes the user is allowed to use on the disk
  • fastdl: 0/1 to enable Fast Download option for this game
  • fastdlurl: The path to append to the URL for Fast Download
  • fastdlallowed: Extensions that are allowed to be downloaded
  • fastdlexclude: Files that are not allowed to be downloaded(wildcard accepted)
  • rconprotocol: The protocol required for rcon commands
  • backups: 0/1 to enable game server backups for this game
  • backupclientaccess: Client permissions for backups (0 none, 1 backup, 2 backup and restore)
  • backuplimit: The number of backups that can be stored per game server
  • servermon_offline_1: Action to take if offline once
  • servermon_offline_2: Action to take if offline twice
  • servermon_offline_3: Action to take if offline three times
  • servermon_private_1: Action to take if not private once
  • servermon_private_2: Action to take if not private twice
  • servermon_private_3: Action to take if not private three times
  • servermon_slots_1: Action to take if slots exceeded once
  • servermon_slots_2: Action to take if slots exceeded twice
  • servermon_slots_3: Action to take if slots exceeded three times
  • servermon_cpulimit: CPU Limit Percentage (0-100)
  • servermon_cpu_1: Action to take if CPU exceeded once
  • servermon_cpu_2: Action to take if CPU exceeded twice
  • servermon_cpu_3: Action to take if CPU exceeded three times
  • servermon_ramlimit: RAM Limit Percentage (0-100)
  • servermon_ram_1: Action to take if RAM exceeded once
  • servermon_ram_2: Action to take if RAM exceeded twice
  • servermon_ram_3: Action to take if RAM exceeded three times
  • database_allowed: 0/1 Allow databases to be created for this game
  • database_autocreate: 0/1 Automatically create a database for this game
  • database_adminurl: URL to phpMyAdmin or a similar tool for clients to access
  • database_limit: The number of databases that can be created for a game server
Returns one of the following in an array format:
  • error
    • -1 - No game id provided
    • -2 - Field left empty
    • -3 - No linux startmode
    • -4 - No windows executable
    • -5 - No OS selected
    • 0 - Added successfully

  • access: public
static array EditGame (array $params)
  • array $params
static method EditGameAddon

Edits a game addon

$params uses the following:

  • addonid: The addons id (REQUIRED)
  • name: The updates name(REQUIRED)
  • copyfolder: 1 to copy folders, otherwise 0
  • windows_path: The windows path to copy
  • linux_path: The linux path to copy
  • systemcommands: 1 to run system commands, otherwise 0
  • windows_command: Windows commands(batch)
  • linux_command: Linux commands(bash)
  • userinstall: 1 to allow the user to install, otherwise 0
  • message: Message to be displayed after installed
  • description: Description of addon
  • restart: 1 to restart after install, otherwise 0
Returns one of the following in an array format:
  • error
    • -1 - No name specified
    • -2 - No addonid specified
    • 0 - Game addon saved successfully

  • access: public
static array EditGameAddon (array $params)
  • array $params
static method EditGameConfig

Edits a game config

$params uses the following:

  • filename: The name of the config (REQUIRED)
  • configid: The configs id if it exists (REQUIRED)
  • directory: Relative path to the config
  • content: File contents
  • rewrite: When to recreate the config (never,start,edit)
  • quickedit: 0 for disable, 1 for enable
  • install: 0 to not create during install, 1 to create
Returns one of the following in an array format:
  • error
    • -1 - No filename specified
    • -2 - No configid specified
    • 0 - Game config saved successfully

  • access: public
static array EditGameConfig (array $params)
  • array $params
static method EditGameScript

Edits a game script

$params uses the following:

  • scriptid: The scripts id (REQUIRED)
  • description: Description of the script
  • os: 0 for Linux, 1 for Windows
  • content: Script contents (batch/bash)
  • event: Event to run this script on (aftercreated, beforedeleted, beforestart, afterstart, beforestop, afterstop)
  • wait: Wait for the script to finish before continuing (true/false)
Returns one of the following in an array format:
  • error
    • -1 - No content specified
    • -2 - No scriptid specified
    • 0 - Game script saved successfully

  • access: public
static array EditGameScript (array $params)
  • array $params
static method EditGameUpdate

Edits a game update

$params uses the following:

  • updateid: The update id (REQUIRED)
  • name: The updates name(REQUIRED)
  • copyfolder: 1 to copy folders, otherwise 0
  • windows_path: The windows path to copy
  • linux_path: The linux path to copy
  • systemcommands: 1 to run system commands, otherwise 0
  • windows_command: Windows commands(batch)
  • linux_command: Linux commands(bash)
  • userinstall: 1 to allow the user to install, otherwise 0
  • message: Message to be displayed after installed
  • description: Description of addon
Returns one of the following in an array format:
  • error
    • -1 - No name specified
    • -2 - No updateid specified
    • 0 - Game update saved successfully

  • access: public
static array EditGameUpdate (array $params)
  • array $params
static method EditUserGame

Edits a user's game.

Upon success the user's game server will be restarted.

$params requires the following:

  • ugid: The user's game id to edit(REQUIRED)
  • maxslots: The maximum number of slots to allocate this game server
  • private: 0/1 to mark this server as a private server
  • affinity: The CPU core the game should run on(-1 disables affinity assignment)
  • priority: Controls the service priority(Below Normal, Normal, Above Normal, High, Real Time)
  • config: Array of configurable options(optionid, value)
  • billingid: A reference ID sent from billing systems such as WHMCS
  • dedicatedip: 0/1 - 1 if the server should be on its own ip, 0 otherwise
  • fastdl: 0/1 - 1 if Fast Download should be enabled on this server, 0 otherwise
  • restartserver: 0/1 - 1 If the gameserver should be restarted after settings are applied, 0 otherwise
  • commandline: A custom command line for this gameserver, if empty then the default will be used
  • port_main: If this is set then GSP-Panel will attempt to move the gameserver to this port
  • port_query: If this is set then GSP-Panel will attempt to move the gameserver to this port
  • port_rcon: If this is set then GSP-Panel will attempt to move the gameserver to this port
  • port_custom1: If this is set then GSP-Panel will attempt to move the gameserver to this port
  • port_custom2: If this is set then GSP-Panel will attempt to move the gameserver to this port
  • port_custom3: If this is set then GSP-Panel will attempt to move the gameserver to this port
  • port_custom4: If this is set then GSP-Panel will attempt to move the gameserver to this port
Returns one of the following in an array format:
  • error
    • -1 - No ugid provided
    • -2 - User's game not found
    • -3 - Game does not exist in database
    • -4 - One of the specified ports is unavailable
    • -5 - Server is offline, unable to edit
    • 0 - Edited successfully

  • access: public
static array EditUserGame (array $params)
  • array $params
static method EnableGame

Enables the game on the machine

  • access: public
static boolean EnableGame (int $gid, int $sid)
  • int $gid: The game's ID
  • int $sid: The server's ID
static method EnableMaintenance

Enables maintenance mode for the gameserver

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 already in maintenance
    • 0 - Server is in maintenance

  • access: public
static array EnableMaintenance (string $ugid)
  • string $ugid: The users game id
static method FindSuitableHost

Find a suitable host matching the specified requirements

$params can contain the following:

  • gid: The game to search for (REQUIRED)
  • type: How to search for the host (any, ip, location, machine)
  • location: The location name to search by, required if type is 'location'
  • ip: The IP to search by, required if type is 'ip'
  • sid: The server's ID, required if type is 'machine'
  • dedicatedip: 0/1, 1 if this game server requires it's own IP
  • maxslots: The slots required for the game server, this is used to check quotas
  • uid: Find a server that belongs to this user
Returns one of the following in an array format:
  • error
    • -1 - No game ID specified
    • -2 - No servers found matching the type specified
    • -3 - Unable to find a suitable host
    • 0 - Host found
  • data
    • sid
    • ipid

  • access: public
static array FindSuitableHost (array $params)
  • array $params
static method GetGameConsole

Retrieves the servers console log

Returns one of the following in an array format:

  • error
    • -1 - No user game provided
    • -2 - Users game not found in database
    • -3 - Server offline
    • -4 - Console logging disabled for this game
    • 0 - Received data
  • data: Returned data

  • access: public
static array GetGameConsole (int $ugid)
  • int $ugid: User's game id
static method GetGameInfo

Returns an array of game information

  • access: public
static array GetGameInfo (int $gid)
  • int $gid: Games ID
static method GetUserGameInfo

Return an array of gameserver information

Since this information changes based on the game template you will need to dump the variables to view the array

  • access: public
static void GetUserGameInfo (int $ugid)
  • int $ugid: Users gameserver ID
static method Import

Imports a game export, this calls Games::AddGame

Returns one of the following in an array format:

  • error
    • -1 - No data supplied
    • -2 - Field left empty
    • -3 - No linux startmode
    • -4 - No windows startmode
    • -5 - No OS selected
    • 0 - Imported successfully

  • access: public
static array Import (string $data)
  • string $data: XML Data from a GSP-Panel game export
static method inMaintenance

Checks if a game server is in maintenance mode

Returns true if the server is in maintenance mode, false if it's not

  • access: public
static boolean inMaintenance (string $ugid)
  • string $ugid: The users game id
static method InstallAddon

Installs the addon to the users game server

Returns one of the following in an array format:

  • error
    • -1 - No user game supplied
    • -2 - No addonid provided
    • -3 - User game not found in database
    • -4 - Addon not found in database
    • -5 - Addon is not setup for this OS
    • -6 - Users game is not installed
    • -7 - Unable to install
    • -8 - Client does not have permission to install this addon
    • 0 - Installed successfully
  • message: Addon's specified return message, if any

  • access: public
static array InstallAddon (int $ugid, int $addonid)
  • int $ugid: User's game server id
  • int $addonid: The addons id
static method InstallToUser

Starts an install of a user's game to the server.

When the installation is complete the pingback url is called.

$params requires the following:

  • ugid - The user's game id(REQUIRED)
  • email - Send an email to the user once completed(true/false)
  • pingback - The page to ping once the installation is complete. You can use {taskid} in the url and it will be replaced with the task's id.
  • file - The file to extract if you do not want to use the default game files, this should be a full path (Can use game variables)
  • deletefile - Will delete the specified file after the install is successful, used for moving game servers (true/false)
Returns one of the following in an array format:
  • error
    • -1 - No user game supplied
    • -2 - User game not found in database
    • -3 - Game does not exist on server
    • -4 - Unable to install the game server
    • -5 - Server is offline
    • -6 - Unable to install
    • -7 - File does not exist
    • 0 - Installed started
  • taskid - This id of the installgame task(Only sent if error = 0)

  • access: public
static array InstallToUser (array $params)
  • array $params
static method InstallUpdate

Installs the update to the users game server

Returns one of the following in an array format:

  • error
    • -1 - No user game supplied
    • -2 - No updateid provided
    • -3 - User game not found in database
    • -4 - Update not found in database
    • -5 - Update is not setup for this OS
    • -6 - Users game is not installed
    • -7 - Client does not have permission to install this update
    • 0 - Upgrade installation started

  • access: public
static array InstallUpdate (int $ugid, int $updateid, [string $pingback = "api/backendtask.php?taskid={taskid}"])
  • int $ugid: User's game server id
  • int $updateid: The game updates id
  • string $pingback: The pingback url
static method isLocked

Checks if a game server is locked

Returns true if the server is locked, false if it's not

  • access: public
static boolean isLocked (string $ugid)
  • string $ugid: The users game id
static method ListAddons

Returns an array of addons for the specified game

  • access: public
static array ListAddons (int $gid, [int $useraccess = null])
  • int $gid: Games ID
  • int $useraccess: null for all updates and 1 for client accessible addons
static method ListConfigs

Returns an array of configs for the specified game

  • access: public
static array ListConfigs (int $gid)
  • int $gid: Games ID
static method ListGames

Returns an array of games

  • access: public
static array ListGames ()
static method ListGameServers

Returns an array of game servers

$params can use the following:

  • uid: The users id
  • sid: The servers id
  • ipid: The id of the IP
  • gid: The games id
  • ip: The ip or alias (string)
  • limit: The number of gameservers to return
  • status: The status of the server (0,1,2)
  • location: Gameservers on machines in this location
Returns an array of game servers matching the specified criteria

  • access: public
static array ListGameServers (array $params)
  • array $params
static method ListProtocols

Returns an array of all protocols as a key value pair

  • access: public
static array ListProtocols ()
static method ListScripts

Returns an array of scripts for the specified game

  • access: public
static array ListScripts (int $gid)
  • int $gid: Games ID
static method ListUpdates

Returns an array of updates for the specified game

  • access: public
static array ListUpdates (int $gid, [int $useraccess = null])
  • int $gid: Games ID
  • int $useraccess: null for all updates and 1 for client accessible updates
static method LockGame

Locks the users gameserver

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 already locked
    • 0 - Server locked

  • access: public
static array LockGame (string $ugid)
  • string $ugid: The users game id
static method MoveUserGame

Moves a user's game to another server or IP

$params requires the following:

  • ugid: The user's game id to move(REQUIRED)
  • sid: The new server id to move the game to(REQUIRED, location_[name], machine_[id], ip_[ipid], any)
  • movefile: Set this to true to move the game files (Remotes have to be the same OS)
Returns one of the following in an array format:
  • error
    • -1 - Missing a required variable
    • -2 - User game does not exist
    • -3 - Game does not exist
    • -4 - Unable to find a server matching critera
    • -5 - Server already on the same ip
    • -6 - New server cannot run that game (REMOVED)
    • -7 - Error during installation
    • -8 - Old server is offline, cannot remove old server
    • -9 - Unable to remove the game server
    • -10 - Server not found in database (REMOVED)
    • -11 - Server is offline (REMOVED)
    • -12 - Not enough slots available on the server (REMOVED)
    • -13 - Unable to move a server that has a task in progress
    • -14 - Unable to move server files
    • 0 - Moved successfully

  • access: public
static array MoveUserGame (array $params)
  • array $params
static method needNewGameFiles

Returns true if the game files should be redownloaded from the specified fileserver for the machine

  • access: public
static boolean needNewGameFiles (int $gid, int $sid, int $fileserver)
  • int $gid: Game ID
  • int $sid: Machine ID
  • int $fileserver: ID of the machine to use as the fileserver
static method QueryGame

Queries the game server for information

$params requires the following:

  • ugid: The user's game id(REQUIRED)
  • players: Report play list(true/false)
  • nomap: Report the current map(true/false)
Returns one of the following in an array format:
  • error
    • -1 - No users game id provided
    • -2 - User's game not found in the database
  • array of game information, this varies depending on game

  • access: public
static array QueryGame (array $params)
  • array $params
static method Rcon

Sends the rcon command to the server

$params requires the following:

  • ugid: The user's game id(REQUIRED)
  • command: The command to send(REQUIRED)
  • password: The rcon password
Returns one of the following in an array format:
  • error
    • -1 - No users game id provided
    • -2 - No command provided
    • -3 - User's game not found in the database
    • -4 - No protocol setup for this game
    • -5 - Protocol was not found
    • -6 - Unknown rcon error
  • array of game information, this varies depending on game

  • access: public
static array Rcon (array $params)
  • array $params
static method RebuildStartMode

Rebuilds the start mode for windows servers.

$params requires the following:

  • ugid: The user's game id to rebuild the startmode of(REQUIRED)
Returns one of the following in an array format:
  • error
    • -1 - No gameid or action provided
    • -2 - Unable to find users game
    • -3 - Unable to complete action
    • 0 - Rebuild successful

  • access: public
static array RebuildStartMode (array $params)
  • array $params
static method RunCustomScript

Run any event scripts for this game

Returns nothing

  • access: public
static void RunCustomScript (int $ugid, string $event, int $gid)
  • int $gid: Game's ID
  • int $ugid: User's game server id
  • string $event: Type of script to run
static method SuspendServer

Suspends the users game server

Returns one of the following in an array format:

  • error
    • -1 - No user game supplied
    • -2 - User's game does not exist
    • 0 - Suspend successfully

  • access: public
static array SuspendServer (int $ugid)
  • int $ugid: User's game server id
static method UnlockGame

Unlocks the users gameserver

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 already unlocked
    • 0 - Server unlocked

  • access: public
static array UnlockGame (string $ugid)
  • string $ugid: The users game id
static method UnsuspendServer

Unsuspends the users game server

Returns one of the following in an array format:

  • error
    • -1 - No user game supplied
    • -2 - User's game does not exist
    • 0 - Unsuspend successfully

  • access: public
static array UnsuspendServer (int $ugid)
  • int $ugid: User's game server id
static method WriteConfig

Writes a config to a user's game

Returns one of the following in an array format:

  • error
    • -1 - No cfid or ugid provided
    • -2 - Unable to find users game
    • -3 - Unable to write the config, view the backend's debug log
    • 0 - Wrote successfully

  • access: public
static array WriteConfig (int $cfid, int $ugid)
  • int $cfid: Game's config ID
  • int $ugid: User's game server id

Documentation generated on Wed, 14 Mar 2018 14:50:31 -0400 by phpDocumentor