コード例 #1
0
ファイル: servers.php プロジェクト: milecar91/GamePanelX-V3
            if (!is_numeric($new_userid)) {
                die('Failed to create user: '******'';
        // Create the server
        echo $Servers->create($srv_netid, $this_gid, $new_userid, $tplid, $srv_port, $srv_description, $srv_total_slots, $srv_rcon_pass, $srv_is_private, $srv_private_pass);
    } else {
        die('Sorry, no available ip/port combinations available to handle this request!');
    }
} elseif ($api_action == 'delete' || $api_action == 'terminate' || $api_action == 'terminateserver') {
    if (empty($api_relid)) {
        die('No server ID provided');
    }
    echo $Servers->delete($api_relid);
} elseif ($api_action == 'restart') {
    if (empty($api_relid)) {
        die('No server ID provided');
    }
    echo $Servers->restart($api_relid);
} elseif ($api_action == 'stop') {
    if (empty($api_relid)) {
        die('No server ID provided');
    }
    echo $Servers->stop($api_relid);
} elseif ($api_action == 'suspend' || $api_action == 'unsuspend') {
    die('Suspend/UnSuspend have not been implemented yet, sorry');
}
コード例 #2
0
require 'checkallowed.php';
// No direct access
error_reporting(E_ERROR);
// Server actions
$url_id = $GPXIN['id'];
$url_do = $GPXIN['do'];
$url_netid = $GPXIN['netid'];
$url_gameid = $GPXIN['gameid'];
$gpx_srvid = $url_id;
require DOCROOT . '/checkallowed.php';
// Check login/ownership
require DOCROOT . '/includes/classes/servers.php';
$Servers = new Servers();
// Gameserver restart
if ($url_do == 'restart') {
    echo $Servers->restart($url_id);
} elseif ($url_do == 'stop') {
    echo $Servers->stop($url_id);
} elseif ($url_do == 'update') {
    echo $Servers->update($url_id);
} elseif ($url_do == 'settings_save') {
    // Save Server Settings via server settings tab
    $url_netid = $GPXIN['ip'];
    $url_descr = strip_tags($GPXIN['srvdescr']);
    $url_userid = $GPXIN['userid'];
    $url_updatecmd = $GPXIN['update_cmd'];
    $url_cmd = $GPXIN['cmd'];
    $url_startup = $GPXIN['startup'];
    $url_port = $GPXIN['port'];
    $url_working_dir = $GPXIN['working_dir'];
    $url_pid_file = $GPXIN['pid_file'];