diff --git a/LANCommander.Server/Snippets/Examples/Sanitize Filename.ps1 b/LANCommander.Server/Snippets/Examples/Sanitize Filename.ps1 deleted file mode 100644 index 3f6371b2..00000000 --- a/LANCommander.Server/Snippets/Examples/Sanitize Filename.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -# Takes the variable $Filename, splits it by invalid characters, then joins using _ -$Filename.Split([IO.Path]::GetInvalidFileNameChars()) -join '_' \ No newline at end of file diff --git a/LANCommander.Server/Snippets/Functions/ConvertTo-StringBytes.ps1 b/LANCommander.Server/Snippets/Functions/ConvertTo-StringBytes.ps1 index 18e775b0..8e1174f5 100644 --- a/LANCommander.Server/Snippets/Functions/ConvertTo-StringBytes.ps1 +++ b/LANCommander.Server/Snippets/Functions/ConvertTo-StringBytes.ps1 @@ -1,2 +1,2 @@ # Converts a string to a UTF16-encoded byte array. This looks like ASCII characters separated by 0x00 in most cases. -$bytes = ConvertTo-StringBytes -Input "Hello World!" -Utf16 1 -MaxLength 12 \ No newline at end of file +$bytes = ConvertTo-StringBytes -Input "Hello World!" -Utf16 $true -MaxLength 12 \ No newline at end of file diff --git a/LANCommander.Server/Snippets/Functions/Edit-PatchGameSpy.ps1 b/LANCommander.Server/Snippets/Functions/Edit-PatchGameSpy.ps1 new file mode 100644 index 00000000..a314423d --- /dev/null +++ b/LANCommander.Server/Snippets/Functions/Edit-PatchGameSpy.ps1 @@ -0,0 +1,2 @@ +# Patches GameSpy master server references to OpenSpy in game binaries and config files +Edit-PatchGameSpy -Path $InstallDirectory \ No newline at end of file diff --git a/LANCommander.Server/Snippets/Functions/Get-GameManifest.ps1 b/LANCommander.Server/Snippets/Functions/Get-GameManifest.ps1 index 26de106a..2251cb48 100644 --- a/LANCommander.Server/Snippets/Functions/Get-GameManifest.ps1 +++ b/LANCommander.Server/Snippets/Functions/Get-GameManifest.ps1 @@ -1 +1 @@ -$manifest = Get-GameManifest "C:\Games\" \ No newline at end of file +$manifest = Get-GameManifest -Path $InstallDirectory -Id $GameManifest.Id \ No newline at end of file diff --git a/LANCommander.Server/Snippets/Functions/Get-RedistributableOptions.ps1 b/LANCommander.Server/Snippets/Functions/Get-RedistributableOptions.ps1 new file mode 100644 index 00000000..1e3c7f15 --- /dev/null +++ b/LANCommander.Server/Snippets/Functions/Get-RedistributableOptions.ps1 @@ -0,0 +1,2 @@ +# Returns resolved options (defaults + per-game overrides) for a redistributable +$options = Get-RedistributableOptions -Path $InstallDirectory -Id $GameManifest.Id -Name $RedistributableManifest.Name \ No newline at end of file diff --git a/LANCommander.Server/Snippets/Functions/Get-SanitizedPath.ps1 b/LANCommander.Server/Snippets/Functions/Get-SanitizedPath.ps1 new file mode 100644 index 00000000..fc2812f3 --- /dev/null +++ b/LANCommander.Server/Snippets/Functions/Get-SanitizedPath.ps1 @@ -0,0 +1 @@ +$sanitized = Get-SanitizedPath -Path $PlayerAlias \ No newline at end of file diff --git a/LANCommander.Server/Snippets/Functions/New-Package.ps1 b/LANCommander.Server/Snippets/Functions/New-Package.ps1 new file mode 100644 index 00000000..5a7b4fd9 --- /dev/null +++ b/LANCommander.Server/Snippets/Functions/New-Package.ps1 @@ -0,0 +1,2 @@ +# Creates a package result for the packaging pipeline +New-Package -Path $InstallDirectory -Version "1.0.0" \ No newline at end of file diff --git a/LANCommander.Server/Snippets/Functions/Write-GameManifest.ps1 b/LANCommander.Server/Snippets/Functions/Write-GameManifest.ps1 new file mode 100644 index 00000000..6546c1fd --- /dev/null +++ b/LANCommander.Server/Snippets/Functions/Write-GameManifest.ps1 @@ -0,0 +1 @@ +Write-GameManifest -Path $InstallDirectory -Manifest $manifest \ No newline at end of file