Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .claude/commands/rtk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# RTK — Raid Toolkit SDK

Use this skill when working on the Raid Toolkit SDK source code.

## Key facts

- **Stable branch:** `release/v2.8` — build and ship from here
- **In progress:** `main` — v3.0 restructuring, not production-ready
- **Platform:** Windows only (WinUI3, Win32, IL2CPP). Cannot build on macOS/Linux.
- **Full docs:** See `CLAUDE.md` in the repo root — architecture, JSON schema, security audit, API reference

## Project layout

| Path | What it is |
|---|---|
| `src/Application/Raid.Toolkit/` | WinUI3 tray app — main entry point |
| `src/Application/Raid.Toolkit.Application.Core/` | DI host, WebSocket setup, update service |
| `src/Shared/DataModel/` | DTOs, enums, WebSocket message format, API contracts |
| `src/Shared/Model/` | IL2CPP glue — `ModelLoader.cs`, `PlariumPlayAdapter.cs` |
| `src/Extensions/Account/` | Account extraction — `AccountApi.cs`, `Extractor.cs` |
| `src/Shared/Common/GitHub/` | Auto-update logic |
| `src/Setup/` | WiX installer → `RaidToolkitSetup.exe` |

## Build (Windows only)

```
msbuild SDK.sln -t:"Build;Pack" -p:Configuration=Release -p:Platform=x64
```

## CI / Releasing

**No manual tags needed.** Version auto-calculated by Nerdbank.GitVersioning (`version.json` major.minor + commit count).

To trigger a release: push any source change to `release/**` or `main`. Doc-only commits (`*.md`) are excluded from the trigger.

To force a release with no other changes: bump `version.json`.

CI workflow: `.github/workflows/app-publish.yml`
- Builds on `windows-latest`
- Produces `RaidToolkitSetup.exe` (WiX installer) + `Raid.Toolkit.exe`
- Creates a GitHub Release automatically
- NuGet/npm/PyPI publish steps removed (no secrets configured in this fork)

### Key CI fixes in this fork (do not revert)

| What | Why |
|---|---|
| Removed `mickem/clean-after-action@v1` | Repo deleted upstream — caused "Set up job" failure |
| Replaced `iamtheyammer/branch-env-vars@v1.0.4` | Personal repo action gone — now inline PowerShell |
| All actions bumped to current versions | v1/v2 deprecated and removed by GitHub |
| Added `permissions: contents: write` | Required for release creation — missing = 403 |
| Added `fail_on_unmatched_files: false` | VSIX not always present — without this, release step errors |

## Installing the release on Windows

Prerequisites:
- Windows 10 build 19041+ or Windows 11
- .NET 6 Desktop Runtime: `winget install Microsoft.DotNet.DesktopRuntime.6`
- Windows App SDK 1.4: `winget install Microsoft.WindowsAppRuntime.1.4`
- Plarium Play + RAID installed

