Cortex Api Methods

cluster_engine_list

  • Description: Return an array of all the engines in the cluster, and the ID associatedwith them.
  • Returns: array
  • Prototype: array cluster_engine_list( int $user_id )

Parameters

int user_id  User ID to query servers for

cluster_information

  • Description: Server cluster information
  • Returns: array
  • Prototype: array cluster_information( )

engine_available_port

  • Description: Return the next available ip/port combo for the specified engine
  • Returns: array
  • Prototype: array engine_available_port( int $engine_id )

Parameters

int engine_id  Engine to return the port information for

engine_check

  • Description: Check the engine versions between two servers
  • Returns: int
  • Prototype: int engine_check( int $engine_id, int $server_id )

Parameters

int engine_id  Engine to compare
int server_id Server to compare against

engine_get_plugin_list

  • Description: Return a list of plugins for the specified engine
  • Returns: array
  • Prototype: array engine_get_plugin_list( int $engine_id )

Parameters

int engine_id  Engine Id

engine_get_top_parent

  • Description: Return the top parent for the engine
  • Returns: int
  • Prototype: int engine_get_top_parent( int $engine_id )

Parameters

int engine_id  Engine Id

engine_install

  • Description: Install an engine
  • Returns: bool
  • Prototype: bool engine_install( int $engine_id )

Parameters

int engine_id  ID of the engine to install

engine_list

  • Description: Return an array of engines on this server
  • Returns: array
  • Prototype: array engine_list( )

engine_uninstall

  • Description: Uninstall an engine
  • Returns: bool
  • Prototype: bool engine_uninstall( int $engine_id )

Parameters

int engine_id  ID of the engine to install

engine_update

  • Description: Update an engine
  • Returns: bool
  • Prototype: bool engine_update( int $engine_id )

Parameters

int engine_id  ID of the engine to update

engine_versions

  • Description: Obtain engine version information
  • Returns: array
  • Prototype: array engine_versions( array $update_list )

Parameters

array update_list  Update list from the update server

engine

  • Description: Return an engine object
  • Returns: engine
  • Prototype: engine engine( int $engine_id )

Parameters

int engine_id  Engine to create an object for

filebrowser_archive_files

  • Description: Archive files provided
  • Returns: bool
  • Prototype: bool filebrowser_archive_files( int $instance_id, string $pwd, string $filename, array $files )

Parameters

int    instance_id  Instance the files need to be copied around in
string pwd Working directory that the files are located in
string filename Filename for the archive
array files Array of files to zip

filebrowser_copy_files

  • Description: Copy files to the destination provided
  • Returns: bool
  • Prototype: bool filebrowser_copy_files( int $instance_id, string $pwd, array $files, string $dest )

Parameters

int    instance_id  Instance the files need to be copied around in
string pwd Working directory that the files are located in
array files Array of files to copy
string dest Destination directory

filebrowser_create_file

  • Description: Create a new file with the given contents
  • Returns: bool
  • Prototype: bool filebrowser_create_file( int $instance_id, string $file, mixed $new_data, string $data )

Parameters

int    instance_id  Instance ID
string file Relative path to the file
mixed new_data
string data Data to be inserted into the file

filebrowser_delete_files

  • Description: Delete files provided
  • Returns: bool
  • Prototype: bool filebrowser_delete_files( int $instance_id, string $pwd, array $files )

Parameters

int    instance_id  Instance the files need to be copied around in
string pwd Working directory that the files are located in
array files Array of files to delete

filebrowser_echo_file

  • Description: Echo out the contents of a file
  • Returns: bool
  • Prototype: bool filebrowser_echo_file( int $instance_id, string $path )

Parameters

int    instance_id  Instance that the file resides in
string path Path to the file

filebrowser_edit_file_contents

  • Description: Edit the contents of a file
  • Returns: bool
  • Prototype: bool filebrowser_edit_file_contents( int $instance_id, string $file, string $new_data )

Parameters

int    instance_id  Instance that the file resides in
string file Relative path to the file
string new_data New file data

filebrowser_extract

  • Description: Extract a zip file
  • Returns: bool
  • Prototype: bool filebrowser_extract( int $instance_id, string $file, string $path )

Parameters

int    instance_id  Instance that the zip file resides in
string file Full path to the file to extract
string path Full path to the directory to extract to

filebrowser_force_upload

  • Description: Force the upload of the supplied files
  • Returns: bool
  • Prototype: bool filebrowser_force_upload( int $instance_id, array $files )

Parameters

int   instance_id  Instance the files need to be uploaded to
array files Array of files to be moved

filebrowser_list_directory

  • Description: Return an array of files and directories in a given folder
  • Returns: array
  • Prototype: array filebrowser_list_directory( int $instance_id, string $path )

Parameters

int    instance_id  Insat
string path Path relative to the instance directory to list

filebrowser_make_dir

  • Description: Create a directory
  • Returns: bool
  • Prototype: bool filebrowser_make_dir( int $instance_id, string $path )

Parameters

int    instance_id  Instance that the directory needs to be created in
string path Relative path to the new directory

filebrowser_move_files

  • Description: Move files to the destination provided
  • Returns: bool
  • Prototype: bool filebrowser_move_files( int $instance_id, string $pwd, array $files, string $dest )

Parameters

int    instance_id  Instance the files need to be moved around in
string pwd Working directory that the files are located in
array files Array of files to move
string dest Destination directory

