diff --git a/src/.configs/lfa.psd1 b/src/.configs/lfa.psd1 index 4f720c0..d70b200 100644 --- a/src/.configs/lfa.psd1 +++ b/src/.configs/lfa.psd1 @@ -3,58 +3,31 @@ ServerAffinity = 5 HeadlessAffinity = 10 - Hostname = '[FR] NE-VOYENNI | LFA | www.gsri.team' - Password = 'vyborg' + Hostname = '[FR] | www.gsri.team' + Password = '' Players = 32 VerifySignatures = $false - Update = $true - Headless = $true + Headless = $false DisableChannels = @() + Beta = 'creatordlc' Admins = @( 76561197967609383 # Arwyn ) Mods = @( - 583496184 - 450814997 - 843425103 - 843577117 - 1779063631 - 463939057 - 2822052002 - 843632231 - 843593391 - 894678801 - 2018593688 - 2699465073 - 333310405 - 623475643 - 1923321700 - 2178398365 - 2162043396 - 1926513010 - 2034767030 - 773131200 - 773125288 - 2753746058 - 2899715306 - 905191399 - 2841411653 - 2145354279 ) ClientMods = @( ) ServerMods = @( ) - Mission = @{ - Type = 'Local' - Path = 'C:\Arma3\instances\lfa\mission' - } - WorkshopPath = 'C:\Arma3' MasterPath = 'C:\Arma3\instances\lfa\master' ConfigPath = 'C:\Arma3\instances\lfa\config' ProfilePath = 'C:\Arma3\instances\lfa\profile' + + Missions = @( + 'C:\Arma3\instances\lfa\mission' + ) } \ No newline at end of file diff --git a/src/ArmaServer-InstallBohemiaKeys.ps1 b/src/ArmaServer-InstallBohemiaKeys.ps1 index 30a5873..ae96d0a 100644 --- a/src/ArmaServer-InstallBohemiaKeys.ps1 +++ b/src/ArmaServer-InstallBohemiaKeys.ps1 @@ -15,19 +15,9 @@ param ( [Parameter()] [string] - $WorkshopPattern = '^[0-9]+$', - - [Parameter()] - [uri] - $OfficialKeysUri = 'https://arma.gsri.team/legacy/keys.zip' + $WorkshopPattern = '^[0-9]+$' ) -Begin { - Write-Verbose "Removing old keys from $DestinationPath" - New-Item $DestinationPath -ItemType Directory -Force | Out-Null - Get-ChildItem -Recurse -Filter *.bikey $DestinationPath | Remove-Item -Force -} - Process { $AddonPath = switch ($true) { ($AddonName -match $WorkshopPattern) { @@ -43,11 +33,3 @@ Process { Write-Verbose "Copy addon keys from $AddonPath" Get-ChildItem $AddonPath -Recurse -Filter '*.bikey' | Copy-Item -Destination $DestinationPath } - -End { - $KeysZip = New-TemporaryFile - Write-Verbose "Download official BI keys from $OfficialKeysUri" - Invoke-WebRequest -Uri $OfficialKeysUri -OutFile $KeysZip - Expand-Archive -Path $KeysZip -DestinationPath $DestinationPath - Remove-Item -Force $KeysZip -} diff --git a/src/ArmaServer-InstallConfig.ps1 b/src/ArmaServer-InstallConfig.ps1 index e51011b..dbc1f36 100644 --- a/src/ArmaServer-InstallConfig.ps1 +++ b/src/ArmaServer-InstallConfig.ps1 @@ -10,6 +10,11 @@ $Config = Import-PowerShellDataFile $ConfigFilename $TemplatePath = Join-Path $MyInvocation.MyCommand.Module.ModuleBase .templates $BasicFilePath = Join-Path $Config.ConfigPath basic.cfg $ServerFilePath = Join-Path $Config.ConfigPath server.cfg +$MissionsPath = Join-Path $Config.MasterPath mpmissions +if($null -eq $Config.DefaultMission) { + $Config.DefaultMission = (Get-ChildItem $MissionsPath -Filter *.pbo | Select-Object -First 1).BaseName + Write-Verbose "Default mission not set, detected: $($Config.DefaultMission)" +} # Initiliaze configuration Write-Verbose "Removing old configurations from $($Config.ConfigPath)" diff --git a/src/ArmaServer-InvokeDownload.ps1 b/src/ArmaServer-InvokeDownload.ps1 index d9d49a3..8a2bf5e 100644 --- a/src/ArmaServer-InvokeDownload.ps1 +++ b/src/ArmaServer-InvokeDownload.ps1 @@ -24,7 +24,11 @@ param ( [Parameter()] [string] - $WorkshopPattern = '^[0-9]+$' + $WorkshopPattern = '^[0-9]+$', + + [Parameter()] + [string] + $Beta ) Begin { @@ -45,7 +49,7 @@ End { } If ($PSCmdlet.ShouldProcess("$CommandsFilename", 'steamcmd runscript')) { - 'app_update 233780 validate' | ArmaServer-InvokeSteamCmd -Path $MasterPath -Quit -Username $Username + "app_update 233780 -beta ${Beta} validate" | ArmaServer-InvokeSteamCmd -Path $MasterPath -Quit -Username $Username Get-Content -Raw $CommandsFilename | ArmaServer-InvokeSteamCmd -Path $WorkshopPath -Quit:$Quit -Username $Username } diff --git a/src/Install-ArmaServer.ps1 b/src/Install-ArmaServer.ps1 index c3aa79a..05e5ab9 100644 --- a/src/Install-ArmaServer.ps1 +++ b/src/Install-ArmaServer.ps1 @@ -17,7 +17,9 @@ End { Stop-ArmaServer -ConfigFilename $ConfigFilename New-Item $Config.MasterPath -ItemType Directory -Force | Out-Null New-Item $Config.WorkshopPath -ItemType Directory -Force | Out-Null - $Addons | ArmaServer-InvokeDownload -MasterPath $Config.MasterPath -WorkshopPath $Config.WorkshopPath -Quit + New-Item $KeysPath -ItemType Directory -Force | Out-Null + Get-ChildItem -Recurse -Filter *.bikey $KeysPath | Remove-Item -Force + $Addons | ArmaServer-InvokeDownload -MasterPath $Config.MasterPath -WorkshopPath $Config.WorkshopPath -Beta $Config.Beta -Quit $Addons | ArmaServer-InstallBohemiaKeys -DestinationPath $KeysPath -WorkshopPath $Config.WorkshopPath $Config.Missions | ArmaServer-InstallMission -DestinationPath $MissionsPath ArmaServer-InstallConfig -ConfigFilename $ConfigFilename diff --git a/src/Start-ArmaServer.ps1 b/src/Start-ArmaServer.ps1 index 1cfe8f1..5098ce4 100644 --- a/src/Start-ArmaServer.ps1 +++ b/src/Start-ArmaServer.ps1 @@ -6,21 +6,9 @@ param ( $ConfigFilename ) -Begin { - $Config = Import-PowerShellDataFile $ConfigFilename - $TranscriptPath = Join-Path $Config.ProfilePath pslogs - Start-Transcript -OutputDirectory $TranscriptPath -} - -Process { - Stop-ArmaServer -ConfigFilename $ConfigFilename - Install-ArmaServer -ConfigFilename $ConfigFilename - ArmaServer-InvokeServerProcess -ConfigFilename $ConfigFilename - if ($Config.Headless) { - ArmaServer-InvokeHeadlessProcess -ConfigFilename $ConfigFilename - } -} - -End { - Stop-Transcript +$Config = Import-PowerShellDataFile $ConfigFilename +Stop-ArmaServer -ConfigFilename $ConfigFilename +ArmaServer-InvokeServerProcess -ConfigFilename $ConfigFilename +if ($Config.Headless) { + ArmaServer-InvokeHeadlessProcess -ConfigFilename $ConfigFilename }