Skip to content

Commit

Permalink
Updated CoD4 and CS:GO processors
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoJF committed Oct 7, 2020
1 parent 12fc089 commit c24f8f6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
8 changes: 8 additions & 0 deletions app/Processors/Cod4Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ public function calculateResourceCost(array $config): array
);
}

/**
* @inheritDoc
*/
public function formToStartupConfig(array $form): ?string
{
return null;
}

public function reject(array $resourceCost): bool
{
return parent::reject($resourceCost);
Expand Down
23 changes: 12 additions & 11 deletions app/Processors/CsgoProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Processors;

use Illuminate\Validation\Rule;

class CsgoProcessor extends Processor
{
/**
Expand All @@ -25,20 +23,23 @@ public function calculateResourceCost(array $config): array
return array_merge($staticCosts, $dynamicCosts);
}


public function formToStartupConfig(array $form): string
{
$tickrate = $form['tickrate'];
$slots = $form['slots'];

$parts = [
'java',
'-Xms128M',
"--tickrate $tickrate",
'-Xmx{{SERVER_MEMORY}}M',
'-Dterminal.jline=false',
'-Dterminal.ansi=true',
'-jar',
'{{SERVER_JARFILE}}',
'./srcds_run',
'-game csgo',
'-console',
'-port {{SERVER_PORT}}',
'+ip 0.0.0.0',
'+map {{SRCDS_MAP}}',
'-strictportbind',
'-norestart',
"-tickrate $tickrate",
"-maxplayers_override $slots",
'+sv_setsteamaccount {{STEAM_ACC}}',
];

return implode(' ', $parts);
Expand Down
2 changes: 1 addition & 1 deletion config/processors.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
|--------------------------------------------------------------------------
*/

'cost_per_slot' => 30,
'cost_per_slot' => 35,

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit c24f8f6

Please sign in to comment.