Skip to content

Commit

Permalink
feat: use official keys from steamcmd
Browse files Browse the repository at this point in the history
  • Loading branch information
ArwynFr committed Dec 6, 2023
1 parent c3006e1 commit 0123e84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
20 changes: 1 addition & 19 deletions src/ArmaServer-InstallBohemiaKeys.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
}
2 changes: 2 additions & 0 deletions src/Install-ArmaServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ End {
Stop-ArmaServer -ConfigFilename $ConfigFilename
New-Item $Config.MasterPath -ItemType Directory -Force | Out-Null
New-Item $Config.WorkshopPath -ItemType Directory -Force | Out-Null
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
Expand Down

0 comments on commit 0123e84

Please sign in to comment.