filebrowser_process_upload

  • Description: Process a file upload
  • Returns: array
  • Prototype: array filebrowser_process_upload( int $instance_id, array $files, string $dest )

Parameters

int    instance_id  Instance the files need to be uploaded to
array files Pass the global $_FILES array to this parameter
string dest Destination path for the file

filebrowser_read_file

  • Description: Read a file, echo the output
  • Returns: string
  • Prototype: string filebrowser_read_file( int $instance_id, string $path )

Parameters

int    instance_id  Instance that the file resides in
string path File to read

filebrowser_rename

  • Description: Rename a file
  • Returns: bool
  • Prototype: bool filebrowser_rename( int $instance_id, string $source_file, string $new_name )

Parameters

int    instance_id  Instance ID
string source_file File to be renamed
string new_name New name for the file.

filebrowser_stat_file

  • Description: Return the filesystem stat() array
  • Returns: array
  • Prototype: array filebrowser_stat_file( int $instance_id, string $path )

Parameters

int    instance_id  Instance the file resides in
string path Relative path to the file

filebrowser_unlink

  • Description: Unlink a file
  • Returns: bool
  • Prototype: bool filebrowser_unlink( int $instance_id, string $path )

Parameters

int    instance_id  Instance to be modified
string path Path to the file

hltv_cvar_list

  • Description: Return variables for this plugin
  • Returns: array
  • Prototype: array hltv_cvar_list( int $instance_id, [ int $file = null ], [ string $type = 1 ] )

Parameters

int    instance_id          Instance to update the values for.
int [ file = null ] Specify the ID of the file to return, this will default
to .
string [ type = 1 ] Specify the type of array you would like returned, either
an associative array [0], numeric array [1] (default),
both [2], or ID as key [3]

hltv_demo_information

  • Description: Return the demo filename and size
  • Returns: array
  • Prototype: array hltv_demo_information( int $instance_id )

Parameters

int instance_id  Instance ID to obtain demo information for

hltv_list_demos

  • Description: Return an array of demos in the instance directory
  • Returns: array
  • Prototype: array hltv_list_demos( int $instance_id )

Parameters

int instance_id  Instance ID to obtain a demolist for.

hltv_move_demos

  • Description: Move demos to the user directory
  • Returns: bool
  • Prototype: bool hltv_move_demos( int $instance_id )

Parameters

int instance_id  Instance to move demos for

hltv_public_demo_list

  • Description: Return an array of demos in the public
  • Returns: array
  • Prototype: array hltv_public_demo_list( int $instance_id )

Parameters

int instance_id  Instance ID to obtain a demolist for.

hltv_remove_demos

  • Description: Remove demos in the supplied array from the system
  • Returns: bool
  • Prototype: bool hltv_remove_demos( array $demos, int $instance_id )

Parameters

array demos        Demos to remove, filename only.
int instance_id Instance to update the values for.

hltv_set_bannerfile

  • Description: Set the bannerfile for the HLTV server
  • Returns: bool
  • Prototype: bool hltv_set_bannerfile( array $file, int $instance_id, [ bool $move_from_temp = TRUE ] )

Parameters

array file                              Bannerfile to use for the server
int instance_id Instance to update the values for.
bool [ move_from_temp = TRUE ] If , will not attempt to move the file from the php temp
directory.

hltv_start_demo

  • Description: Start recording a demo
  • Returns: bool
  • Prototype: bool hltv_start_demo( string $filename, int $instance_id )

Parameters

string filename     Filename to save the demo as
int instance_id Instance to update the values for.

hltv_stop_demo

  • Description: Stop recording a demo
  • Returns: bool
  • Prototype: bool hltv_stop_demo( int $instance_id )

Parameters

int instance_id  Instance to update the values for.

hltv_unset_bannerfile

  • Description: Remove the banner file from the HLTV proxy
  • Returns: bool
  • Prototype: bool hltv_unset_bannerfile( int $instance_id )

Parameters

int instance_id  Instance to update the values for.

hltv_update_cvar_values

  • Description: Update cvar values in the database
  • Returns: bool
  • Prototype: bool hltv_update_cvar_values( array $post, int $instance_id )

Parameters

array post         An array of cvars, with the key being the cvar value id.
int instance_id Instance to update the values for.

hltv_update_spectator_limit

  • Description: Set the spectator limit
  • Returns: bool
  • Prototype: bool hltv_update_spectator_limit( int $limit, int $instance_id )

Parameters

int limit        Spectator limit, 255 max
int instance_id Instance to update the values for.

hltv

  • Description: Return an HLTV object
  • Returns: hltv
  • Prototype: hltv hltv( int $instance_id )

Parameters

int instance_id  Instance ID that HLTV is bound to.

instance_activate

  • Description: Install instance service
  • Returns: bool
  • Prototype: bool instance_activate( int $instance_id )

Parameters

int instance_id  ID for the instance to install a service for

instance_add_map

  • Description: Add a map to the rotation
  • Returns: bool
  • Prototype: bool instance_add_map( int $instance_id, int $map_id, [ int $gametype_id = null ], [ array $map_options = null ] )

Parameters

int   instance_id                    Instance id
int map_id Map to add
int [ gametype_id = null ] Gametype to set the map to
array [ map_options = null ] The map options to add to the map

