#345 Add garrysmod

This commit is contained in:
Ulrich Block 2014-03-01 09:46:52 +01:00
parent 998904e63f
commit d3fd43fe2a
5 changed files with 97 additions and 48 deletions

View File

@ -378,17 +378,23 @@ echo ' HideFiles (^\..+|\.ssh|\.bash_history|\.bash_logout|\.bashrc|\.profile)$
AllowAll
</Limit>
</Directory>
<Directory ~/server/*/*/czero/*>
Umask 077 077
<Limit RNFR RNTO STOR DELE MKD RMD>
AllowAll
</Limit>
</Directory>
<Directory ~/server/*/*/dod/*>
Umask 077 077
<Limit RNFR RNTO STOR DELE MKD RMD>
AllowAll
</Limit>
</Directory>
<Directory ~/server/*/*/czero/*>
Umask 077 077
<Limit RNFR RNTO STOR DELE MKD RMD>
AllowAll
</Limit>
<Directory ~/server/*/*/garrysmod/*>
Umask 077 077
<Limit RNFR RNTO STOR DELE>
AllowAll
</Limit>
</Directory>
<Directory ~/*/*/>
HideFiles (^\..+|srcds_run|srcds_linux|hlds_run|hlds_amd|hlds_i686|\.rc|\.sh|\.zip|\.rar|\.7z|\.dll)$
@ -437,13 +443,13 @@ echo ' HideFiles (^\..+|\.ssh|\.bash_history|\.bash_logout|\.bashrc|\.profile)$
AllowAll
</Limit>
</Directory>
<Directory ~/*/*/dod/*>
<Directory ~/*/*/czero/*>
Umask 077 077
<Limit RNFR RNTO STOR DELE>
AllowAll
</Limit>
</Directory>
<Directory ~/*/*/czero/*>
<Directory ~/*/*/dod/*>
Umask 077 077
<Limit RNFR RNTO STOR DELE>
AllowAll

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -77,7 +77,7 @@ $gameAddons = array(
':rmcmd' => null,
':depends' => '',
':supported' => array(
'ageofchivalry','css','csgo','dods','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
'ageofchivalry','css','csgo','dods','gmod','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
)
),
array(
@ -91,7 +91,7 @@ $gameAddons = array(
':rmcmd' => null,
':depends' => 'metamod',
':supported' => array(
'ageofchivalry','css','csgo','dods','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
'ageofchivalry','css','csgo','dods','gmod','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
)
),
array(
@ -133,7 +133,7 @@ $gameAddons = array(
':rmcmd' => null,
':depends' => 'sourcemod',
':supported' => array(
'ageofchivalry','css','csgo','dods','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
'ageofchivalry','css','csgo','dods','gmod','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
)
),
array(
@ -147,7 +147,7 @@ $gameAddons = array(
':rmcmd' => null,
':depends' => 'sourcemod',
':supported' => array(
'ageofchivalry','css','csgo','dods','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
'ageofchivalry','css','csgo','dods','gmod','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
)
),
array(
@ -161,7 +161,7 @@ $gameAddons = array(
':rmcmd' => null,
':depends' => 'sourcemod',
':supported' => array(
'ageofchivalry','css','csgo','dods','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
'ageofchivalry','css','csgo','dods','gmod','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
)
),
array(
@ -175,7 +175,7 @@ $gameAddons = array(
':rmcmd' => null,
':depends' => 'smac',
':supported' => array(
'ageofchivalry','css','csgo','dods','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
'ageofchivalry','css','csgo','dods','gmod','hl2mp','insurgency','left4dead','left4dead2','pvkii','tf','zps'
)
),
array(

View File

@ -95,13 +95,15 @@ if (!function_exists('gsrestart')) {
$query = $sql->prepare("SELECT `cname` FROM `userdata` WHERE `id`=? LIMIT 1");
$query->execute(array($user_id));
$customer = $query->fetchColumn();
if ($row['newlayout'] == 'Y') {
$customer .= '-' . $row['switchID'];
}
$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) {
$maxcores = 1;
}
@ -115,11 +117,14 @@ if (!function_exists('gsrestart')) {
$pserver = 'server/';
$absolutepath = '/home/' . $customer . '/server/' . $gsip . '_' . $port . '/' . $folder;
}
$bindir = $absolutepath. '/' . $binarydir;
$cvarprotect = array();
if ($gamebinary == 'hlds_run' and $tvenable == 'Y') {
$slots++;
}
$modsCmds = array();
$cvars = array('%binary%', '%tickrate%', '%tic%', '%ip%', '%port%', '%tvport%', '%port2%', '%port3%', '%port4%', '%port5%', '%slots%', '%map%', '%mapgroup%', '%fps%', '%minram%', '%maxram%', '%maxcores%', '%folder%', '%user%', '%absolutepath%');
@ -131,6 +136,7 @@ if (!function_exists('gsrestart')) {
foreach (explode("\r\n", $row2['configedit']) as $line) {
if (preg_match('/^(\[[\w\/\.\-\_]{1,}\]|\[[\w\/\.\-\_]{1,}\] (xml|ini|cfg|lua|json))$/', $line)) {
$ex = preg_split("/\s+/", $line, -1,PREG_SPLIT_NO_EMPTY);
$cvartype = (isset($ex[1])) ? $ex[1] : 'cfg';
$config = substr($ex[0], 1, strlen($ex[0]) - 2);
@ -261,8 +267,12 @@ if (!function_exists('gsrestart')) {
}
if ($row['workShop'] == 'Y' AND $row['tWorkShop'] == 'Y' and isid($row['workshopCollection'], 10) and wpreg_check($row['dwebapiAuthkey'], 32) and strlen($row['dwebapiAuthkey']) > 0 and $row['workshopCollection'] > 0) {
$cmd .= ' -nodefaultmap +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);
if ($shorten == 'gmod' or $shorten == 'garrysmod') {
$cmd .= ' -nodefaultmap +host_workshop_collection ' . $row['workshopCollection'] . ' -authkey ' . $row['dwebapiAuthkey'];
} else {
$cmd .= ' -nodefaultmap +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);
}
}
$rdata = serverdata('root', $rootid, $aeskey);

View File

@ -69,7 +69,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -102,7 +102,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -135,7 +135,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -168,7 +168,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -201,7 +201,40 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'main/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
':steamgame' => 'S',
':appID' => 4020,
':updates' => 1,
':shorten' => 'gmod',
':description' => 'Garrysmod',
':gamebinary' => 'srcds_run',
':binarydir' => '',
':modfolder' => 'garrysmod',
':fps' => null,
':slots' => 0,
':map' => 'gm_flatgrass',
':cmd' => './%binary% -game garrysmod -ip %ip% -port %port% -hostport %port% +maxplayers %slots% +map %map% +tv_port %tvport% +tv_maxclients 1 +clientport %port3%',
':modcmds' => "[Sandbox = default]\r\n+gamemode sandbox\r\n\r\n[Terrortown]\r\n+gamemode terrortown\r\n\r\n[Murder]\r\n+gamemode murder\r\n\r\n[Dark RP]\r\n+gamemode darkrp",
':tic' => null,
':gameq' => 'gmod',
':gamemod' => 'N',
':gamemod2' => null,
':configs' => "cfg/server.cfg both\r\nmaplist.txt full\r\nmapcycle.txt full\r\ncfg/mount.cfg full\r\ncfg/banned_user.cfg full\r\ncfg/skill.cfg full",
':configedit' => null,
':portStep' => 10,
':portMax' => 3,
':portOne' => 27015,
':portTwo' => 27016,
':portThree' => 27017,
':portFour' => null,
':portFive' => null,
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => '',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -234,7 +267,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => '',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -267,7 +300,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => '',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -300,7 +333,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -333,7 +366,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -366,7 +399,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -399,7 +432,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -432,7 +465,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -465,7 +498,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -498,7 +531,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -531,7 +564,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -564,7 +597,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -597,7 +630,7 @@ $gameImages = array(
':mapGroup' => 'mg_demolition',
':protected' => 'Y',
':protectedSaveCFGs' => 'cfg/server.cfg',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -630,7 +663,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'Y',
':ramLimited' => 'Y',
':os' => 'L'
),
array(
@ -663,7 +696,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'Y',
':ramLimited' => 'Y',
':os' => 'L'
),
array(
@ -696,7 +729,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'Y',
':ramLimited' => 'Y',
':os' => 'L'
),
array(
@ -729,7 +762,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'Y',
':ramLimited' => 'Y',
':os' => 'L'
),
array(
@ -762,7 +795,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -795,7 +828,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -828,7 +861,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => '',
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -861,7 +894,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -894,7 +927,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -927,7 +960,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -960,7 +993,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -993,7 +1026,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -1026,7 +1059,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -1059,7 +1092,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
),
array(
@ -1092,7 +1125,7 @@ $gameImages = array(
':mapGroup' => null,
':protected' => 'N',
':protectedSaveCFGs' => null,
'ramLimited' => 'N',
':ramLimited' => 'N',
':os' => 'L'
)
);