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/fetch-game-validation-20261004/session.json'))
. (Join-Path $PSScriptRoot 'Game-TestHelpers.ps1') -SessionFile $SessionFile -ReportDirectory (Join-Path $PSScriptRoot '../artifacts/fetch-game-validation-20261004/engine-validation')
if ($taskTest.petId -notmatch '^[0-9a-f]{24}$' -or $taskTest.fetchId -notmatch '^[0-9a-f]{24}$') { throw 'A dedicated Fetch test session is required.' }
$taskPetSteps = $taskSuitSteps[0..4] + @(@{from=4;field='GetSentinel'},@{call=5;args=@(@{ref=4})},
    @{from=6;field='InventoryControl'},@{call=7;args=@(@{ref=6})},@{from=8;field='GetActivePowerSuit'},@{call=9;args=@(@{ref=8})})
$taskPetPresetSteps = @(@{global='gGameData'},@{from=0;field='GetInventory'},@{call=1;args=@(@{ref=0})},
    @{from=2;field='GetPresets'},@{call=3;args=@(@{ref=2},1)},@{global='rawget'},@{call=5;args=@(@{ref=4},1)},
    @{from=6;field='GetEntry'},@{call=7;args=@(@{ref=6},0)})
function Select-PetConfig([int]$Index) {
    $identity = Invoke-Engine ($taskPetPresetSteps + @(@{from=8;field='mItemId';literal=$true},@{from=9;field='mId';literal=$true}))
    if ($identity[10].text -ne $taskTest.petId) { throw 'The selected pet is not the isolated test pet.' }
    $null = Invoke-Engine ($taskPetPresetSteps + @(@{meta=8},@{from=9;field='__newindex';literal=$true},
        @{call=10;args=@(@{ref=8},'mModSlot',$Index)},@{from=6;field='SetEntry'},@{call=12;args=@(@{ref=6},0,@{ref=8})},
        @{from=2;field='SetLoadoutPreset'},@{call=14;args=@(@{ref=2},1,@{ref=6},$true)},
        @{from=0;field='ApplyLoadOutPreset'},@{call=16;args=@(@{ref=0},1,@{ref=6},$true,$false,$true)}))
    $null = Invoke-Engine @(@{global='gGameRules'},@{from=0;field='SendLobbyLoadout'},@{call=1;args=@(@{ref=0})})
    $null = Invoke-Engine ($taskSuitSteps[0..4] + @(@{global='gGameData'},@{from=5;field='GetLoadOut'},@{call=6;args=@(@{ref=5})},
        @{from=4;field='0xDF459F8E'},@{call=8;args=@(@{ref=4},@{ref=7},1,0,$true)}))
}
function Get-FetchSnapshot {
    (Invoke-Runtime '/runtime/v1/game/ability-state').fetchOverdrive
}
function Get-PlayerPosition {
    $r = Invoke-Engine @(@{global='gRegion'},@{from=0;field='GetLocalPlayerAvatar'},@{call=1;args=@(@{ref=0})},
        @{from=2;field='GetPosition'},@{call=3;args=@(@{ref=2})},@{from=4;field='x';literal=$true},@{from=4;field='y';literal=$true},@{from=4;field='z';literal=$true})
    @{x=$r[5].number;y=$r[6].number;z=$r[7].number}
}
function New-TestPickup([float]$Distance, [string]$Type='/Lotus/Types/PickUps/EnergyIncreaseLarge') {
    $p = Get-PlayerPosition
    $null = Invoke-Engine ($taskSuitSteps+@(@{from=6;field='SetEnergy'},@{call=7;args=@(@{ref=6},0)}))
    $r = Invoke-Engine @(@{global='gRegion'},@{from=0;field='CreateEntity'},@{global='Type'},@{call=2;args=@($Type)},
        @{global='Vector'},@{call=4;args=@(($p.x+$Distance),($p.y+0.5),$p.z)},@{global='Rotation'},@{call=6;args=@(0,0,0)},
        @{call=1;args=@(@{ref=0},@{ref=3},@{ref=5},@{ref=7})},@{global='_T'},@{global='rawset'},@{call=10;args=@(@{ref=9},'XFEFetchTestDrop',@{ref=8})},
        @{from=8;field='GetPosition'},@{call=12;args=@(@{ref=8})},@{from=13;field='x';literal=$true},@{from=13;field='y';literal=$true},@{from=13;field='z';literal=$true})
    if ($r[8].type -ne 9) { throw 'The real engine pickup was not created.' }
    $actual = @{x=$r[14].number;y=$r[15].number;z=$r[16].number}
    @{distance=$Distance;origin=$p;position=$actual;measuredDistance=[Math]::Sqrt([Math]::Pow($actual.x-$p.x,2)+[Math]::Pow($actual.y-$p.y,2)+[Math]::Pow($actual.z-$p.z,2));pickup=$r[8].object;type=$Type}
}
function Get-TestPickup {
    $r = Invoke-Engine ($taskSuitSteps+@(@{from=6;field='0xEF680AA6'},@{call=7;args=@(@{ref=6})},
        @{global='_T'},@{from=9;field='XFEFetchTestDrop';literal=$true},@{global='IsNull'},@{call=11;args=@(@{ref=10})}))
    @{energy=$r[8].number;removed=$r[12].hashOrBoolean -eq '0x00000001'}
}