RSNetAuditRunner.h
Click a line number to link it. Shift-click to select a range.
| 1 | // Copyright (c) 2026 Reignance Studios. MIT License, see LICENSE. |
| 2 | |
| 3 | #pragma once |
| 4 | |
| 5 | #include "CoreMinimal.h" |
| 6 | |
| 7 | enum class ERSAuditSeverity : uint8 |
| 8 | { |
| 9 | Info, |
| 10 | Warning, |
| 11 | Error |
| 12 | }; |
| 13 | |
| 14 | /** One problem found by one check. */ |
| 15 | struct RSNETAUDIT_API FRSAuditFinding |
| 16 | { |
| 17 | /** Stable id, e.g. GA-03. Listed in the README. */ |
| 18 | FString CheckId; |
| 19 | ERSAuditSeverity Severity = ERSAuditSeverity::Info; |
| 20 | /** Class or asset path the finding is about. */ |
| 21 | FString Subject; |
| 22 | FString Message; |
| 23 | FString Fix; |
| 24 | /** Tutorial slug on reignancestudios.com that explains the fix. */ |
| 25 | FString Tutorial; |
| 26 | }; |
| 27 | |
| 28 | struct RSNETAUDIT_API FRSAuditOptions |
| 29 | { |
| 30 | /** Also scan engine and marketplace classes. Off by default: you cannot fix those. */ |
| 31 | bool bIncludeEngineClasses = false; |
| 32 | /** PlayerStates that hold an ASC below this rate get a warning. Lyra uses 100. */ |
| 33 | float MinPlayerStateNetUpdateFrequency = 30.f; |
| 34 | /** Empty = <Project>/Saved/RSNetAudit. */ |
| 35 | FString OutputDir; |
| 36 | }; |
| 37 | |
| 38 | struct RSNETAUDIT_API FRSAuditResult |
| 39 | { |
| 40 | TArray<FRSAuditFinding> Findings; |
| 41 | |
| 42 | int32 AbilitiesScanned = 0; |
| 43 | int32 AbilityBlueprintsScanned = 0; |
| 44 | int32 PlayerStatesScanned = 0; |
| 45 | int32 AttributeSetsScanned = 0; |
| 46 | |
| 47 | FString MarkdownPath; |
| 48 | FString HtmlPath; |
| 49 | |
| 50 | int32 Count(ERSAuditSeverity Severity) const; |
| 51 | }; |
| 52 | |
| 53 | /** |
| 54 | * Runs every check and writes the report. Editor only: it loads Blueprint |
| 55 | * classes and reads their graphs. Safe to run from the commandlet, the |
| 56 | * Tools menu or the RSNetAudit.Run console command. |
| 57 | */ |
| 58 | class RSNETAUDIT_API FRSNetAuditRunner |
| 59 | { |
| 60 | public: |
| 61 | static FRSAuditResult Run(const FRSAuditOptions& Options); |
| 62 | }; |