instance_add

  • Description: Add instance to remote server
  • Returns: bool
  • Prototype: bool instance_add( int $user, int $engine, int $ip, int $port, string $name, string $password, int $maxplayers, string $comments, [ bool $no_xref = FALSE ], [ int $mb_order_id = null ], [ multiserv $multiserv = null ] )

Parameters

int       user                         The user id of the owner of the instance.
int engine The engine id of the instances engine.
int ip The id of the IP address this instance runs on.
int port The id of the port this instance runs on.
string name The title of the instance.
string password The RCON password for the instance.
int maxplayers Maximum players allowed on this server.
string comments Comments for the instance
bool [ no_xref = FALSE ] Tell the function not to look up cross references for
remote users.
int [ mb_order_id = null ] Modernbill order id
multiserv [ multiserv = null ]

instance_amx_smarty_cvars

  • Description: Returns a formatted array of cvars
  • Returns: array
  • Prototype: array instance_amx_smarty_cvars( int $instance_id, int $file_id )

Parameters

int instance_id  Instance Id
int file_id Specify the file to pull cvars for, defaults to .

instance_amx_update_cvars

  • Description: Update AMX Configuration data
  • Returns: bool
  • Prototype: bool instance_amx_update_cvars( int $instance_id, array $post, [ bool $build = null ] )

Parameters

int   instance_id              Instance Id
array post Pass the PHP $_POST variable to this after a form has
been submitted.
bool [ build = null ] Set to to build the configuration file after updating
the database.

instance_amx

  • Description: Create a new AMX object
  • Returns: bool
  • Prototype: bool instance_amx( int $instance_id )

Parameters

int instance_id  Instance id

instance_build_mapfile

  • Description: Build the map configuration file
  • Returns: mixed
  • Prototype: mixed instance_build_mapfile( int $instance_id, [ string $filename = null ], [ mixed $return = null ] )

Parameters

int    instance_id               Instance id
string [ filename = null ] Filename to export the config to
mixed [ return = null ] Set this argument to anything to have BuildConfigFile
return its buffer.

instance_change_config

  • Description: Change configuration files
  • Returns: bool
  • Prototype: bool instance_change_config( int $instance_id, int $config_id )

Parameters

int instance_id  Instance id
int config_id Configuration to switch to

instance_change_ip

  • Description: Change an instances IP address/port
  • Returns: bool
  • Prototype: bool instance_change_ip( int $instance_id, int $ip_address, int $port )

Parameters

int instance_id  Instance id
int ip_address ID for the new IP address
int port New port

instance_change_map_gametype

  • Description: Change gametype for a map
  • Returns: bool
  • Prototype: bool instance_change_map_gametype( int $instance_id, int $map_order, int $gametype_id )

Parameters

int instance_id  Instance Id
int map_order Map to change
int gametype_id Gametype to change the map to

instance_change_port

  • Description: Change the port for an instance
  • Returns: bool
  • Prototype: bool instance_change_port( int $instance_id, int $port )

Parameters

int instance_id  Instance id
int port New port

instance_config_list

  • Description: Return a sql result of config files
  • Returns: array
  • Prototype: array instance_config_list( int $instance_id )

Parameters

int instance_id  Instance id

instance_create_config

  • Description: Create a new configuration file
  • Returns: bool
  • Prototype: bool instance_create_config( int $instance_id, string $name )

Parameters

int    instance_id  Instance id
string name New config file name

instance_create_map_rotation

  • Description: Create a new map rotation
  • Returns: bool
  • Prototype: bool instance_create_map_rotation( int $instance_id, string $name )

Parameters

int    instance_id  Instance Id
string name New name for the map rotation

instance_deactivate

  • Description: Remove system service
  • Returns: bool
  • Prototype: bool instance_deactivate( int $instance_id )

Parameters

int instance_id  ID for the instance to remove the service for

instance_delete_config

  • Description: Delete an instance configuration
  • Returns: bool
  • Prototype: bool instance_delete_config( int $instance_id, int $config_id )

Parameters

int instance_id  Instance id
int config_id Config to remove

instance_delete_map_rotation

  • Description: Delete a map rotation
  • Returns: bool
  • Prototype: bool instance_delete_map_rotation( int $instance_id, int $rotation_id )

Parameters

int instance_id  Instance Id
int rotation_id Map rotation to delete

instance_delete_map

  • Description: Remove a map from rotation
  • Returns: bool
  • Prototype: bool instance_delete_map( int $instance_id, int $order_id )

Parameters

int instance_id  Instance id
int order_id Map order id to remove

instance_edit

  • Description: Edit Instance rcon password and max players
  • Returns: bool
  • Prototype: bool instance_edit( int $instance_id, string $rcon_password, int $maxplayers, string $command_line )

Parameters

int    instance_id    Instance to edit
string rcon_password Rcon password
int maxplayers Server max players
string command_line Custom command line entries

instance_enable_browser

  • Description: Set the filebrowser boolean
  • Returns: bool
  • Prototype: bool instance_enable_browser( int $instance_id, mixed $enable )

Parameters

int   instance_id  The instance that needs to be modified
mixed enable Set to to disable

instance_engine_server_list

  • Description: Return a list of servers which have the specified engine installed.
  • Returns: array
  • Prototype: array instance_engine_server_list( int $engine_id, [ int $user_id = null ], [ bool $force_local = TRUE ] )

Parameters

int  engine_id                      Engine to check on remote servers
int [ user_id = null ] User id to find server xrefs for
bool [ force_local = TRUE ] Force a local lookup

