Merge pull request #103 from GameServerPanel/copilot/fix-batch-of-errors
Fix array offset on false, array-to-string, and missing INSERT columns in billing sync
This commit is contained in:
commit
2686174609
3 changed files with 11 additions and 6 deletions
|
|
@ -3588,11 +3588,11 @@ class OGPDatabaseMySQL extends OGPDatabase
|
||||||
|
|
||||||
public function getNextAvailablePort($ip_id,$home_cfg_id){
|
public function getNextAvailablePort($ip_id,$home_cfg_id){
|
||||||
$ranges = $this->getPortsRange($ip_id,$home_cfg_id);
|
$ranges = $this->getPortsRange($ip_id,$home_cfg_id);
|
||||||
$range = $ranges[0];
|
$range = is_array($ranges) ? ($ranges[0] ?? null) : null;
|
||||||
if(empty($range))
|
if(empty($range))
|
||||||
{
|
{
|
||||||
$ranges = $this->getPortsRange($ip_id,"0");
|
$ranges = $this->getPortsRange($ip_id,"0");
|
||||||
$range = $ranges[0];
|
$range = is_array($ranges) ? ($ranges[0] ?? null) : null;
|
||||||
}
|
}
|
||||||
if(empty($range))
|
if(empty($range))
|
||||||
$range = array('start_port' => '27015','end_port' => '39915', 'port_increment' => '100');
|
$range = array('start_port' => '27015','end_port' => '39915', 'port_increment' => '100');
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,9 @@ function sync_billing_services(mysqli $db, string $prefix): array
|
||||||
'price_year' => "ADD COLUMN `price_year` FLOAT(15,4) NOT NULL DEFAULT 0",
|
'price_year' => "ADD COLUMN `price_year` FLOAT(15,4) NOT NULL DEFAULT 0",
|
||||||
'remote_server_id' => "ADD COLUMN `remote_server_id` VARCHAR(255) NOT NULL DEFAULT ''",
|
'remote_server_id' => "ADD COLUMN `remote_server_id` VARCHAR(255) NOT NULL DEFAULT ''",
|
||||||
'install_method' => "ADD COLUMN `install_method` VARCHAR(255) NOT NULL DEFAULT 'steamcmd'",
|
'install_method' => "ADD COLUMN `install_method` VARCHAR(255) NOT NULL DEFAULT 'steamcmd'",
|
||||||
|
'ftp' => "ADD COLUMN `ftp` VARCHAR(255) NOT NULL DEFAULT ''",
|
||||||
|
'manual_url' => "ADD COLUMN `manual_url` VARCHAR(255) NOT NULL DEFAULT ''",
|
||||||
|
'access_rights' => "ADD COLUMN `access_rights` VARCHAR(255) NOT NULL DEFAULT ''",
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($autoRepairCols as $col => $alterFragment) {
|
foreach ($autoRepairCols as $col => $alterFragment) {
|
||||||
|
|
@ -138,12 +141,14 @@ function sync_billing_services(mysqli $db, string $prefix): array
|
||||||
(home_cfg_id, mod_cfg_id, service_name, description,
|
(home_cfg_id, mod_cfg_id, service_name, description,
|
||||||
remote_server_id, enabled, out_of_stock,
|
remote_server_id, enabled, out_of_stock,
|
||||||
price_daily, price_monthly, price_year,
|
price_daily, price_monthly, price_year,
|
||||||
slot_min_qty, slot_max_qty, install_method)
|
slot_min_qty, slot_max_qty, install_method,
|
||||||
|
img_url, ftp, manual_url, access_rights)
|
||||||
VALUES
|
VALUES
|
||||||
({$homeCfgId}, {$modCfgId}, '{$svcName}', '{$svcName}',
|
({$homeCfgId}, {$modCfgId}, '{$svcName}', '{$svcName}',
|
||||||
'', 0, 0,
|
'', 0, 0,
|
||||||
0, 0, 0,
|
0, 0, 0,
|
||||||
1, 100, 'steamcmd')"
|
1, 100, 'steamcmd',
|
||||||
|
'', '', '', '')"
|
||||||
);
|
);
|
||||||
$messages[] = "Added new service: " . ($gm['mod_name'] ?: $gm['game_name']);
|
$messages[] = "Added new service: " . ($gm['mod_name'] ?: $gm['game_name']);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -173,9 +173,9 @@ function config_games_render_node(SimpleXMLElement $node, array $ancestors, arra
|
||||||
}
|
}
|
||||||
|
|
||||||
$attributes = $node->attributes();
|
$attributes = $node->attributes();
|
||||||
if ($attributes && count((array)$attributes) > 0) {
|
if ($attributes && count($attributes) > 0) {
|
||||||
$html .= "<div class='xml-node__attributes'><strong>Attributes</strong>";
|
$html .= "<div class='xml-node__attributes'><strong>Attributes</strong>";
|
||||||
foreach ((array)$attributes as $attrName => $attrValue) {
|
foreach ($attributes as $attrName => $attrValue) {
|
||||||
$attrSafe = htmlspecialchars($attrName, ENT_QUOTES, 'UTF-8');
|
$attrSafe = htmlspecialchars($attrName, ENT_QUOTES, 'UTF-8');
|
||||||
$valSafe = gsp_value_to_editable_string($attrValue);
|
$valSafe = gsp_value_to_editable_string($attrValue);
|
||||||
$html .= "<div class='attr-row'><span>{$attrSafe}</span><input type='text' name=\"nodes[{$safeNodeKey}][attributes][{$attrSafe}]\" value=\"{$valSafe}\" placeholder='Leave blank to remove'></div>";
|
$html .= "<div class='attr-row'><span>{$attrSafe}</span><input type='text' name=\"nodes[{$safeNodeKey}][attributes][{$attrSafe}]\" value=\"{$valSafe}\" placeholder='Leave blank to remove'></div>";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue