#493 Add option to specify query port (1-5)

This commit is contained in:
Ulrich Block 2014-09-20 10:25:34 +02:00
parent 50c8569b6e
commit c423e91bab
6 changed files with 46 additions and 8 deletions

View File

@ -827,12 +827,12 @@ if ($currentStep == 8 and count($systemCheckError) == 0) {
$displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_gameserver_data}</div>";
$query = $sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `servertypes` WHERE `shorten`=? AND `resellerid`=0 LIMIT 1");
$query2 = $sql->prepare("INSERT INTO `servertypes` (`steamgame`,`appID`,`updates`,`shorten`,`description`,`gamebinary`,`gamebinaryWin`,`binarydir`,`modfolder`,`fps`,`slots`,`map`,`cmd`,`modcmds`,`tic`,`gameq`,`gamemod`,`gamemod2`,`configs`,`configedit`,`portStep`,`portMax`,`portOne`,`portTwo`,`portThree`,`portFour`,`portFive`,`mapGroup`,`protected`,`protectedSaveCFGs`,`ramLimited`,`os`) VALUES (:steamgame,:appID,:updates,:shorten,:description,:gamebinary,:gamebinaryWin,:binarydir,:modfolder,:fps,:slots,:map,:cmd,:modcmds,:tic,:gameq,:gamemod,:gamemod2,:configs,:configedit,:portStep,:portMax,:portOne,:portTwo,:portThree,:portFour,:portFive,:mapGroup,:protected,:protectedSaveCFGs,:ramLimited,:os)");
$query3 = $sql->prepare("UPDATE `servertypes` SET `steamgame`=:steamgame,`appID`=:appID,`updates`=:updates,`shorten`=:shorten,`description`=:description,`gamebinary`=:gamebinary,`gamebinaryWin`=:gamebinaryWin,`binarydir`=:binarydir,`modfolder`=:modfolder,`fps`=:fps,`slots`=:slots,`map`=:map,`cmd`=:cmd,`modcmds`=:modcmds,`tic`=:tic,`gameq`=:gameq,`gamemod`=:gamemod,`gamemod2`=:gamemod2,`configs`=:configs,`configedit`=:configedit,`portStep`=:portStep,`portMax`=:portMax,`portOne`=:portOne,`portTwo`=:portTwo,`portThree`=:portThree,`portFour`=:portFour,`portFive`=:portFive,`mapGroup`=:mapGroup,`protected`=:protected,`protectedSaveCFGs`=:protectedSaveCFGs,`ramLimited`=:ramLimited,`os`=:os WHERE `shorten`=:shorten AND `resellerid`=0 LIMIT 1");
$query2 = $sql->prepare("INSERT INTO `servertypes` (`steamgame`,`appID`,`updates`,`shorten`,`description`,`gamebinary`,`gamebinaryWin`,`binarydir`,`modfolder`,`fps`,`slots`,`map`,`cmd`,`modcmds`,`tic`,`gameq`,`gamemod`,`gamemod2`,`configs`,`configedit`,`portStep`,`portMax`,`portOne`,`portTwo`,`portThree`,`portFour`,`portFive`,`useQueryPort`,`mapGroup`,`protected`,`protectedSaveCFGs`,`ramLimited`,`os`) VALUES (:steamgame,:appID,:updates,:shorten,:description,:gamebinary,:gamebinaryWin,:binarydir,:modfolder,:fps,:slots,:map,:cmd,:modcmds,:tic,:gameq,:gamemod,:gamemod2,:configs,:configedit,:portStep,:portMax,:portOne,:portTwo,:portThree,:portFour,:portFive,:useQueryPort,:mapGroup,:protected,:protectedSaveCFGs,:ramLimited,:os)");
$query3 = $sql->prepare("UPDATE `servertypes` SET `steamgame`=:steamgame,`appID`=:appID,`updates`=:updates,`shorten`=:shorten,`description`=:description,`gamebinary`=:gamebinary,`gamebinaryWin`=:gamebinaryWin,`binarydir`=:binarydir,`modfolder`=:modfolder,`fps`=:fps,`slots`=:slots,`map`=:map,`cmd`=:cmd,`modcmds`=:modcmds,`tic`=:tic,`gameq`=:gameq,`gamemod`=:gamemod,`gamemod2`=:gamemod2,`configs`=:configs,`configedit`=:configedit,`portStep`=:portStep,`portMax`=:portMax,`portOne`=:portOne,`portTwo`=:portTwo,`portThree`=:portThree,`portFour`=:portFour,`portFive`=:portFive,`useQueryPort`=:useQueryPort,`mapGroup`=:mapGroup,`protected`=:protected,`protectedSaveCFGs`=:protectedSaveCFGs,`ramLimited`=:ramLimited,`os`=:os WHERE `shorten`=:shorten AND `resellerid`=0 LIMIT 1");
foreach ($gameImages as $image) {
if (count($image) == 32) {
if (count($image) == 33) {
$query->execute(array($image[':shorten']));
$imageExists = (int) $query->fetchColumn();

View File

@ -135,6 +135,9 @@ if (isset($include) and $include == true) {
$response->add('Repairing tables if needed.');
include(EASYWIDIR . '/stuff/methods/tables_repair.php');
$query = $sql->prepare("UPDATE `servertypes` SET `useQueryPort`=2 WHERE `gameq` IN ('armedassault2', 'armedassault2oa', 'armedassault3', 'bf2', 'cube2', 'mta', 'ut', 'ut2004', 'ut3')");
$query->execute();
} else {
echo "Error: this file needs to be included by the updater!<br />";
}

View File

@ -103,12 +103,12 @@ if ($ui->st('d', 'get') == 'bu' and $ui->st('action', 'post') == 'bu' and $resel
$array = (array) $ui->pregw('games', 255, 'post');
$query = $sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `servertypes` WHERE `shorten`=? AND `resellerid`=? LIMIT 1");
$query2 = $sql->prepare("INSERT INTO `servertypes` (`steamgame`,`appID`,`updates`,`shorten`,`description`,`gamebinary`,`gamebinaryWin`,`binarydir`,`modfolder`,`fps`,`slots`,`map`,`cmd`,`modcmds`,`tic`,`gameq`,`gamemod`,`gamemod2`,`configs`,`configedit`,`portStep`,`portMax`,`portOne`,`portTwo`,`portThree`,`portFour`,`portFive`,`mapGroup`,`protected`,`protectedSaveCFGs`,`ramLimited`,`os`,`resellerid`) VALUES (:steamgame,:appID,:updates,:shorten,:description,:gamebinary,:gamebinaryWin,:binarydir,:modfolder,:fps,:slots,:map,:cmd,:modcmds,:tic,:gameq,:gamemod,:gamemod2,:configs,:configedit,:portStep,:portMax,:portOne,:portTwo,:portThree,:portFour,:portFive,:mapGroup,:protected,:protectedSaveCFGs,:ramLimited,:os,:resellerid)");
$query3 = $sql->prepare("UPDATE `servertypes` SET `steamgame`=:steamgame,`appID`=:appID,`updates`=:updates,`shorten`=:shorten,`description`=:description,`gamebinary`=:gamebinary,`gamebinaryWin`=:gamebinaryWin,`binarydir`=:binarydir,`modfolder`=:modfolder,`fps`=:fps,`slots`=:slots,`map`=:map,`cmd`=:cmd,`modcmds`=:modcmds,`tic`=:tic,`gameq`=:gameq,`gamemod`=:gamemod,`gamemod2`=:gamemod2,`configs`=:configs,`configedit`=:configedit,`portStep`=:portStep,`portMax`=:portMax,`portOne`=:portOne,`portTwo`=:portTwo,`portThree`=:portThree,`portFour`=:portFour,`portFive`=:portFive,`mapGroup`=:mapGroup,`protected`=:protected,`protectedSaveCFGs`=:protectedSaveCFGs,`ramLimited`=:ramLimited,`os`=:os WHERE `shorten`=:shorten AND `resellerid`=:resellerid LIMIT 1");
$query2 = $sql->prepare("INSERT INTO `servertypes` (`steamgame`,`appID`,`updates`,`shorten`,`description`,`gamebinary`,`gamebinaryWin`,`binarydir`,`modfolder`,`fps`,`slots`,`map`,`cmd`,`modcmds`,`tic`,`gameq`,`gamemod`,`gamemod2`,`configs`,`configedit`,`portStep`,`portMax`,`portOne`,`portTwo`,`portThree`,`portFour`,`portFive`,`useQueryPort`,`mapGroup`,`protected`,`protectedSaveCFGs`,`ramLimited`,`os`,`resellerid`) VALUES (:steamgame,:appID,:updates,:shorten,:description,:gamebinary,:gamebinaryWin,:binarydir,:modfolder,:fps,:slots,:map,:cmd,:modcmds,:tic,:gameq,:gamemod,:gamemod2,:configs,:configedit,:portStep,:portMax,:portOne,:portTwo,:portThree,:portFour,:portFive,:useQueryPort,:mapGroup,:protected,:protectedSaveCFGs,:ramLimited,:os,:resellerid)");
$query3 = $sql->prepare("UPDATE `servertypes` SET `steamgame`=:steamgame,`appID`=:appID,`updates`=:updates,`shorten`=:shorten,`description`=:description,`gamebinary`=:gamebinary,`gamebinaryWin`=:gamebinaryWin,`binarydir`=:binarydir,`modfolder`=:modfolder,`fps`=:fps,`slots`=:slots,`map`=:map,`cmd`=:cmd,`modcmds`=:modcmds,`tic`=:tic,`gameq`=:gameq,`gamemod`=:gamemod,`gamemod2`=:gamemod2,`configs`=:configs,`configedit`=:configedit,`portStep`=:portStep,`portMax`=:portMax,`portOne`=:portOne,`portTwo`=:portTwo,`portThree`=:portThree,`portFour`=:portFour,`portFive`=:portFive,`useQueryPort`=:useQueryPort,`mapGroup`=:mapGroup,`protected`=:protected,`protectedSaveCFGs`=:protectedSaveCFGs,`ramLimited`=:ramLimited,`os`=:os WHERE `shorten`=:shorten AND `resellerid`=:resellerid LIMIT 1");
foreach ($gameImages as $image) {
if (in_array($image[':shorten'], $array) and count($image) == 32) {
if (in_array($image[':shorten'], $array) and count($image) == 33) {
$image[':resellerid'] = $resellerLockupID;
@ -122,7 +122,7 @@ if ($ui->st('d', 'get') == 'bu' and $ui->st('action', 'post') == 'bu' and $resel
if ($query2->rowCount() > 0) {
$template_file .= $gsprache->add . ': ' . $image[':description'] .'<br>';
} else {
$template_file .= 'Error ' . $gsprache->add . ': ' . $image[':description'] .'<br>';
$template_file .= $spracheResponse->error_table . ' ' . $gsprache->add . ': ' . $image[':description'] .'<br>';
}
} else if ($ui->id('actionType', 1 ,'post') == 2) {
@ -132,7 +132,7 @@ if ($ui->st('d', 'get') == 'bu' and $ui->st('action', 'post') == 'bu' and $resel
if ($query3->rowCount() > 0) {
$template_file .= $gsprache->mod . ': ' . $image[':description'] .'<br>';
} else {
$template_file .= 'Error ' . $gsprache->mod . ': ' . $image[':description'] .'<br>';
$template_file .= $spracheResponse->error_table . ' ' . $gsprache->mod . ': ' . $image[':description'] .'<br>';
}
} else {

View File

@ -67,6 +67,7 @@ $gameImages = array(
':portThree' => 27017,
':portFour' => 27018,
':portFive' => 27019,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -101,6 +102,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -135,6 +137,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -169,6 +172,7 @@ $gameImages = array(
':portThree' => 27017,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -203,6 +207,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'main/server.cfg',
@ -237,6 +242,7 @@ $gameImages = array(
':portThree' => 27017,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => '',
@ -271,6 +277,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => '',
@ -305,6 +312,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => '',
@ -339,6 +347,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -373,6 +382,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -407,6 +417,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -441,6 +452,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -475,6 +487,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -509,6 +522,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -543,6 +557,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -577,6 +592,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -611,6 +627,7 @@ $gameImages = array(
':portThree' => 21027,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -645,6 +662,7 @@ $gameImages = array(
':portThree' => 27017,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => 'mg_demolition',
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
@ -679,6 +697,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -713,6 +732,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -747,6 +767,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -781,6 +802,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -815,6 +837,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -849,6 +872,7 @@ $gameImages = array(
':portThree' => 22005,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 2,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -883,6 +907,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => '',
@ -917,6 +942,7 @@ $gameImages = array(
':portThree' => 7778,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -951,6 +977,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -985,6 +1012,7 @@ $gameImages = array(
':portThree' => 2352,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -1019,6 +1047,7 @@ $gameImages = array(
':portThree' => 2352,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -1053,6 +1082,7 @@ $gameImages = array(
':portThree' => 7779,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 2,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -1087,6 +1117,7 @@ $gameImages = array(
':portThree' => 7779,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 2,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -1121,6 +1152,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
@ -1155,6 +1187,7 @@ $gameImages = array(
':portThree' => null,
':portFour' => null,
':portFive' => null,
':useQueryPort' => 1,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,

View File

@ -1079,6 +1079,7 @@ $query = "CREATE TABLE IF NOT EXISTS `servertypes` (
`portThree` smallint(5) unsigned DEFAULT 27017,
`portFour` smallint(5) unsigned DEFAULT 27018,
`portFive` smallint(5) unsigned DEFAULT 27019,
`useQueryPort` smallint(1) unsigned NOT NULL DEFAULT 1,
`protected` enum('Y','N') NOT NULL DEFAULT 'Y',
`ramLimited` enum('Y','N') DEFAULT 'N',
`ftpAccess` enum('Y','N') DEFAULT 'Y',

View File

@ -930,6 +930,7 @@ $defined['servertypes'] = array(
'portThree' => array("Type"=>"smallint(5) unsigned","Null"=>"YES","Key"=>"","Default"=>"27017","Extra"=>""),
'portFour' => array("Type"=>"smallint(5) unsigned","Null"=>"YES","Key"=>"","Default"=>"27018","Extra"=>""),
'portFive' => array("Type"=>"smallint(5) unsigned","Null"=>"YES","Key"=>"","Default"=>"27019","Extra"=>""),
'useQueryPort' => array("Type"=>"smallint(1) unsigned","Null"=>"NO","Key"=>"","Default"=>"1","Extra"=>""),
'protected' => array("Type"=>"enum('Y','N')","Null"=>"NO","Key"=>"","Default"=>"Y","Extra"=>""),
'ramLimited' => array("Type"=>"enum('Y','N')","Null"=>"NO","Key"=>"","Default"=>"N","Extra"=>""),
'ftpAccess' => array("Type"=>"enum('Y','N')","Null"=>"NO","Key"=>"","Default"=>"Y","Extra"=>""),