instance_generate_command_line

  • Description: Generate the command line for the instance
  • Returns: string
  • Prototype: string instance_generate_command_line( int $instance_id )

Parameters

int instance_id  Instance to return the command line for

instance_get_cvar_value

  • Description: Get the value for the specified cvar
  • Returns: string
  • Prototype: string instance_get_cvar_value( mixed $instance_id, string $cvar_name )

Parameters

mixed  instance_id  
string cvar_name Cvar to get the value for

instance_get_instance_list

  • Description: Return a list of instances
  • Returns: array
  • Prototype: array instance_get_instance_list( [ int $user_id = null ] )

Parameters

int [ user_id = null ]         User id to restrict the list to

instance_get_map_options

  • Description: Retrieve all map options for the instances map.
  • Returns: bool
  • Prototype: bool instance_get_map_options( int $instance_id, int $map_id, [ int $order_id = null ] )

Parameters

int instance_id                 Instance id
int map_id check
int [ order_id = null ] The id of the map in the current rotation

instance_get_mem_use

  • Description: Return memory use
  • Returns: array
  • Prototype: array instance_get_mem_use( int $instance_id, [ bool $showall = null ] )

Parameters

int  instance_id                
bool [ showall = null ] Specify if you want all process memory information to be
returned, or just this instance.

instance_list_gametypes

  • Description: List gametypes attatched to an instance
  • Returns: array
  • Prototype: array instance_list_gametypes( int $instance_id )

Parameters

int instance_id  Instance id

instance_list_maps

  • Description: List maps attatched to an instance
  • Returns: array
  • Prototype: array instance_list_maps( int $instance_id )

Parameters

int instance_id  Instance id

instance_load_map_rotation

  • Description: Load a new map rotation
  • Returns: bool
  • Prototype: bool instance_load_map_rotation( int $instance_id, int $rotation_id )

Parameters

int instance_id  Instance Id
int rotation_id Map rotation to load

instance_lookup

  • Description: Get an instances ID by ip/port lookup
  • Returns: int
  • Prototype: int instance_lookup( string $ip_address, int $port )

Parameters

string ip_address  ID to lookup
int port Port to lookup

instance_map_down

  • Description: Move a map down in a map rotation
  • Returns: bool
  • Prototype: bool instance_map_down( int $instance_id, int $map_id, int $new_order )

Parameters

int instance_id  Instance Id
int map_id Map to be swapped
int new_order Order to move it to

instance_map_order_info

  • Description: Return map rotation information
  • Returns: array
  • Prototype: array instance_map_order_info( int $instance_id )

Parameters

int instance_id  Instance Id

instance_map_up

  • Description: Move a map up in a map rotation
  • Returns: bool
  • Prototype: bool instance_map_up( int $instance_id, int $map_id, int $new_order )

Parameters

int instance_id  Instance Id
int map_id Map to be swapped
int new_order Order to move it to

instance_maplist_diff

  • Description: Return any user-uploaded maps
  • Returns: array
  • Prototype: array instance_maplist_diff( int $instance_id )

Parameters

int instance_id  Instance Id

instance_modify_comments

  • Description: Modify instance comments
  • Returns: bool
  • Prototype: bool instance_modify_comments( int $instance_id, string $comments )

Parameters

int    instance_id  ID for the remote instance to modify
string comments Comments to attatch to the instance

instance_move_uploaded_map

  • Description: Process moving the uploaded map/zip
  • Returns: bool
  • Prototype: bool instance_move_uploaded_map( string $source_file, string $dest_file, [ string $type = "file" ], [ string $extract = null ], [ bool $check_ext = FALSE ] )

Parameters

string source_file                   Source file
string dest_file Destination
string [ type = "file" ] Specify if we are moving a regular file, or a zip
string [ extract = null ] Files to extract if type is zip
bool [ check_ext = FALSE ] Check the file extention for extracting files

instance_plugin_check

  • Description: Check if a given plugin is installed for this instance.
  • Returns: bool
  • Prototype: bool instance_plugin_check( int $instance_id, int $plugin_id, [ bool $active = null ] )

Parameters

int  instance_id               Instance ID
int plugin_id Plugin ID
bool [ active = null ] If the plugin must be installed to return

instance_plugin_engine_cvar_list

  • Description: Return an array of cvars
  • Returns: array
  • Prototype: array instance_plugin_engine_cvar_list( int $instance_id )

Parameters

int instance_id  

instance_plugin_list

  • Description: Return a plugin list for the supplied instance
  • Returns: array
  • Prototype: array instance_plugin_list( int $instance_id, [ bool $installed = null ], [ bool $active = null ] )

Parameters

int  instance_id               Instance Id
bool [ installed = null ] Set to to only show plugins which are currently
installed.
bool [ active = null ] Set to to only show plugins which are currently running.

instance_plugin_process_post

  • Description: Parse post data sent for plugin modification
  • Returns: bool
  • Prototype: bool instance_plugin_process_post( int $instance_id, array $post )

Parameters

int   instance_id  Instance id
array post $_POST global array

instance_process_cvars

  • Description: Process cvars sent to the server
  • Returns: bool
  • Prototype: bool instance_process_cvars( int $instance_id, array $cvars )

Parameters

int   instance_id  Instance id
array cvars Cvar array

