Clean qstat leftovers

This commit is contained in:
Ulrich Block 2013-12-18 08:28:42 +01:00
parent 760bd5ffee
commit 83af9a834e
17 changed files with 131 additions and 124 deletions

View File

@ -104,7 +104,6 @@
<port_gs>Gameserverport</port_gs> <port_gs>Gameserverport</port_gs>
<premoved>Serverpasswort entfernt</premoved> <premoved>Serverpasswort entfernt</premoved>
<protect>Protection Modus</protect> <protect>Protection Modus</protect>
<qstat>QStat Parameter</qstat>
<ramMax>Maximaler Ram</ramMax> <ramMax>Maximaler Ram</ramMax>
<ramMin>Minimaler Ram</ramMin> <ramMin>Minimaler Ram</ramMin>
<rcon>RCON Passwort</rcon> <rcon>RCON Passwort</rcon>

View File

@ -48,8 +48,6 @@
<portStep>Port Schritte zum nächsten Server</portStep> <portStep>Port Schritte zum nächsten Server</portStep>
<protect>Protection Modus</protect> <protect>Protection Modus</protect>
<protectedSaveCFGs>Dateien behalten beim Protection Mode Switch</protectedSaveCFGs> <protectedSaveCFGs>Dateien behalten beim Protection Mode Switch</protectedSaveCFGs>
<qstat>Qstat Parameter</qstat>
<qstatpassparam>Qstat Passwortparameter</qstatpassparam>
<ramLimited>Ram Limitiert</ramLimited> <ramLimited>Ram Limitiert</ramLimited>
<rcon>Remote Passwort (RCON)</rcon> <rcon>Remote Passwort (RCON)</rcon>
<requires>Benötigt</requires> <requires>Benötigt</requires>

View File

@ -75,7 +75,6 @@
<port_gs>Spilserverport</port_gs> <port_gs>Spilserverport</port_gs>
<premoved>Serveradgangskode fjernet</premoved> <premoved>Serveradgangskode fjernet</premoved>
<protect>Beskyttelse tilstand</protect> <protect>Beskyttelse tilstand</protect>
<qstat>Qstat parameter</qstat>
<ramMax>Maksimale Hukommelse</ramMax> <ramMax>Maksimale Hukommelse</ramMax>
<ramMin>Minimum Hukommelse</ramMin> <ramMin>Minimum Hukommelse</ramMin>
<rcon>Fjernbetjening adgangskode (RCON)</rcon> <rcon>Fjernbetjening adgangskode (RCON)</rcon>

View File

@ -47,8 +47,6 @@
<portStep>Port skridt til næste server</portStep> <portStep>Port skridt til næste server</portStep>
<protect>Beskyttelse tilstand</protect> <protect>Beskyttelse tilstand</protect>
<protectedSaveCFGs>Filer, der skal holdes mens skifte Beskyttet tilstand</protectedSaveCFGs> <protectedSaveCFGs>Filer, der skal holdes mens skifte Beskyttet tilstand</protectedSaveCFGs>
<qstat>Qstat Parameter</qstat>
<qstatpassparam>Qstat adgangskodeparameter</qstatpassparam>
<ramLimited>Ram begrænset</ramLimited> <ramLimited>Ram begrænset</ramLimited>
<rcon>Fjernbetjening adgangskode (RCON)</rcon> <rcon>Fjernbetjening adgangskode (RCON)</rcon>
<requires>Kræver</requires> <requires>Kræver</requires>

View File

@ -104,7 +104,6 @@
<port_gs>Gameserverport</port_gs> <port_gs>Gameserverport</port_gs>
<premoved>Serverpassword removed</premoved> <premoved>Serverpassword removed</premoved>
<protect>Protection Mode</protect> <protect>Protection Mode</protect>
<qstat>Qstat parameter</qstat>
<ramMax>Maximum Ram</ramMax> <ramMax>Maximum Ram</ramMax>
<ramMin>Minimum Ram</ramMin> <ramMin>Minimum Ram</ramMin>
<rcon>Remote password (RCON)</rcon> <rcon>Remote password (RCON)</rcon>

View File

@ -48,8 +48,6 @@
<portStep>Port steps to next server</portStep> <portStep>Port steps to next server</portStep>
<protect>Protection modus</protect> <protect>Protection modus</protect>
<protectedSaveCFGs>Files to be kept while switching Protection Mode</protectedSaveCFGs> <protectedSaveCFGs>Files to be kept while switching Protection Mode</protectedSaveCFGs>
<qstat>Qstat Parameter</qstat>
<qstatpassparam>Qstat passwordparameter</qstatpassparam>
<ramLimited>Ram limited</ramLimited> <ramLimited>Ram limited</ramLimited>
<rcon>Remote password (RCON)</rcon> <rcon>Remote password (RCON)</rcon>
<requires>Requires</requires> <requires>Requires</requires>

View File