Steps:
1. Download `RaidToolkitSetup.exe` from [releases](https://github.com/asultan80/raid-toolkit-sdk/releases/latest)
2. Right-click → **Run as administrator**
3. SmartScreen prompt → **More info → Run anyway** (build is unsigned)
4. Launch RAID via Plarium Play, wait for lobby
5. RTK tray icon should appear

## Diagnosing launch failures — read logs first

```powershell
# RTK log
Get-ChildItem "$env:LOCALAPPDATA\RaidToolkit\Logs" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 | Get-Content | Select-Object -Last 50

# Windows crash events
Get-WinEvent -LogName Application -MaxEvents 50 | Where-Object { $_.LevelDisplayName -eq "Error" } | Select-Object -First 5 | Format-List

# Check prerequisites
Get-AppxPackage -Name "Microsoft.WindowsAppRuntime*" | Select-Object Name, Version
dotnet --list-runtimes | Select-String "Microsoft.WindowsDesktop"
Get-ItemProperty "Registry::HKEY_USERS\.DEFAULT\SOFTWARE\PlariumPlayInstaller" -ErrorAction SilentlyContinue
```

## WebSocket API (`ws://localhost:9090`)

Wire format: `[scope, channel, message]` (3-element JSON array).

Key methods on `account-api` scope:
- `getAccounts()` → account list
- `getAccountDump(accountId)` → full legacy dump (the main extraction endpoint)
- `getHeroes(accountId)` / `getArtifacts(accountId)` → richer DTOs with awaken/blessing/ascend fields

Full schema in `CLAUDE.md`.

## Known issues / open improvements

1. `Extractor.cs` does not populate `awakenRank`, `blessing`, or artifact `ascendLevel` in the legacy dump even though the DTOs have these fields
2. No `--dump-account <file>` CLI flag — requires the tray UI to export
3. Auto-update (`UpdateService.cs`) downloads and runs `RaidToolkitSetup.exe` without verifying a cryptographic signature

## Security notes

- WebSocket binds to `127.0.0.1` in this fork (fixed from upstream's `Any`/`0.0.0.0`)
- No telemetry, no credential access, no browser data access — verified in audit (see `CLAUDE.md`)
- IL2CPP assembly generation reads only local game files, no remote code loading
12 changes: 12 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"permissions": {
"allow": [
"Bash(git *)",
"Bash(dotnet *)",
"Bash(msbuild *)",
"Bash(grep *)",
"Bash(find *)",
"Read(**)"
]
}
}
53 changes: 19 additions & 34 deletions .github/workflows/app-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
jobs:
build:
runs-on: windows-latest
permissions:
contents: write

env:
IS_CI: true
Expand All @@ -29,50 +31,46 @@ jobs:
Client_csproj: src\ClientSDK\DotNet\Raid.Client.csproj

steps:
- uses: mickem/clean-after-action@v1

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Set branch-based environment variables
uses: iamtheyammer/branch-env-vars@v1.0.4
with:
PRERELEASE: |
main:true
!default:false
PRERELEASEN: |
main:1
!default:0
shell: pwsh
run: |
if ("${{ github.ref_name }}" -eq "main") {
echo "PRERELEASE=true" >> $env:GITHUB_ENV
echo "PRERELEASEN=1" >> $env:GITHUB_ENV
} else {
echo "PRERELEASE=false" >> $env:GITHUB_ENV
echo "PRERELEASEN=0" >> $env:GITHUB_ENV
}

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
5.0.x
6.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v2

# Versions
- uses: dotnet/nbgv@master
- name: Set version with nbgv
uses: dotnet/nbgv@master
id: rtk_version
with:
setAllVars: true

- uses: actions/cache@v1
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=Release

Expand All @@ -96,28 +94,15 @@ jobs:
BuildOutputDirectory: ..\Application\Raid.Toolkit\bin\x64\Release\net6.0-windows10.0.19041.0\win10-x64

- name: Create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.rtk_version.outputs.Version }}
prerelease: ${{ env.PRERELEASE }}
body_path: CHANGES.md
fail_on_unmatched_files: false
files: |
UPGRADE_2.0.md
publish/RTK/Raid.Toolkit.exe
src/Setup/out/RaidToolkitSetup.exe
src/Template/vsix/bin/release/RTKExtensionTemplate.vsix
ThirdPartyNotice.txt

# NuGet Push
- name: Push client package to Nuget registry
run: |
dotnet nuget push publish/nuget/Raid.Common.${{ steps.rtk_version.outputs.NuGetPackageVersion }}.nupkg -k $env:NUGET_PUBLISH_TOKEN -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push publish/nuget/Raid.Client.${{ steps.rtk_version.outputs.NuGetPackageVersion }}.nupkg -k $env:NUGET_PUBLISH_TOKEN -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push publish/nuget/Raid.Model.${{ steps.rtk_version.outputs.NuGetPackageVersion }}.nupkg -k $env:NUGET_PUBLISH_TOKEN -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push publish/nuget/Raid.Toolkit.DataModel.${{ steps.rtk_version.outputs.NuGetPackageVersion }}.nupkg -k $env:NUGET_PUBLISH_TOKEN -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push publish/nuget/Raid.Toolkit.Injection.${{ steps.rtk_version.outputs.NuGetPackageVersion }}.nupkg -k $env:NUGET_PUBLISH_TOKEN -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push publish/nuget/Raid.Toolkit.Extensibility.${{ steps.rtk_version.outputs.NuGetPackageVersion }}.nupkg -k $env:NUGET_PUBLISH_TOKEN -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push publish/nuget/Raid.Toolkit.Extensibility.Host.${{ steps.rtk_version.outputs.NuGetPackageVersion }}.nupkg -k $env:NUGET_PUBLISH_TOKEN -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push publish/nuget/Raid.Toolkit.Extensibility.Tasks.${{ steps.rtk_version.outputs.NuGetPackageVersion }}.nupkg -k $env:NUGET_PUBLISH_TOKEN -s https://api.nuget.org/v3/index.json --skip-duplicate
env:
NUGET_PUBLISH_TOKEN: ${{ secrets.NUGET_PUBLISH_TOKEN }}
Loading