instance_process_map_selection

  • Description: Process the form submittion for map selections
  • Returns: bool
  • Prototype: bool instance_process_map_selection( int $instance_id, array $post )

Parameters

int   instance_id  Instance Id
array post $_POST global array

instance_process_raw_cvar_list

  • Description: Process a raw cvar list
  • Returns: bool
  • Prototype: bool instance_process_raw_cvar_list( int $instance_id, int $cvars )

Parameters

int instance_id  Instance to process
int cvars Cvar list to process

instance_process_raw_maplist

  • Description: Process a raw maplist
  • Returns: bool
  • Prototype: bool instance_process_raw_maplist( int $instance_id, int $maplist )

Parameters

int instance_id  Instance to process
int maplist Maps to be added by the remote server to the maplist.

instance_process_raw_new_maps

  • Description: Process user-defined maps into the remote server
  • Returns: bool
  • Prototype: bool instance_process_raw_new_maps( int $instance_id, int $maplist )

Parameters

int instance_id  Instance to process
int maplist Maps to be added by the remote server to the maplist.

instance_process_raw_plugin_cvar_list

  • Description: Process a raw cvar list for a plugin
  • Returns: bool
  • Prototype: bool instance_process_raw_plugin_cvar_list( int $instance_id, int $cvars )

Parameters

int instance_id  Instance to process
int cvars Cvars to process

instance_raw_cvar_list

  • Description: Return raw cvar list
  • Returns: array
  • Prototype: array instance_raw_cvar_list( int $instance_id )

Parameters

int instance_id  Instance to return cvars for

instance_remove_custom_map

  • Description: Remove a custom map from this instance and any rotations
  • Returns: bool
  • Prototype: bool instance_remove_custom_map( int $instance_id, int $map_id )

Parameters

int instance_id  Instance Id
int map_id Instance map Id to delete

instance_remove

  • Description: Remove an instance
  • Returns: bool
  • Prototype: bool instance_remove( int $instance_id )

Parameters

int instance_id  ID for the instance to be removed

instance_smarty_config_list

  • Description: Return an array of config files
  • Returns: array
  • Prototype: array instance_smarty_config_list( int $instance_id )

Parameters

int instance_id  Instance Id

instance_smarty_cvars

  • Description: Return engine cvars
  • Returns: array
  • Prototype: array instance_smarty_cvars( int $instance_id, string $edit_mode, string $userdata )

Parameters

int    instance_id  Instance id
string edit_mode Specify what cvars to return
string userdata Active users user object.

instance_smarty_gametype_list

  • Description: Return gametypes for this instance formatted for smarty
  • Returns: array
  • Prototype: array instance_smarty_gametype_list( int $instance_id )

Parameters

int instance_id  Instance Id

instance_smarty_map_list

  • Description: Return a map list formatted for smarty
  • Returns: array
  • Prototype: array instance_smarty_map_list( int $instance_id, [ int $gametype_id = null ] )

Parameters

int instance_id                    Instance Id
int [ gametype_id = null ] Gametype ID

instance_smarty_rotation_list

  • Description: Return the map rotation formatted for smarty
  • Returns: array
  • Prototype: array instance_smarty_rotation_list( int $instance_id )

Parameters

int instance_id  Instance Id

instance_start

  • Description: Start an instance
  • Returns: bool
  • Prototype: bool instance_start( int $instance_id )

Parameters

int instance_id  ID for the instance to start

instance_stop

  • Description: Stop an instance
  • Returns: bool
  • Prototype: bool instance_stop( int $instance_id )

Parameters

int instance_id  ID for the instance to stop

instance_transfer

  • Description: Transfer an instance to a remote server
  • Returns: bool
  • Prototype: bool instance_transfer( int $instance_id, int $server_id, int $ip_address, int $port, [ string $instance_name = null ], [ multiserv $multiserv = null ] )

Parameters

int       instance_id                  Instance to transfer
int server_id Server to transfer the instance to
int ip_address ID of the remote ip address to move the instance to
int port ID of the remote port to move the instance to
string [ instance_name = null ] Name to give the instance on the remote server. Defaults
to current
multiserv [ multiserv = null ]

instance_upload_config

  • Description: Import configuration data into an instance
  • Returns: bool
  • Prototype: bool instance_upload_config( int $instance_id, string $config_name, string $new_config )

Parameters

int    instance_id  Instance id
string config_name Configuration name
string new_config Configuration data

instance_upload_map

  • Description: Process an uploaded map file
  • Returns: array
  • Prototype: array instance_upload_map( int $instance_id, array $_FILES, [ string $url = null ] )

Parameters

int    instance_id            Instance Id
array _FILES $_FILES global
string [ url = null ] URL for remote file

instance_verify_parameters

  • Description: Verify all the parameters that will be used to create an instance
  • Returns: bool
  • Prototype: bool instance_verify_parameters( mixed $engine, int $user_id, string $name, int $maxplayers, int $ip, int $port, int $engine_id )

Parameters

mixed  engine      
int user_id User that the instance will be added to
string name Instance name
int maxplayers Max players
int ip ID for the ip to be assigned
int port ID for the port to be assigned
int engine_id Engine that the instance will be attached to

instance_write_banfile

  • Description: Write the banfile
  • Returns: bool
  • Prototype: bool instance_write_banfile( int $instance_id )

Parameters

int instance_id  Instance to write the banfile for

instance

  • Description: Return an instance object
  • Returns: instance
  • Prototype: instance instance( int $instance_id )

