XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEWarframe

【WinUI】基于Warframe游戏本体的公开服务器以及安装器

公开
关注 0 Fork 0 Star 0
UTF-8
#requires -Version 7.0
param(
    [string]$SessionFile = (Join-Path $PSScriptRoot '../artifacts/ability-bank-game-test/session.json'),
    [string]$ReportDirectory = (Join-Path $PSScriptRoot '../artifacts/game-branding-validation'),
    [switch]$BeforeLogin
)
. (Join-Path $PSScriptRoot 'Game-TestHelpers.ps1') -SessionFile $SessionFile -ReportDirectory $ReportDirectory
try {
    $status=Invoke-Runtime '/runtime/v1/status'
    if ($status.serverUrl -ne $taskTest.origin) { throw 'Expected the isolated test game.' }
    Wait-Engine { $branding=(Invoke-Runtime '/runtime/v1/game/ability-state').branding; $branding.serverName -and $branding.loginVisible -eq [bool]$BeforeLogin } 'native login identity visibility'
    $branding=(Invoke-Runtime '/runtime/v1/game/ability-state').branding
    $taskGame[0].Refresh()
    $title=$taskGame[0].MainWindowTitle
    $taskEvidence.checks.Add(@{kind='server-name-window-title';passed=($title -eq $branding.serverName);title=$title;serverName=$branding.serverName})
    if ($title -ne $branding.serverName) { throw 'Game window title does not match the server name.' }
    $taskEvidence.checks.Add(@{kind='native-login-identity';passed=($branding.loginVisible -eq [bool]$BeforeLogin -and -not $branding.independentOverlay);details=$branding})
    if ($branding.loginVisible -ne [bool]$BeforeLogin -or $branding.independentOverlay) { throw 'Unexpected branding visibility.' }
    if ($BeforeLogin) {
        $text=Invoke-Engine @(@{global='Type'},@{call=0;args=@('/Lotus/Interface/ThemedMainMenu.swf')},@{global='gFlashMgr'},
            @{from=2;field='FindMovie'},@{call=3;args=@(@{ref=2},@{ref=1})},@{from=4;field='GetVariable'},
            @{call=5;args=@(@{ref=4},'BuildLabel.text')},@{call=5;args=@(@{ref=4},'BuildLabel._visible')})
        $passed=$text[6].text -like ('*'+$branding.serverName+'*') -and $text[6].text -like '*XFEWarframe*' -and $text[7].text -eq 'true'
        $taskEvidence.checks.Add(@{kind='actual-login-BuildLabel';passed=$passed;text=$text[6];visible=$text[7]})
        if (-not $passed) { throw 'The native login movie does not display the expected identity.' }
    }
    $taskEvidence.passed=$true
    Write-Host "Passed: server-name title, native login UI and visibility (BeforeLogin=$BeforeLogin)."
} finally {
    $taskEvidence.finished=[DateTimeOffset]::UtcNow.ToString('o')
    $taskEvidence | ConvertTo-Json -Depth 20 | Set-Content -LiteralPath (Join-Path $ReportDirectory 'result.json') -Encoding utf8
    $taskHttp.Dispose()
}