@ -73,7 +73,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
echo "Fetch version for Minecraft and Bukkit Server\r\n"; echo "Fetch version for Minecraft and Bukkit Server\r\n";
$query = $sql->prepare("SELECT t.`shorten` FROM `servertypes` t LEFT JOIN `rservermasterg` r ON t.`id`=r.`servertypeid` WHERE r.`id` IS NOT NULL AND t.`qstat`='minecraft' GROUP BY t.`shorten` ORDER BY t.`shorten`"); $query = $sql->prepare("SELECT t.`shorten` FROM `servertypes` t LEFT JOIN `rservermasterg` r ON t.`id`=r.`servertypeid` WHERE r.`id` IS NOT NULL AND t.`gameq`='minecraft' GROUP BY t.`shorten` ORDER BY t.`shorten`");
$query2 = $sql->prepare("UPDATE `servertypes` SET `steamVersion`=?,`downloadPath`=? WHERE `shorten`=?"); $query2 = $sql->prepare("UPDATE `servertypes` SET `steamVersion`=?,`downloadPath`=? WHERE `shorten`=?");
$query->execute(); $query->execute();
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -446,11 +446,10 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
} }
if ($newlayout == 'Y') $SSH2customer = $SSH2customer . '-' . $gsswitchID; if ($newlayout == 'Y') $SSH2customer = $SSH2customer . '-' . $gsswitchID;
if (isset($restart) and $user_active == 'Y') { if (isset($restart) and $user_active == 'Y') {
$query3 = $sql->prepare("SELECT s.`id`,s.`upload`,s.`map`,s.`servertemplate`,s.`mapGroup`,t.`qstat` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE t.`shorten`=? AND s.`switchID`=? LIMIT 1"); $query3 = $sql->prepare("SELECT s.`id`,s.`upload`,s.`map`,s.`servertemplate`,s.`mapGroup`,t.`gameq`,t.`gamebinary` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE t.`shorten`=? AND s.`switchID`=? LIMIT 1");
$query3->execute(array($shorten, $gsswitchID)); $query3->execute(array($shorten, $gsswitchID));
foreach ($query3->fetchAll(PDO::FETCH_ASSOC) as $row3) { foreach ($query3->fetchAll(PDO::FETCH_ASSOC) as $row3) {
$runID = $row3['id']; $runID = $row3['id'];
$qstat = $row3['qstat'];
$query3 = $sql->prepare("UPDATE `gsswitch` SET `serverid`=? WHERE `id`=? AND `resellerid`=? LIMIT 1"); $query3 = $sql->prepare("UPDATE `gsswitch` SET `serverid`=? WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query3->execute(array($runID, $gsswitchID, $resellerid)); $query3->execute(array($runID, $gsswitchID, $resellerid));
$query3 = $sql->prepare("UPDATE `serverlist` SET `anticheat`=?,`map`=?,`mapGroup`=?,`servertemplate`=? WHERE `id`=? AND `resellerid`=? LIMIT 1"); $query3 = $sql->prepare("UPDATE `serverlist` SET `anticheat`=?,`map`=?,`mapGroup`=?,`servertemplate`=? WHERE `id`=? AND `resellerid`=? LIMIT 1");
@ -479,10 +478,10 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
$tmp=gsrestart($gsswitchID,'re', $aeskey, $resellerid); $tmp=gsrestart($gsswitchID,'re', $aeskey, $resellerid);
if (is_array($tmp)) foreach($tmp as $t) $cmds[] = $t; if (is_array($tmp)) foreach($tmp as $t) $cmds[] = $t;
} }
} else if ($restart == 'N' and $qstat == 'minecraft' and $worldsafe == 'Y') { } else if ($restart == 'N' and $row3['gameq'] == 'minecraft' and $worldsafe == 'Y') {
$cmds[]="sudo -u ${SSH2customer} ./control.sh mc_ws $gsfolder"; $cmds[]="sudo -u ${SSH2customer} ./control.sh mc_ws $gsfolder";
echo "Minecraft worlsafe: $server\r\n"; echo "Minecraft worlsafe: $server\r\n";
} else if ($restart == 'N' and $qstat == 'a2s' and ($uploadtype == 2 or $uploadtype == '3') and $upload== 'Y') { } else if ($restart == 'N' and $row3['gamebinary'] == 'srcds_run' and ($uploadtype == 2 or $uploadtype == '3') and $upload== 'Y') {
$tmp=gsrestart($gsswitchID,'du', $aeskey, $resellerid); $tmp=gsrestart($gsswitchID,'du', $aeskey, $resellerid);
if (is_array($tmp)) foreach($tmp as $t) $cmds[] = $t; if (is_array($tmp)) foreach($tmp as $t) $cmds[] = $t;
} }

View File

@ -319,13 +319,12 @@ if ($ui->smallletters('w',5, 'get') == 'check') {
$query = $sql->prepare("SELECT `id` FROM `eac` WHERE `active`='Y' AND `resellerid`=? LIMIT 1"); $query = $sql->prepare("SELECT `id` FROM `eac` WHERE `active`='Y' AND `resellerid`=? LIMIT 1");
$query->execute(array($reseller_id)); $query->execute(array($reseller_id));
$count = $query->rowCount(); $count = $query->rowCount();
$query2 = $sql->prepare("SELECT `qstat` FROM `servertypes` WHERE `shorten`=? AND `resellerid`=? LIMIT 1"); $query2 = $sql->prepare("SELECT `gamebinary` FROM `servertypes` WHERE `shorten`=? AND `resellerid`=? LIMIT 1");
$query2->execute(array($get_shorten, $reseller_id)); $query2->execute(array($get_shorten, $reseller_id));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) { foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
$qstat = $row2['qstat']; if ($row['gamebinary'] == 'srcds_run' or $row['gamebinary'] == 'hlds_run') {
if ($qstat=="a2s" or $qstat=="hla2s") {
$anticheatsoft="Valve Anti Cheat"; $anticheatsoft="Valve Anti Cheat";
} else if ($qstat=="cods") { } else if ($row2['gamebinary'] == 'cod4_lnxded') {
$anticheatsoft="Punkbuster"; $anticheatsoft="Punkbuster";
} else { } else {
$anticheatsoft = ''; $anticheatsoft = '';

View File

@ -165,11 +165,11 @@ class masterServer {
// if an ID is given collect only data for this ID, else collect all game data for this rootserver // if an ID is given collect only data for this ID, else collect all game data for this rootserver
if ($all === true) { if ($all === true) {
$query = $sql->prepare("SELECT t.`id` AS `servertype_id`,t.`shorten`,t.`qstat`,t.`steamgame`,t.`appID`,t.`steamVersion`,t.`updates`,t.`downloadPath`,t.`gamebinary`,r.`localVersion`,s.`updates` AS `supdates` FROM `rservermasterg` r INNER JOIN `servertypes` t ON r.`servertypeid`=t.`id` INNER JOIN `rserverdata` s ON r.`serverid`=s.`id` WHERE r.`serverid`=? ${extraSQL}"); $query = $sql->prepare("SELECT t.`id` AS `servertype_id`,t.`shorten`,t.`steamgame`,t.`appID`,t.`steamVersion`,t.`updates`,t.`downloadPath`,t.`gamebinary`,r.`localVersion`,s.`updates` AS `supdates` FROM `rservermasterg` r INNER JOIN `servertypes` t ON r.`servertypeid`=t.`id` INNER JOIN `rserverdata` s ON r.`serverid`=s.`id` WHERE r.`serverid`=? ${extraSQL}");
$query->execute(array($this->rootID)); $query->execute(array($this->rootID));
} else { } else {
$query = $sql->prepare("SELECT t.`id` AS `servertype_id`,t.`shorten`,t.`qstat`,t.`steamgame`,t.`appID`,t.`steamVersion`,t.`updates`,t.`downloadPath`,t.`gamebinary`,r.`localVersion`,s.`updates` AS `supdates` FROM `rservermasterg` r INNER JOIN `servertypes` t ON r.`servertypeid`=t.`id` INNER JOIN `rserverdata` s ON r.`serverid`=s.`id` WHERE r.`serverid`=? AND r.`servertypeid`=? ${extraSQL} LIMIT 1"); $query = $sql->prepare("SELECT t.`id` AS `servertype_id`,t.`shorten`,t.`steamgame`,t.`appID`,t.`steamVersion`,t.`updates`,t.`downloadPath`,t.`gamebinary`,r.`localVersion`,s.`updates` AS `supdates` FROM `rservermasterg` r INNER JOIN `servertypes` t ON r.`servertypeid`=t.`id` INNER JOIN `rserverdata` s ON r.`serverid`=s.`id` WHERE r.`serverid`=? AND r.`servertypeid`=? ${extraSQL} LIMIT 1");
$query->execute(array($this->rootID, $all)); $query->execute(array($this->rootID, $all));
} }

View File

@ -641,14 +641,13 @@ if (!function_exists('passwordgenerate')) {
$tempCmds = array(); $tempCmds = array();
$stopped = 'Y'; $stopped = 'Y';
$query = $sql->prepare("SELECT g.*,g.`id` AS `switchID`,AES_DECRYPT(g.`ppassword`,:aeskey) AS `decryptedppass`,AES_DECRYPT(g.`ftppassword`,:aeskey) AS `decryptedftppass`,s.*,AES_DECRYPT(s.`uploaddir`,:aeskey) AS `decypteduploaddir`,AES_DECRYPT(s.`webapiAuthkey`,:aeskey) AS `dwebapiAuthkey`,g.`pallowed`,t.`modfolder`,t.`gamebinary`,t.`binarydir`,t.`shorten`,t.`qstat`,t.`appID` FROM `gsswitch` g INNER JOIN `serverlist` s ON g.`serverid`=s.`id` INNER JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE g.`active`='Y' AND g.`id`=:serverid AND g.`resellerid`=:reseller_id AND t.`resellerid`=:reseller_id LIMIT 1"); $query = $sql->prepare("SELECT g.*,g.`id` AS `switchID`,AES_DECRYPT(g.`ppassword`,:aeskey) AS `decryptedppass`,AES_DECRYPT(g.`ftppassword`,:aeskey) AS `decryptedftppass`,s.*,AES_DECRYPT(s.`uploaddir`,:aeskey) AS `decypteduploaddir`,AES_DECRYPT(s.`webapiAuthkey`,:aeskey) AS `dwebapiAuthkey`,g.`pallowed`,t.`modfolder`,t.`gamebinary`,t.`binarydir`,t.`shorten`,t.`appID` FROM `gsswitch` g INNER JOIN `serverlist` s ON g.`serverid`=s.`id` INNER JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE g.`active`='Y' AND g.`id`=:serverid AND g.`resellerid`=:reseller_id AND t.`resellerid`=:reseller_id LIMIT 1");
$query->execute(array(':aeskey' => $aeskey, ':serverid' => $switchID, ':reseller_id' => $reseller_id)); $query->execute(array(':aeskey' => $aeskey, ':serverid' => $switchID, ':reseller_id' => $reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$serverid = $row['serverid']; $serverid = $row['serverid'];
$anticheat = $row['anticheat']; $anticheat = $row['anticheat'];
$servertemplate = $row['servertemplate']; $servertemplate = $row['servertemplate'];
$protected = $row['protected']; $protected = $row['protected'];
$qstat = $row['qstat'];
$upload = $row['upload']; $upload = $row['upload'];
$uploaddir = $row['decypteduploaddir']; $uploaddir = $row['decypteduploaddir'];
$shorten = $row['shorten']; $shorten = $row['shorten'];
@ -659,8 +658,8 @@ if (!function_exists('passwordgenerate')) {
$port3 = $row['port3']; $port3 = $row['port3'];
$port4 = $row['port4']; $port4 = $row['port4'];
$port5 = $row['port5']; $port5 = $row['port5'];
$minram = ($row['minram']>0) ? $row['minram'] : 512; $minram = ($row['minram'] > 0) ? $row['minram'] : 512;
$maxram = ($row['maxram']>0) ? $row['maxram'] : 1024; $maxram = ($row['maxram'] > 0) ? $row['maxram'] : 1024;
$gamebinary = $row['gamebinary']; $gamebinary = $row['gamebinary'];
$binarydir = $row['binarydir']; $binarydir = $row['binarydir'];
$eacallowed = $row['eacallowed']; $eacallowed = $row['eacallowed'];
@ -677,12 +676,14 @@ if (!function_exists('passwordgenerate')) {
$modcmd = $row['modcmd']; $modcmd = $row['modcmd'];
$pallowed = $row['pallowed']; $pallowed = $row['pallowed'];
$user_id = $row['userid']; $user_id = $row['userid'];
$query = $sql->prepare("SELECT `cname` FROM `userdata` WHERE `id`=? LIMIT 1"); $query = $sql->prepare("SELECT `cname` FROM `userdata` WHERE `id`=? LIMIT 1");
$query->execute(array($user_id)); $query->execute(array($user_id));
$customer = $query->fetchColumn(); $customer = $query->fetchColumn();
if ($row['newlayout'] == 'Y') { if ($row['newlayout'] == 'Y') {
$customer .= '-' . $row['switchID']; $customer .= '-' . $row['switchID'];
} }
$cores = ($row['taskset'] == 'Y') ? $row['cores'] : ''; $cores = ($row['taskset'] == 'Y') ? $row['cores'] : '';
$maxcores = count(preg_split("/\,/", $cores, -1,PREG_SPLIT_NO_EMPTY)); $maxcores = count(preg_split("/\,/", $cores, -1,PREG_SPLIT_NO_EMPTY));
if ($maxcores == 0) { if ($maxcores == 0) {
@ -700,13 +701,14 @@ if (!function_exists('passwordgenerate')) {
} }
$bindir = $absolutepath. '/' . $binarydir; $bindir = $absolutepath. '/' . $binarydir;
$cvarprotect = array(); $cvarprotect = array();
if ($qstat == 'hla2s' and $tvenable == 'Y') { if ($gamebinary == 'hlds_run' and $tvenable == 'Y') {
$slots++; $slots++;
} }
$modsCmds = array(); $modsCmds = array();
$cvars=array('%binary%', '%tic%', '%ip%', '%port%', '%tvport%', '%port2%', '%port3%', '%port4%', '%port5%', '%slots%', '%map%', '%mapgroup%', '%fps%', '%minram%', '%maxram%', '%maxcores%', '%folder%', '%user%', '%absolutepath%'); $cvars = array('%binary%', '%tic%', '%ip%', '%port%', '%tvport%', '%port2%', '%port3%', '%port4%', '%port5%', '%slots%', '%map%', '%mapgroup%', '%fps%', '%minram%', '%maxram%', '%maxcores%', '%folder%', '%user%', '%absolutepath%');
$query2 = $sql->prepare("SELECT `cmd`,`modcmds`,`configedit` FROM `servertypes` WHERE `shorten`=? AND `resellerid`=? LIMIT 1"); $query2 = $sql->prepare("SELECT `cmd`,`modcmds`,`configedit` FROM `servertypes` WHERE `shorten`=? AND `resellerid`=? LIMIT 1");
$query2->execute(array($shorten, $reseller_id)); $query2->execute(array($shorten, $reseller_id));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) { foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
foreach (explode("\r\n", $row2['configedit']) as $line) { foreach (explode("\r\n", $row2['configedit']) as $line) {
@ -765,10 +767,10 @@ if (!function_exists('passwordgenerate')) {
$cmd = $row2['cmd']; $cmd = $row2['cmd'];
} }
} }
if ($qstat == 'a2s' and $tvenable == 'N') { if ($gamebinary == 'srcds_run' and $tvenable == 'N') {
$cmd .= ' -nohltv -tvdisable'; $cmd .= ' -nohltv -tvdisable';
} }
if (($protected == 'N' and ($qstat == 'a2s' or $qstat == 'hla2s') and ($anticheat == 2 or $anticheat == 3 or $anticheat == 4 or $anticheat == 5 or $anticheat == 6)) or (($protected == 'Y' and ($anticheat == 3 or $anticheat == 4 or $anticheat == 5 or $anticheat == 6)) and ($qstat == 'a2s' or $qstat == 'hla2s') and $eacallowed == 'Y')) { if (($protected == 'N' and ($gamebinary == 'hlds_run' or $gamebinary == 'srcds_run') and ($anticheat == 2 or $anticheat == 3 or $anticheat == 4 or $anticheat == 5 or $anticheat == 6)) or (($protected == 'Y' and ($anticheat == 3 or $anticheat == 4 or $anticheat == 5 or $anticheat == 6)) and ($gamebinary == 'srcds_run' or $gamebinary == 'hlds_run') and $eacallowed == 'Y')) {
$cmd .= ' -insecure'; $cmd .= ' -insecure';
} }
@ -805,9 +807,9 @@ if (!function_exists('passwordgenerate')) {
if ($row2['decyptedftpuploadpath'] != null and $row2['decyptedftpuploadpath'] != '' and $row2['decyptedftpuploadpath'] != 'ftp://username:password@1.1.1.1/demos') { if ($row2['decyptedftpuploadpath'] != null and $row2['decyptedftpuploadpath'] != '' and $row2['decyptedftpuploadpath'] != 'ftp://username:password@1.1.1.1/demos') {
$ftpupload = $row2['decyptedftpuploadpath']; $ftpupload = $row2['decyptedftpuploadpath'];
} }
if ($qstat == 'a2s') { if ($gamebinary == 'srcds_run') {
$cmd .= ' +rcon_password ' .$row2['rcon'] . ' +sv_password ' . $row2['password']. ' +tv_enable 1 +tv_autorecord 1'; $cmd .= ' +rcon_password ' .$row2['rcon'] . ' +sv_password ' . $row2['password']. ' +tv_enable 1 +tv_autorecord 1';
} else if ($qstat == 'hla2s') { } else if ($gamebinary == 'hlds_run') {
$cmd .= ' +rcon_password ' . $row2['rcon'] . ' +sv_password ' . $row2['password']; $cmd .= ' +rcon_password ' . $row2['rcon'] . ' +sv_password ' . $row2['password'];
} }
} }
@ -819,7 +821,7 @@ if (!function_exists('passwordgenerate')) {
} }
if (in_array($row['appID'], array(730,740)) and isid($row['workshopCollection'], 10) and wpreg_check($row['dwebapiAuthkey'], 32) and strlen($row['dwebapiAuthkey'])>0 and $row['workshopCollection']>0) { if (in_array($row['appID'], array(730,740)) and isid($row['workshopCollection'], 10) and wpreg_check($row['dwebapiAuthkey'], 32) and strlen($row['dwebapiAuthkey'])>0 and $row['workshopCollection']>0) {
$cmd .= ' +host_workshop_collection ' . $row['workshopCollection'] . ' +workshop_start_map ' . $map . ' -authkey ' . $row['dwebapiAuthkey']; $cmd .= ' +host_workshop_collection ' . $row['workshopCollection'] . ' +workshop_start_map ' . $map . ' -authkey ' . $row['dwebapiAuthkey'];
$cmd = preg_replace('/[\s\s+]{1,}\+map[\s\s+]{1,}[\w-_!%]{1,}/','', $cmd); $cmd = preg_replace('/[\s\s+]{1,}\+map[\s\s+]{1,}[\w-_!%]{1,}/', '', $cmd);
} }
$rdata = serverdata('root', $rootid, $aeskey); $rdata = serverdata('root', $rootid, $aeskey);
$sship = $rdata['ip']; $sship = $rdata['ip'];
@ -840,7 +842,7 @@ if (!function_exists('passwordgenerate')) {
$customerProtected = $customer . '-p'; $customerProtected = $customer . '-p';
} }
if ($action!='du' and $eacallowed == 'Y' and ($anticheat == 3 or $anticheat == 4 or $anticheat == 5 or $anticheat == 6) and ($qstat == 'a2s' or $qstat == 'hla2s')) { if ($action!='du' and $eacallowed == 'Y' and ($anticheat == 3 or $anticheat == 4 or $anticheat == 5 or $anticheat == 6) and ($gamebinary == 'srcds_run' or $gamebinary == 'hlds_run')) {
if ($action == 'so' or $action == 'sp') { if ($action == 'so' or $action == 'sp') {
$rcon = ''; $rcon = '';
@ -905,7 +907,7 @@ if (!function_exists('passwordgenerate')) {
} }
} }
} else if ($action!='du' and $eacallowed == 'Y' and ($qstat == 'a2s' or $qstat == 'hla2s') and ($anticheat == 1 or $anticheat == 2)) { } else if ($action!='du' and $eacallowed == 'Y' and ($gamebinary == 'srcds_run' or $gamebinary == 'hlds_run') and ($anticheat == 1 or $anticheat == 2)) {
$rcon = ''; $rcon = '';
eacchange('remove', $serverid, $rcon, $reseller_id); eacchange('remove', $serverid, $rcon, $reseller_id);
} }
@ -916,8 +918,8 @@ if (!function_exists('passwordgenerate')) {
$stopped = 'Y'; $stopped = 'Y';
if ($action == 'so') { if ($action == 'so') {
$tempCmds[]="sudo -u ${customer} ./control.sh gstop $customer \"$serverfolder\" $qstat $protectedString"; $tempCmds[]="sudo -u ${customer} ./control.sh gstop $customer \"$serverfolder\" $gamebinary $protectedString";
if ((isset($ftpupload) and $qstat == 'a2s')) { if ((isset($ftpupload) and $gamebinary == 'srcds_run')) {
$tempCmds[]="sudo -u ${customer} ./control.sh demoupload \"$bindir\" \"$ftpupload\" \"$modfolder\""; $tempCmds[]="sudo -u ${customer} ./control.sh demoupload \"$bindir\" \"$ftpupload\" \"$modfolder\"";
} }
} else { } else {
@ -931,10 +933,10 @@ if (!function_exists('passwordgenerate')) {
if ($protected == 'N' and count($installedaddons)>0) { if ($protected == 'N' and count($installedaddons)>0) {
$tempCmds[] = "sudo -u ${customer} ./control.sh addonmatch $customer \"$serverfolder\" \"".implode(' ', $installedaddons)."\""; $tempCmds[] = "sudo -u ${customer} ./control.sh addonmatch $customer \"$serverfolder\" \"".implode(' ', $installedaddons)."\"";
} }
$restartCmd = "sudo -u ${customer} ./control.sh grestart $customer \"$serverfolder\" \"$startline\" $protectedString $qstat \"$cores\""; $restartCmd = "sudo -u ${customer} ./control.sh grestart $customer \"$serverfolder\" \"$startline\" $protectedString $gamebinary \"$cores\"";
} }
if (!isset($ftpupload) and $qstat == 'a2s' and isurl($uploaddir)) { if (!isset($ftpupload) and $gamebinary == 'srcds_run' and isurl($uploaddir)) {
if ($upload==2) { if ($upload==2) {
$uploadcmd = "./control.sh demoupload \"$bindir\" \"$uploaddir\" \"$modfolder\" manual remove"; $uploadcmd = "./control.sh demoupload \"$bindir\" \"$uploaddir\" \"$modfolder\" manual remove";

View File

@ -180,13 +180,13 @@ if ($ui->st('d', 'get') == 'ad' and is_numeric($licenceDetails['lG']) and $licen
} else { } else {
$installing = true; $installing = true;
} }
$qstat = $row['qstat'];
if ($qstat == 'a2s') { if ($row['gamebinary'] == 'srcds_run') {
$upload = 1; $upload = 1;
} else { } else {
$upload = 0; $upload = 0;
} }
$table[] = array('description' => $row['description'], 'id' => $row['id'], 'steamgame' => $row['steamgame'], 'shorten' => $shorten,'gamebinary' => $row['gamebinary'], 'binarydir' => $row['binarydir'], 'modfolder' => $row['modfolder'], 'fps' => $row['fps'], 'slots' => $row['slots'], 'map' => $row['map'], 'mapGroup' => $row['mapGroup'], 'cmd' => $cmd,'tic' => $row['tic'], 'upload' => $upload,'qstat' => $qstat,'installing' => $installing); $table[] = array('description' => $row['description'], 'id' => $row['id'], 'steamgame' => $row['steamgame'], 'shorten' => $shorten,'gamebinary' => $row['gamebinary'], 'binarydir' => $row['binarydir'], 'modfolder' => $row['modfolder'], 'fps' => $row['fps'], 'slots' => $row['slots'], 'map' => $row['map'], 'mapGroup' => $row['mapGroup'], 'cmd' => $cmd,'tic' => $row['tic'], 'upload' => $upload,'installing' => $installing);
$i++; $i++;
} }
if ($query->rowcount()==0) { if ($query->rowcount()==0) {
@ -662,7 +662,7 @@ if ($ui->st('d', 'get') == 'ad' and is_numeric($licenceDetails['lG']) and $licen
foreach (preg_split('/\,/', $row['cores'],-1,PREG_SPLIT_NO_EMPTY) as $uc) { foreach (preg_split('/\,/', $row['cores'],-1,PREG_SPLIT_NO_EMPTY) as $uc) {
$usedcores[] = $uc; $usedcores[] = $uc;
} }
$query2 = $sql->prepare("SELECT s.*,AES_DECRYPT(s.`uploaddir`,?) AS `decypteduploaddir`,t.`shorten`,t.`description`,t.`qstat`,t.`gamebinary`,t.`binarydir`,t.`modfolder` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=?"); $query2 = $sql->prepare("SELECT s.*,AES_DECRYPT(s.`uploaddir`,?) AS `decypteduploaddir`,t.`shorten`,t.`description`,t.`gamebinary`,t.`gamebinary`,t.`binarydir`,t.`modfolder` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=?");
$query2->execute(array($aeskey,$server_id,$reseller_id)); $query2->execute(array($aeskey,$server_id,$reseller_id));
$i = 0; $i = 0;
$gamestringtemp = ''; $gamestringtemp = '';
@ -674,8 +674,7 @@ if ($ui->st('d', 'get') == 'ad' and is_numeric($licenceDetails['lG']) and $licen
} else { } else {
$style="style=\"display: none; border-spacing: 0px;\""; $style="style=\"display: none; border-spacing: 0px;\"";
} }
$qstat = $row2['qstat']; if ($row2['gamebinary'] == 'srcds_run') {
if ($qstat == 'a2s') {
if ($row2['upload']>0) { if ($row2['upload']>0) {
$upload = $row2['upload']; $upload = $row2['upload'];
} else { } else {
@ -688,7 +687,7 @@ if ($ui->st('d', 'get') == 'ad' and is_numeric($licenceDetails['lG']) and $licen
} }
$gamestringtemp .= "_$shorten"; $gamestringtemp .= "_$shorten";
$cmd=stripslashes($row2['cmd']); $cmd=stripslashes($row2['cmd']);
$table[] = array('id' => $row2['id'], 'shorten' => $row2['shorten'], 'description' => $row2['description'], 'gamebinary' => $row2['gamebinary'], 'binarydir' => $row2['binarydir'], 'modfolder' => $row2['modfolder'], 'fps' => $row2['fps'], 'map' => $row2['map'], 'mapGroup' => $row2['mapGroup'], 'cmd' => $cmd,'tic' => $row2['tic'], 'qstat' => $qstat,'upload' => $upload,'uploaddir' => $uploaddir,'userfps' => $row2['userfps'], 'usertick' => $row2['usertick'], 'usermap' => $row2['usermap'], 'user_uploaddir' => $row2['user_uploaddir'], 'owncmd' => $row2['owncmd'], 'style' => $style); $table[] = array('id' => $row2['id'], 'shorten' => $row2['shorten'], 'description' => $row2['description'], 'gamebinary' => $row2['gamebinary'], 'binarydir' => $row2['binarydir'], 'modfolder' => $row2['modfolder'], 'fps' => $row2['fps'], 'map' => $row2['map'], 'mapGroup' => $row2['mapGroup'], 'cmd' => $cmd,'tic' => $row2['tic'],'upload' => $upload,'uploaddir' => $uploaddir,'userfps' => $row2['userfps'], 'usertick' => $row2['usertick'], 'usermap' => $row2['usermap'], 'user_uploaddir' => $row2['user_uploaddir'], 'owncmd' => $row2['owncmd'], 'style' => $style);
$i++; $i++;
} }
$gamestring = $i.$gamestringtemp; $gamestring = $i.$gamestringtemp;

View File

@ -384,9 +384,9 @@ if ($ui->pregw('g','14', 'get')) {
if ($ui->pregw('m','20', 'get')) { if ($ui->pregw('m','20', 'get')) {
$list_gtype = $ui->pregw('m','20', 'get'); $list_gtype = $ui->pregw('m','20', 'get');
if ($where != '') { if ($where != '') {
$where .=" AND (s.`shorten`='$list_gtype' OR s.`qstat`='$list_gtype')"; $where .=" AND s.`shorten`='$list_gtype'";
} else if ($list_gtype!="all") { } else if ($list_gtype!="all") {
$where="WHERE (s.`shorten`='$list_gtype' OR s.`qstat`='$list_gtype')"; $where="WHERE s.`shorten`='$list_gtype'";
} }
} else { } else {
$list_gtype = ''; $list_gtype = '';

View File

@ -36,19 +36,20 @@
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>. * Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
*/ */
if ((!isset($user_id) or $main != 1) or (isset($user_id) and !$pa['restart']) or !$ui->id('id',19, 'get')) { if ((!isset($user_id) or $main != 1) or (isset($user_id) and !$pa['restart']) or !$ui->id('id', 10, 'get')) {
redirect('userpanel.php'); redirect('userpanel.php');
} }
$server_id = (int) $ui->id('id',19, 'get'); $id = (int) $ui->id('id', 10, 'get');
$sprache = getlanguagefile('gserver', $user_language, $reseller_id); $sprache = getlanguagefile('gserver', $user_language, $reseller_id);
$pallowed = 'N';
if (isset($admin_id) and $reseller_id != 0 and $admin_id != $reseller_id) { if (isset($admin_id) and $reseller_id != 0 and $admin_id != $reseller_id) {
$reseller_id = $admin_id; $reseller_id = $admin_id;
} }
if (!isset($_SESSION['sID']) or in_array($ui->id('id',19, 'get'), $substituteAccess['gs'])) { if (!isset($_SESSION['sID']) or in_array($id, $substituteAccess['gs'])) {
$query = $sql->prepare("SELECT g.`serverip`,g.`port`,g.`protected`,s.`anticheat`,g.`pallowed`,g.`eacallowed`,s.`map`,s.`mapGroup`,t.`shorten`,t.`mapGroup` AS `defaultMapGroup` FROM `gsswitch` g LEFT JOIN `serverlist` s ON g.`serverid`=s.`id` LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1"); $query = $sql->prepare("SELECT g.`serverip`,g.`port`,g.`protected`,s.`anticheat`,g.`pallowed`,g.`eacallowed`,s.`map`,s.`mapGroup`,t.`shorten`,t.`mapGroup` AS `defaultMapGroup` FROM `gsswitch` g LEFT JOIN `serverlist` s ON g.`serverid`=s.`id` LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
$query->execute(array($ui->id('id',19, 'get'), $user_id, $reseller_id)); $query->execute(array($id, $user_id, $reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$serverip = $row['serverip']; $serverip = $row['serverip'];
$port = $row['port']; $port = $row['port'];
@ -71,9 +72,11 @@ if (!isset($rowcount) or $rowcount == 0) {
} }
if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset($port)) { if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset($port)) {
$date2 = $ui->gamestring('date', 'post'); $date2 = $ui->gamestring('date', 'post');
$date = explode('_', $date2); $date = explode('_', $date2);
$qstat_array = array(); $gameqArray = array();
$binaryArray = array();
if ($date[0] == 'mon') { if ($date[0] == 'mon') {
$day = $sprache->monday; $day = $sprache->monday;
@ -105,18 +108,19 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
$hlds_6 = $row['hlds_6']; $hlds_6 = $row['hlds_6'];
} }
$query = $sql->prepare("SELECT s.`upload`,t.`shorten`,t.`description`,t.`qstat`,t.`mapGroup`,t.`protected`,t.`qstat` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=? GROUP BY t.`shorten`"); $query = $sql->prepare("SELECT s.`upload`,t.`shorten`,t.`description`,t.`gameq`,t.`gamebinary`,t.`mapGroup`,t.`protected` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=? GROUP BY t.`shorten`");
$query->execute(array($ui->id('id',19, 'get'), $reseller_id)); $query->execute(array($id, $reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$shorten = $row['shorten']; $shorten = $row['shorten'];
$uploadallowed[] = $row['upload']; $uploadallowed[] = $row['upload'];
$qstat_array[$shorten] = $row['qstat']; $gameqArray[$shorten] = $row['gameq'];
$binaryArray[$shorten] = $row['gamebinary'];
if (!isset($qstat)) { if (!isset($gameq)) {
$qstat = $row['qstat']; $gameq = $row['gameq'];
} }
$table[$row['shorten']] = array('shorten' => $shorten,'description' => $row['description'], 'defaultMapGroup' => $row['mapGroup'], 'protected' => $row['protected'], 'qstat' => $row['qstat']); $table[$row['shorten']] = array('shorten' => $shorten,'description' => $row['description'], 'defaultMapGroup' => $row['mapGroup'], 'protected' => $row['protected'], 'gameq' => $row['gameq'], 'gamebinary' => $row['gamebinary']);
} }
$template = ''; $template = '';
@ -127,29 +131,33 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
$backup = ''; $backup = '';
$worldsafe = 'N'; $worldsafe = 'N';
$upload = ''; $upload = '';
$binary = '';
$query = $sql->prepare("SELECT * FROM `gserver_restarts` WHERE `restarttime`=? AND `switchID`=? AND `resellerid`=? LIMIT 1"); $query = $sql->prepare("SELECT * FROM `gserver_restarts` WHERE `restarttime`=? AND `switchID`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($date2, $ui->id('id',19, 'get'), $reseller_id)); $query->execute(array($date2, $id, $reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$template = $row['template']; $template = $row['template'];
$anticheat = $row['anticheat']; $anticheat = $row['anticheat'];
$gsswitch = $row['gsswitch']; $gsswitch = $row['gsswitch'];
$defaultMapGroup = $table[$row['gsswitch']]['defaultMapGroup']; $defaultMapGroup = $table[$row['gsswitch']]['defaultMapGroup'];
if ($defaultMapGroup != null) $mapGroup = $row['mapGroup'];
$map = $row['map']; $map = $row['map'];
$pro = $row['protected']; $pro = $row['protected'];
$restart = $row['restart']; $restart = $row['restart'];
$backup = $row['backup']; $backup = $row['backup'];
$worldsafe = $row['worldsafe']; $worldsafe = $row['worldsafe'];
$qstat = $qstat_array[$gsswitch]; $binary = $binaryArray[$gsswitch];
if (in_array('a2s', $qstat_array) and (in_array(2, $uploadallowed) or in_array(3, $uploadallowed))) {
if ($defaultMapGroup != null) {
$mapGroup = $row['mapGroup'];
}
if (in_array('srcds_run', $binaryArray) and (in_array(2, $uploadallowed) or in_array(3, $uploadallowed))) {
$upload = $row['upload']; $upload = $row['upload'];
} }
} }
if ($restart == 'Y'){
$style='style="width:690px;"'; $style = ($restart == 'Y') ? 'style="width:690px;"' : 'style="display:none;border-spacing:0px;"';
} else {
$style='style="display:none;border-spacing:0px;"';
}
if (!isset($eac) and $eacallowed== 'Y' and $rowcount>0 and ($gsswitch == 'css' or $gsswitch == 'cod4' or $gsswitch == 'cstrike' or $gsswitch == 'czero' or $gsswitch == 'tf')) { if (!isset($eac) and $eacallowed== 'Y' and $rowcount>0 and ($gsswitch == 'css' or $gsswitch == 'cod4' or $gsswitch == 'cstrike' or $gsswitch == 'czero' or $gsswitch == 'tf')) {
if ($gsswitch == 'cstrike' or $gsswitch == 'czero') { if ($gsswitch == 'cstrike' or $gsswitch == 'czero') {
@ -192,9 +200,9 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
$eac = array(); $eac = array();
} }
if ($qstat == 'a2s' or $qstat == 'hla2s') { if ($binary == 'srcds_run' or $binary == 'hlds_run') {
$anticheatsoft = 'Valve Anti Cheat'; $anticheatsoft = 'Valve Anti Cheat';
} else if ($qstat == 'cods') { } else if ($binary == 'cod4_lnxded') {
$anticheatsoft = 'Punkbuster'; $anticheatsoft = 'Punkbuster';
} else { } else {
$anticheatsoft = ''; $anticheatsoft = '';
@ -204,13 +212,13 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
} else if ($ui->smallletters('edit2',4, 'post') == 'edit' and $ui->gamestring('date', 'post') and $ui->id('template',1, 'post') and $ui->id('anticheat',1, 'post') and $ui->gamestring('shorten', 'post') and $ui->active('backup', 'post') and $ui->active('restart', 'post') and isset($serverip) and isset($port)) { } else if ($ui->smallletters('edit2',4, 'post') == 'edit' and $ui->gamestring('date', 'post') and $ui->id('template',1, 'post') and $ui->id('anticheat',1, 'post') and $ui->gamestring('shorten', 'post') and $ui->active('backup', 'post') and $ui->active('restart', 'post') and isset($serverip) and isset($port)) {
$qstat_array = array(); $gameqArray = array();
$date = $ui->gamestring('date', 'post'); $date = $ui->gamestring('date', 'post');
$template = $ui->id('template',1, 'post'); $template = $ui->id('template',1, 'post');
$anticheat = $ui->id('anticheat',1, 'post'); $anticheat = $ui->id('anticheat',1, 'post');
$gsswitch = $ui->gamestring('shorten', 'post'); $gsswitch = $ui->gamestring('shorten', 'post');
$query = $sql->prepare("SELECT t.`protected`,t.`qstat` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE t.`shorten`=? AND s.`resellerid`=?"); $query = $sql->prepare("SELECT t.`protected`,t.`gameq` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE t.`shorten`=? AND s.`resellerid`=?");
$query->execute(array($gsswitch, $reseller_id)); $query->execute(array($gsswitch, $reseller_id));
$serverlist = $query->fetch(PDO::FETCH_ASSOC); $serverlist = $query->fetch(PDO::FETCH_ASSOC);
$query->closeCursor(); $query->closeCursor();
@ -228,12 +236,8 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
} }
$worldsafe = ($ui->active('worldsafe', 'post')) ? $ui->active('worldsafe', 'post') : 'N'; $worldsafe = ($ui->active('worldsafe', 'post')) ? $ui->active('worldsafe', 'post') : 'N';
if ($ui->active('worldsafe', 'post') and in_array('a2s', $qstat_array) and ($uploadallowed == 2 or $uploadallowed == 3)) {
$worldsafe = $ui->post['worldsafe']; if ($anticheat > 2) {
} else {
$worldsafe = 'N';
}
if ($anticheat>2) {
if ($gsswitch == 'cstrike' or $gsswitch == 'czero') { if ($gsswitch == 'cstrike' or $gsswitch == 'czero') {
if ($anticheat==3 and $hlds_3== 'N' and $hlds_5 == 'Y') { if ($anticheat==3 and $hlds_3== 'N' and $hlds_5 == 'Y') {
$anticheat = 5; $anticheat = 5;
@ -266,11 +270,12 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
} }
$restart = $ui->active('restart', 'post'); $restart = $ui->active('restart', 'post');
$backup = $ui->active('backup', 'post'); $backup = $ui->active('backup', 'post');
if($ui->mapname('map', 'post') && $serverlist['qstat']!='minecraft') {
if($ui->mapname('map', 'post') && $serverlist['gameq'] != 'minecraft') {
$map = $ui->mapname('map', 'post'); $map = $ui->mapname('map', 'post');
} }
else { else {
$map = ""; $map = '';
} }
if ($ui->active('protected', 'post') && $serverlist['protected']=='Y') { if ($ui->active('protected', 'post') && $serverlist['protected']=='Y') {
@ -284,40 +289,43 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
$stvupload = 'N'; $stvupload = 'N';
} }
$query = $sql->prepare("SELECT `id` FROM `gserver_restarts` WHERE `restarttime`=? AND `switchID`=? AND `resellerid`=? LIMIT 1"); $query = $sql->prepare("SELECT `id` FROM `gserver_restarts` WHERE `restarttime`=? AND `switchID`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($date, $ui->id('id',19, 'get'), $reseller_id)); $query->execute(array($date, $id, $reseller_id));
$rowcount = $query->rowCount(); $rowcount = $query->rowCount();
if ($rowcount==0) { if ($rowcount==0) {
$pupdate = $sql->prepare("INSERT INTO `gserver_restarts` (`template`,`anticheat`,`protected`,`restarttime`,`gsswitch`,`map`,`mapGroup`,`restart`,`backup`,`worldsafe`,`upload`,`switchID`,`userid`,`resellerid`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $pupdate = $sql->prepare("INSERT INTO `gserver_restarts` (`template`,`anticheat`,`protected`,`restarttime`,`gsswitch`,`map`,`mapGroup`,`restart`,`backup`,`worldsafe`,`upload`,`switchID`,`userid`,`resellerid`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
$pupdate->execute(array($template, $anticheat, $protected, $date, $gsswitch, $map, $ui->mapname('mapGroup', 'post'), $restart, $backup, $worldsafe, $stvupload, $ui->id('id',19, 'get'), $user_id, $reseller_id)); $pupdate->execute(array($template, $anticheat, $protected, $date, $gsswitch, $map, $ui->mapname('mapGroup', 'post'), $restart, $backup, $worldsafe, $stvupload, $id, $user_id, $reseller_id));
} else { } else {
$pupdate = $sql->prepare("UPDATE `gserver_restarts` SET `template`=?,`anticheat`=?,`protected`=?,`gsswitch`=?,`map`=?,`mapGroup`=?,`restart`=?,`backup`=?,`worldsafe`=?,`upload`=? WHERE `restarttime`=? AND `switchID`=? AND `userid`=? AND `resellerid`=? LIMIT 1"); $pupdate = $sql->prepare("UPDATE `gserver_restarts` SET `template`=?,`anticheat`=?,`protected`=?,`gsswitch`=?,`map`=?,`mapGroup`=?,`restart`=?,`backup`=?,`worldsafe`=?,`upload`=? WHERE `restarttime`=? AND `switchID`=? AND `userid`=? AND `resellerid`=? LIMIT 1");
$pupdate->execute(array($template, $anticheat, $protected, $gsswitch, $map, $ui->mapname('mapGroup', 'post'), $restart, $backup, $worldsafe, $stvupload, $date, $ui->id('id',19, 'get'), $user_id, $reseller_id)); $pupdate->execute(array($template, $anticheat, $protected, $gsswitch, $map, $ui->mapname('mapGroup', 'post'), $restart, $backup, $worldsafe, $stvupload, $date, $id, $user_id, $reseller_id));
} }
$template_file = $spracheResponse->table_add; $template_file = $spracheResponse->table_add;
} else if ($ui->smallletters('delete',6, 'post') == 'delete' and $ui->gamestring('date', 'post') and isset($serverip) and isset($port)) { } else if ($ui->smallletters('delete',6, 'post') == 'delete' and $ui->gamestring('date', 'post') and isset($serverip) and isset($port)) {
$date = $ui->gamestring('date', 'post'); $date = $ui->gamestring('date', 'post');
$pdelete = $sql->prepare("DELETE FROM `gserver_restarts` WHERE `restarttime`=? AND `switchID`=? AND `resellerid`=? LIMIT 1"); $pdelete = $sql->prepare("DELETE FROM `gserver_restarts` WHERE `restarttime`=? AND `switchID`=? AND `resellerid`=? LIMIT 1");
$pdelete->execute(array($date, $ui->id('id',19, 'get'), $reseller_id)); $pdelete->execute(array($date, $id, $reseller_id));
$template_file = $spracheResponse->table_del;; $template_file = $spracheResponse->table_del;;
} else if (isset($serverip) and isset($port)){ } else if (isset($serverip) and isset($port)){
$backup = 'N';
$i = 0; $i = 0;
while ($i<24) { $gameqArray = array();
while ($i < 24) {
$restarts[$i] = array('mon' => '','tue' => '','wed' => '','thu' => '','fri' => '','sat' => '','sun' => ''); $restarts[$i] = array('mon' => '','tue' => '','wed' => '','thu' => '','fri' => '','sat' => '','sun' => '');
$i++; $i++;
} }
$query = $sql->prepare("SELECT t.`shorten`,t.`qstat` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=? GROUP BY t.`shorten`");
$query->execute(array($ui->id('id',19, 'get'), $reseller_id)); $query = $sql->prepare("SELECT t.`shorten`,t.`gameq`,t.`gamebinary` FROM `serverlist` s LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=? GROUP BY t.`shorten`");
$query->execute(array($id, $reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$shorten = $row['shorten']; $shorten = $row['shorten'];
$qstat_array[$shorten] = $row['qstat']; $gameqArray[$shorten] = array('gameq' => $row['gameq'], 'gamebinary' => $row['gamebinary']);
} }
$backup = 'N';
$query = $sql->prepare("SELECT `template`,`restarttime`,`gsswitch`,`anticheat`,`protected`,`map`,`restart`,`backup`,`worldsafe`,`upload` FROM `gserver_restarts` WHERE `switchID`=? AND `resellerid`=?"); $query = $sql->prepare("SELECT `template`,`restarttime`,`gsswitch`,`anticheat`,`protected`,`map`,`restart`,`backup`,`worldsafe`,`upload` FROM `gserver_restarts` WHERE `switchID`=? AND `resellerid`=?");
$query->execute(array($ui->id('id',19, 'get'), $reseller_id)); $query->execute(array($id, $reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$restarttime=explode("_", $row['restarttime']);
$day = $restarttime[0];
$hour = $restarttime[1];
$shorten = $row['gsswitch']; $shorten = $row['gsswitch'];
$template = $row['template']; $template = $row['template'];
$restart = $row['restart']; $restart = $row['restart'];
@ -325,30 +333,34 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
$worldsafe = $row['worldsafe']; $worldsafe = $row['worldsafe'];
$upload = $row['upload']; $upload = $row['upload'];
$protected = $row['protected']; $protected = $row['protected'];
if (isset($qstat_array[$shorten])) { $anticheat = $row['anticheat'];
$qstat = $qstat_array[$shorten];
} else { $gamebinary = (isset($gameqArray[$shorten])) ? $gameqArray[$shorten]['gamebinary'] : '';
$qstat = '';
} $restarttime = explode('_', $row['restarttime']);
if (isset($qstat) and $qstat == 'a2s' or $qstat == 'hla2s') { $day = $restarttime[0];
$anticheatsoft="VAC"; $hour = $restarttime[1];
} else if (isset($qstat) and $qstat == 'cods') {
$anticheatsoft="PBuster"; if ($gamebinary == 'srcds_run' or $gamebinary == 'hlds_run') {
$anticheatsoft = 'VAC';
} else if ($gamebinary == 'cod4_lnxded') {
$anticheatsoft = 'PBuster';
} else { } else {
$anticheatsoft = ''; $anticheatsoft = '';
} }
$anticheat = $row['anticheat'];
if ($anticheat==1) { if ($anticheat == 1) {
$restarts[$hour][$day]['anti'] = $anticheatsoft . ' ' . $sprache->on; $restarts[$hour][$day]['anti'] = $anticheatsoft . ' ' . $sprache->on;
} else if ($anticheat==2) { } else if ($anticheat == 2) {
$restarts[$hour][$day]['anti'] = $anticheatsoft . ' ' . $sprache->off2; $restarts[$hour][$day]['anti'] = $anticheatsoft . ' ' . $sprache->off2;
} else if ($anticheat==3 or $anticheat==4 or $anticheat==5 or $anticheat==6) { } else if ($anticheat == 3 or $anticheat == 4 or $anticheat == 5 or $anticheat == 6) {
$restarts[$hour][$day]['anti'] = 'EAC'; $restarts[$hour][$day]['anti'] = 'EAC';
} }
if ($template==1) {
if ($template == 1) {
$template = ''; $template = '';
} else { } else {
$template='-' . $template; $template = '-' . $template;
} }
if ($backup == 'Y') { if ($backup == 'Y') {
@ -356,14 +368,16 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
} else { } else {
$restarts[$hour][$day]['backup'] = $gsprache->no; $restarts[$hour][$day]['backup'] = $gsprache->no;
} }
if ($qstat == 'minecraft' and $restart == 'N' and $worldsafe == 'Y') {
if ($gameqArray[$shorten]['gameq'] == 'minecraft' and $restart == 'N' and $worldsafe == 'Y') {
$restarts[$hour][$day]['worldsave'] = $gsprache->yes; $restarts[$hour][$day]['worldsave'] = $gsprache->yes;
} else if ($qstat == 'minecraft' and $restart == 'N') { } else if ($gameqArray[$shorten]['gameq'] == 'minecraft' and $restart == 'N') {
$restarts[$hour][$day]['worldsave'] = $gsprache->no; $restarts[$hour][$day]['worldsave'] = $gsprache->no;
} }
if ($qstat == 'a2s' and $restart == 'N' and $upload== 'Y') {
if ($gamebinary == 'srcds_run' and $restart == 'N' and $upload== 'Y') {
$restarts[$hour][$day]['sourcetvdemo'] = $gsprache->yes; $restarts[$hour][$day]['sourcetvdemo'] = $gsprache->yes;
} else if ($qstat == 'a2s' and $restart == 'N') { } else if ($gamebinary == 'srcds_run' and $restart == 'N') {
$restarts[$hour][$day]['sourcetvdemo'] = $gsprache->no; $restarts[$hour][$day]['sourcetvdemo'] = $gsprache->no;
} }
@ -371,24 +385,27 @@ if ($ui->smallletters('edit',4, 'post') == 'edit' and isset($serverip) and isset
$restarts[$hour][$day]['restart'] = $gsprache->yes; $restarts[$hour][$day]['restart'] = $gsprache->yes;
$restarts[$hour][$day]['template'] = $shorten.$template; $restarts[$hour][$day]['template'] = $shorten.$template;
$restarts[$hour][$day]['map'] = $row['map']; $restarts[$hour][$day]['map'] = $row['map'];
if ($pallowed== 'Y') {
if ($pallowed == 'Y') {
if ($protected=='N') { if ($protected=='N') {
$restarts[$hour][$day]['protected'] = $gsprache->no; $restarts[$hour][$day]['protected'] = $gsprache->no;
} else if ($protected=='Y') { } else if ($protected=='Y') {
$restarts[$hour][$day]['protected'] = $gsprache->yes; $restarts[$hour][$day]['protected'] = $gsprache->yes;
} }
} }
else { else {
$restarts[$hour][$day]['protected'] = ""; $restarts[$hour][$day]['protected'] = '';
} }
} }
else { else {
$restarts[$hour][$day]['restart'] = $gsprache->no; $restarts[$hour][$day]['restart'] = $gsprache->no;
$restarts[$hour][$day]['template'] = ""; $restarts[$hour][$day]['template'] = '';
$restarts[$hour][$day]['map'] = ""; $restarts[$hour][$day]['map'] = '';
$restarts[$hour][$day]['protected'] = ""; $restarts[$hour][$day]['protected'] = '';
} }
} }
$template_file = 'userpanel_gserver_calendar_list.tpl'; $template_file = 'userpanel_gserver_calendar_list.tpl';
} }

View File

@ -114,8 +114,8 @@
<label class="control-label" for="inputPmode"><?php echo $sprache->protect;?></label> <label class="control-label" for="inputPmode"><?php echo $sprache->protect;?></label>
<div class="controls"> <div class="controls">
<select id="inputPmode" name="pallowed"> <select id="inputPmode" name="pallowed">
<option value="Y"><?php echo $gsprache->yes;?></option>
<option value="N"><?php echo $gsprache->no;?></option> <option value="N"><?php echo $gsprache->no;?></option>
<option value="Y"><?php echo $gsprache->yes;?></option>
</select> </select>
</div> </div>
</div> </div>

View File

@ -15,7 +15,7 @@
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <div class="span12">
<form id="newRestart" action="userpanel.php?w=ca&amp;id=<?php echo $server_id;?>" method="post" class="form-inline"> <form id="newRestart" action="userpanel.php?w=ca&amp;id=<?php echo $id;?>" method="post" class="form-inline">
<input type="hidden" id="date" name="date" value=""/> <input type="hidden" id="date" name="date" value=""/>
<input type="hidden" id="edit" name="edit" value="edit" /> <input type="hidden" id="edit" name="edit" value="edit" />
<select id="day" name="day"> <select id="day" name="day">
@ -92,14 +92,14 @@ $(document).ready(function (){
<?php echo $restarts[$i][$day]['protected']; ?> <?php echo $restarts[$i][$day]['protected']; ?>
</td> </td>
<td class="span1"> <td class="span1">
<form action="userpanel.php?w=ca&amp;id=<?php echo $server_id;?>&amp;r=gs" method="post" onsubmit="return confirm('<?php echo $gsprache->sure;?>');"> <form action="userpanel.php?w=ca&amp;id=<?php echo $id;?>&amp;r=gs" method="post" onsubmit="return confirm('<?php echo $gsprache->sure;?>');">
<input type="hidden" name="date" value="mon_<?php echo $i;?>"/> <input type="hidden" name="date" value="mon_<?php echo $i;?>"/>
<input type="hidden" name="delete" value="delete" /> <input type="hidden" name="delete" value="delete" />
<button class="btn btn-danger btn-mini"><i class="icon-trash icon-white"></i> <?php echo $gsprache->del;?></button> <button class="btn btn-danger btn-mini"><i class="icon-trash icon-white"></i> <?php echo $gsprache->del;?></button>
</form> </form>
</td> </td>
<td class="span1"> <td class="span1">
<form action="userpanel.php?w=ca&amp;id=<?php echo $server_id;?>" method="post"> <form action="userpanel.php?w=ca&amp;id=<?php echo $id;?>" method="post">
<input type="hidden" name="date" value="mon_<?php echo $i;?>"/> <input type="hidden" name="date" value="mon_<?php echo $i;?>"/>
<input type="hidden" name="edit" value="edit" /> <input type="hidden" name="edit" value="edit" />
<button class="btn btn-primary btn-mini"><i class="icon-edit icon-white"></i> <?php echo $gsprache->mod;?></button> <button class="btn btn-primary btn-mini"><i class="icon-edit icon-white"></i> <?php echo $gsprache->mod;?></button>

View File

@ -15,7 +15,7 @@
<hr> <hr>
<div class="row-fluid"> <div class="row-fluid">
<div class="span8"> <div class="span8">
<form class="form-horizontal" action="userpanel.php?w=ca&amp;id=<?php echo $server_id;?>&amp;r=gs" onsubmit="return confirm('<?php echo $gsprache->sure;?>');" method="post"> <form class="form-horizontal" action="userpanel.php?w=ca&amp;id=<?php echo $id;?>&amp;r=gs" onsubmit="return confirm('<?php echo $gsprache->sure;?>');" method="post">
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function (){ $(document).ready(function (){
$('#inputSwitch').change(function() { $('#inputSwitch').change(function() {
@ -29,7 +29,7 @@
else { else {
$('#protectedSettings').collapse('hide'); $('#protectedSettings').collapse('hide');
} }
if($(this).find('option:selected').data('qstat')=='minecraft') { if($(this).find('option:selected').data('gameq')=='minecraft') {
console.log('minecraft'); console.log('minecraft');
$('#worldsaveSettings').collapse('show'); $('#worldsaveSettings').collapse('show');
$('#mapSettings').collapse('hide'); $('#mapSettings').collapse('hide');
@ -70,7 +70,7 @@
</div> </div>
</div> </div>
</div> </div>
<?php if(in_array('a2s',$qstat_array) and (in_array('2',$uploadallowed) or in_array('3',$uploadallowed))){ ?> <?php if(in_array('srcds_run',$binaryArray) and (in_array(2,$uploadallowed) or in_array(3,$uploadallowed))){ ?>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="inputSourceTV">SourceTV Demo Upload</label> <label class="control-label" for="inputSourceTV">SourceTV Demo Upload</label>
<div class="controls"> <div class="controls">
@ -96,7 +96,7 @@
<div class="controls"> <div class="controls">
<select name="shorten" id="inputSwitch" onchange="$.get('serverallocation.php?mapgroup=' + this.value, function(data) { $('#mapGroup').html(data); });"> <select name="shorten" id="inputSwitch" onchange="$.get('serverallocation.php?mapgroup=' + this.value, function(data) { $('#mapGroup').html(data); });">
<?php foreach ($table as $table_row){ ?> <?php foreach ($table as $table_row){ ?>
<option value="<?php echo $table_row['shorten'];?>" <?php if($gsswitch==$table_row['shorten']) echo 'selected="selected"';?> data-protected="<?php echo $table_row['protected'];?>" data-qstat="<?php echo $table_row['qstat'];?>"><?php echo $table_row['description'];?></option> <option value="<?php echo $table_row['shorten'];?>" <?php if($gsswitch==$table_row['shorten']) echo 'selected="selected"';?> data-protected="<?php echo $table_row['protected'];?>" data-gameq="<?php echo $table_row['gameq'];?>"><?php echo $table_row['description'];?></option>
<?php } ?> <?php } ?>
</select> </select>
</div> </div>

View File

@ -21,7 +21,7 @@
<td> <td>
<strong><?php echo $config['line'];?></strong> <strong><?php echo $config['line'];?></strong>
</td> </td>
<td class="span1"> <td class="span3">
<?php if($config['permission']=="easy" or $config['permission']=="both") { ?> <?php if($config['permission']=="easy" or $config['permission']=="both") { ?>
<a href="userpanel.php?w=gs&amp;d=cf&amp;id=<?php echo $id;?>&amp;type=easy&amp;config=<?php echo urlencode($config['line']);?>"><span class="btn btn-primary btn-mini"><i class="icon-edit icon-white"></i> <?php echo $sprache->easy;?></span></a> <a href="userpanel.php?w=gs&amp;d=cf&amp;id=<?php echo $id;?>&amp;type=easy&amp;config=<?php echo urlencode($config['line']);?>"><span class="btn btn-primary btn-mini"><i class="icon-edit icon-white"></i> <?php echo $sprache->easy;?></span></a>
<?php } ?> <?php } ?>