Parameters

int instance_id  ID for the remote instance to create an object of

instanceInfo

  • Description: Alias for InstanceInfo
  • Returns: array
  • Prototype: array instanceInfo( int $instance_id )

Parameters

int instance_id  ID for the remote instance to get information for

news_create_item

  • Description: Create a news post on the server
  • Returns: bool
  • Prototype: bool news_create_item( int $poster_id, int $engine_id, string $subject, string $body, [ string $unique_id = null ] )

Parameters

int    poster_id                    Id of the user who created this post
int engine_id Engine ID for the post to be attatched to
string subject Subject for the news post
string body Body for the news post
string [ unique_id = null ] This is an MD5 hash of the time and subject, used to
group together posts across the cluster

news_create_new_item

  • Description: Add a news post to the server/servers provided
  • Returns: bool
  • Prototype: bool news_create_new_item( user $poster, int $engine_id, string $subject, string $body, array $servers )

Parameters

user   poster     
int engine_id Engine ID for the post to be attatched to
string subject Subject for the news post
string body Body for the news post
array servers Servers for the post to be put on.

news_delete_item

  • Description: Remove a news item
  • Returns: bool
  • Prototype: bool news_delete_item( int $item_id )

Parameters

int item_id  News item to remove

news_edit_item

  • Description: Update a news items data
  • Returns: bool
  • Prototype: bool news_edit_item( int $item_id, int $engine_id, string $subject, string $body )

Parameters

int    item_id    Item Id to edit
int engine_id Engine ID the item is attatched to
string subject Subject for the news post
string body Body for the news post.

news_edit_items

  • Description: Update news items across the cluster
  • Returns: bool
  • Prototype: bool news_edit_items( int $item_id, int $engine_id, string $subject, string $body )

Parameters

int    item_id    Item Id to edit
int engine_id Engine ID the item is attatched to
string subject Subject for the news post
string body Body for the news post.

news_get_id_from_unique_id

  • Description: Return the ID of a news item based on the UniqueID provided
  • Returns: int
  • Prototype: int news_get_id_from_unique_id( string $unique_id )

Parameters

string unique_id  MD5 unique id

news_get_item_data

  • Description: Get the contents of an item, strip out s
  • Returns: string
  • Prototype: string news_get_item_data( int $item_id )

Parameters

int item_id  Item to view

news_list_items

  • Description: Return an array of news items
  • Returns: array
  • Prototype: array news_list_items( )

news_set_all_html

  • Description: Set HTML enabled/disabled in news posts, this effects all servers in thecluster
  • Returns: bool
  • Prototype: bool news_set_all_html( int $enable )

Parameters

int enable  Enable news, 1 for yes, 0 for no

news_set_html

  • Description: Set HTML enabled/disabled in news posts
  • Returns: bool
  • Prototype: bool news_set_html( int $enable )

Parameters

int enable  Enable news, 1 for yes, 0 for no

send_command

  • Description: Send a command to a remote server
  • Returns: mixed
  • Prototype: mixed send_command( string $command, array $data, [ bool $unserialize = FALSE ] )

Parameters

string command                         Command to send, usually a full-length class function
name
array data Array of data to be sent
bool [ unserialize = FALSE ] Specify if you want the results unserialized or not

server_add

  • Description: Add a new server
  • Returns: bool
  • Prototype: bool server_add( string $ip_address, string $password, [ array $info = null ] )

Parameters

string ip_address              Remote servers IP address
string password Remote servers password
array [ info = null ] Raw info array

server_exists

  • Description: Check if a server with this name already exists.
  • Returns: bool
  • Prototype: bool server_exists( string $ip_address )

Parameters

string ip_address  

server_get_id

  • Description: Retrieve a servers ID from the IP address
  • Returns: int
  • Prototype: int server_get_id( string $ip_address, [ bool $force_local = TRUE ] )

Parameters

string ip_address                     IP to search for
bool [ force_local = TRUE ] Force a local lookup

server_get_ips

  • Description: Retrieve a remote servers available IPs
  • Returns: array
  • Prototype: array server_get_ips( )

server_get_ports

  • Description: Retrieve available engine ports
  • Returns: array
  • Prototype: array server_get_ports( int $engine_id, int $ip_address )

Parameters

int engine_id   Engine to retreive ports for
int ip_address The IP address to check for open ports on.

server_list

  • Description: Get a list of servers in the cluster
  • Returns: array
  • Prototype: array server_list( [ bool $engines = FALSE ], [ array $exclude = array() ], [ array $update_list = null ], [ bool $force_local = FALSE ], [ bool $no_remote_info = FALSE ] )

Parameters

bool  [ engines = FALSE ]                Return engines on the server as well
array [ exclude = array() ] An array with ids to exclude from the server list.
array [ update_list = null ] Update list array from the update server
bool [ force_local = FALSE ] Set to to force a local lookup
bool [ no_remote_info = FALSE ] Do not query the remote server for name information

server_remove

  • Description: Remove a server from the cluster
  • Returns: bool
  • Prototype: bool server_remove( [ bool $noremote = FALSE ], [ mixed $info = null ] )

Parameters

bool  [ noremote = FALSE ]    Notify the remote server to remove this machine
mixed [ info = null ]

server_update_details

  • Description: Update the local server information
  • Returns: bool
  • Prototype: bool server_update_details( string $name, string $location )

Parameters

string name      Name of the server
string location Location of the server

skin_add

  • Description: Create a skin on the server
  • Returns: skin
  • Prototype: skin skin_add( [ string $name = null ], [ string $bgcolor = null ], [ string $_FILES = null ], [ bool $keep_file = null ] )

Parameters

string [ name = null ]              The name of the skin to add.
string [ bgcolor = null ] The background color of this skin in hex.
string [ _FILES = null ] The $_FILES array created by an HTML upload form.
The uploaded skin file is expected to
exist in $_FILES[].
bool [ keep_file = null ] Default to . If set then do not delete the
original temporary upload file. This is used
for situations where the skin is
uploaded to multiple servers
from this server.

skin_batch_set_default

  • Description: Set a skin to be default for the specified servers
  • Returns: bool
  • Prototype: bool skin_batch_set_default( skin $skin, array $servers )

Parameters

skin  skin     
array servers Servers to have the skin set

skin_delete_multi

  • Description: Delete a skin across the cluster
  • Returns: bool
  • Prototype: bool skin_delete_multi( int $skin, array $servers )

Parameters

int   skin     Object for the skin to edit
array servers A list of server ids to remove the skin on.

skin_delete

  • Description: Delete a skin
  • Returns: bool
  • Prototype: bool skin_delete( int $skin_id )

Parameters

int skin_id  ID for the skin to delete

skin_edit

  • Description: Edit a skin
  • Returns: bool
  • Prototype: bool skin_edit( int $skin_id, [ string $name = null ], [ string $bgcolor = null ], [ string $_FILES = null ] )

Parameters

int    skin_id                   ID for the skin to edit
string [ name = null ] The name of the skin to edit.
string [ bgcolor = null ] The background color of this skin in hex.
string [ _FILES = null ] The $_FILES array

skin_get_server_list

  • Description: Get a list of servers that the specified skin is on
  • Returns: array
  • Prototype: array skin_get_server_list( string $skin_name )

Parameters

string skin_name  Skin name to look for

skin_get_skin_list

  • Description: Return a list of skins
  • Returns: bool
  • Prototype: bool skin_get_skin_list( )

skin_global_edit

  • Description: Edit a skin across the cluster
  • Returns: bool
  • Prototype: bool skin_global_edit( int $skin, [ string $name = null ], [ string $bgcolor = null ], [ string $_FILES = null ] )

Parameters

int    skin                      Object for the skin to edit
string [ name = null ] The name of the skin to edit.
string [ bgcolor = null ] The background color of this skin in hex.
string [ _FILES = null ] The $_FILES array

skin_set_default

  • Description: Set the default skin
  • Returns: bool
  • Prototype: bool skin_set_default( int $skin_id )

Parameters

int skin_id  Skin ID for the default skin

skin_smarty_skin_list

  • Description: Get a list of smarty formatted skins.
  • Returns: array
  • Prototype: array skin_smarty_skin_list( )

skin

  • Description: Create a skin object for the ID specified
  • Returns: skin
  • Prototype: skin skin( int $skin_id )

Parameters

int skin_id  Skin ID to create an object for

system_full_status

  • Description: Obtain server status page information
  • Returns: array
  • Prototype: array system_full_status( )

system_general

  • Description: General system information.
  • Returns: array
  • Prototype: array system_general( )

system_mem_info

  • Description: Obtain memory information
  • Returns: array
  • Prototype: array system_mem_info( )

system_nslookup

  • Description: Query dns for an address
  • Returns: bool
  • Prototype: bool system_nslookup( string $address )

Parameters

string address  Address to lookup

system_ping

  • Description: Ping an address
  • Returns: bool
  • Prototype: bool system_ping( string $address )

Parameters

string address  Address to ping

system_status

  • Description: Obtain remote server status
  • Returns: array
  • Prototype: array system_status( )

system_time

  • Description: Return the local time on the server
  • Returns: int
  • Prototype: int system_time( )

system_traceroute

  • Description: Perform a traceroute
  • Returns: bool
  • Prototype: bool system_traceroute( string $address )

Parameters

string address  Address to traceroute to

system_whois

  • Description: Execute a whois query on an address
  • Returns: bool
  • Prototype: bool system_whois( string $address )

Parameters

string address  Address to lookup

user_add_to_cluster

  • Description: Create a user across the cluster
  • Returns: bool
  • Prototype: bool user_add_to_cluster( string $username, array $password, string $email, int $admin, string $address, string $extended_address, string $prim_phone, string $sec_phone, string $fname, string $lname, string $aim, int $icq, string $msn, string $comments, int $skin, int $i365_news, int $filter_engines, [ int $user_id = null ] )

Parameters

string username                   Username
array password Password
string email Email address
int admin Specify if the user is an admin (0 = )
string address Address
string extended_address More address information, such as city,state,zip, etc
string prim_phone Primary phone number
string sec_phone Secondary phone number
string fname First name
string lname last name
string aim AIM Handle
int icq ICQ number
string msn MSN Account
string comments User comments
int skin ID of the the users skin. Value of 0 sets system default
skin.
int i365_news Display i365 news from our xml stream. 0 for no, 1 for
yes
int filter_engines Filter news engines to display only engines that the user
has instances for
int [ user_id = null ] Set this to a value if you would like to expand the user
across the cluster.

user_add

  • Description: Create a user on the server
  • Returns: int
  • Prototype: int user_add( string $username, array $password, string $email, int $admin, string $address, string $extended_address, string $prim_phone, string $sec_phone, string $fname, string $lname, string $aim, int $icq, string $msn, string $comments, int $skin, int $i365_news, int $filter_engines, [ bool $no_md5 = FALSE ] )

Parameters

string username                   Username
array password Password
string email Email address
int admin Specify if the user is an admin (0 = )
string address Address
string extended_address More address information, such as city,state,zip, etc
string prim_phone Primary phone number
string sec_phone Secondary phone number
string fname First name
string lname last name
string aim AIM Handle
int icq ICQ number
string msn MSN Account
string comments User comments
int skin ID of the the users skin. Value of 0 sets system default
skin.
int i365_news Display i365 news from our xml stream. 0 for no, 1 for
yes
int filter_engines Filter news engines to display only engines that the user
has instances for
bool [ no_md5 = FALSE ] Dont MD5 the password.

user_change_password

  • Description: Update a users password
  • Returns: bool
  • Prototype: bool user_change_password( int $user_id, string $password )

Parameters

int    user_id   User ID
string password New password

user_check_for_username

  • Description: Check if a user with the supplied username exists
  • Returns: array
  • Prototype: array user_check_for_username( string $username )

Parameters

string username  username to check against

user_generate_news

  • Description: Generate a news array for the specified user
  • Returns: array
  • Prototype: array user_generate_news( user $user )

Parameters

user user  

user_get_id

  • Description: Get a local user id by looking up the remote user id/server combo
  • Returns: int
  • Prototype: int user_get_id( int $user_id, int $server_id )

Parameters

int user_id    Remote user id
int server_id Remote server id

user_get_xref

  • Description: Get user-server cross reference array
  • Returns: array
  • Prototype: array user_get_xref( [ int $user_id = null ], [ int $server_id = null ], [ bool $force_local = TRUE ], [ bool $include_objects = FALSE ] )

Parameters

int  [ user_id = null ]                  User to return cross reference for
int [ server_id = null ] Remote server to restrict the list to
bool [ force_local = TRUE ] Force the function to refer to the local xref list.
bool [ include_objects = FALSE ] If set to , will return user objects instead of the cross
reference.

user_is_admin

  • Description: Check if a user is an admin
  • Returns: bool
  • Prototype: bool user_is_admin( user $userdata )

Parameters

user userdata  

user_is_global

  • Description: Check if the user is global
  • Returns: bool
  • Prototype: bool user_is_global( int $user_id )

Parameters

int user_id  ID of the user to check

user_link

  • Description: Link users across multiple servers
  • Returns: bool
  • Prototype: bool user_link( int $user_id, int $remote_user_id, int $remote_server_id, [ array $remote_xref = null ], [ array $info = null ] )

Parameters

int   user_id                 Local user to link
int remote_user_id Remote user to link
int remote_server_id Remote server to link users
array [ remote_xref = null ] Cross reference table for the remote user.
array [ info = null ] Raw info array sent from remote server

user_list

  • Description: Return user list
  • Returns: array
  • Prototype: array user_list( [ string $exclude = null ], [ bool $strict = null ], [ int $server_id = 1 ], [ bool $force_local = FALSE ] )

Parameters

string  [ exclude = null ]              Username to exclude from results
bool [ strict = null ] If set to , filters out remote users which are referenced
locally.
int [ server_id = 1 ] Server to retreive the userlist from.
bool [ force_local = FALSE ]

user_remove_user

  • Description: Remove a user from the system
  • Returns: bool
  • Prototype: bool user_remove_user( int $user_id )

Parameters

int user_id  User ID

user_unlink_all

  • Description: Unlink all users on the system to specified server
  • Returns: bool
  • Prototype: bool user_unlink_all( int $remote_server_id )

Parameters

int remote_server_id  Remote server to unlink.

user_unlink

  • Description: Unlink a user from remote machine
  • Returns: bool
  • Prototype: bool user_unlink( int $user_id, mixed $remote_server_id, [ array $info = null ] )

Parameters

int   user_id                 User to unlink
mixed remote_server_id Remote server to remove the link for
array [ info = null ] Raw info array

user_update_info

  • Description: Update user information
  • Returns: bool
  • Prototype: bool user_update_info( int $user_id, string $email, int $admin, string $address, string $extended_address, string $prim_phone, string $sec_phone, string $fname, string $lname, string $aim, int $icq, string $msn, string $comments, int $skin, int $i365_news, int $filter_engines )

Parameters

int    user_id           User ID
string email Email address
int admin Specify if the user is an admin (0 = )
string address Address
string extended_address More address information, such as city,state,zip, etc
string prim_phone Primary phone number
string sec_phone Secondary phone number
string fname First name
string lname last name
string aim AIM Handle
int icq ICQ number
string msn MSN Account
string comments User comments
int skin ID of the the users skin. Value of 0 sets system default
skin.
int i365_news Display i365 news from our xml stream. 0 for no, 1 for
yes
int filter_engines Filter news engines to display only engines that the user
has instances for

user

  • Description: Return a user object
  • Returns: user
  • Prototype: user user( int $user_id )

Parameters

int user_id  User ID to create an object for

valid_ipv4

  • Description: Validates an ip address
  • Returns: bool
  • Prototype: bool valid_ipv4( string $ip_addr )

Parameters

string ip_addr  String to validate as an IP address.