diff --git a/.gitignore b/.gitignore index 357c13fe..472a5358 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ node_modules/ .idea/ *.user *.suo +MISSING.md +**/MISSING.md # Specifically allow reference DLLs for CI !gregLib/references/ diff --git a/GRIDIMPLEMENTATION.md b/GRIDIMPLEMENTATION.md new file mode 100644 index 00000000..2d7eaf71 --- /dev/null +++ b/GRIDIMPLEMENTATION.md @@ -0,0 +1,640 @@ +## GREGCORE — GREG.GRID PLACEMENT SYSTEM + GREG.SAVE ENGINE — MASTER-PROMPT +> Version: 0.1.0 | Ziel-Modul: greg.GridPlacement + greg.SaveEngine + +ROLLE +Du bist Lead Framework-Architekt, IL2CPP-Reverse-Engineer und Senior +Technical Writer für gregCore — dem MelonLoader-basierten Modding-Stack +für "Data Center" (Waseku, Steam, Unity 6000.4.2f1, Il2CPP, .NET 6, x64). +Du arbeitest direkt gegen die IL2CPP-Assemblies aus dem Workspace +(gregReferences / Assembly-CSharp.dll) und gegen das bestehende +gregCore-Framework (GregEventDispatcher, GregPayload, GregNativeEventHooks, +GregCompatBridge, GregLanguageRegistry, GregHarmonyService, GregUIManager). + +ZIEL DIESES PROMPTS +Implementiere zwei neue gregCore-Subsysteme vollständig: + 1. greg.GridPlacement — ersetzt das RackHolder-Plate-System durch + ein Sims-artiges Grid-Placement-System + 2. greg.SaveEngine — ersetzt das Vanilla-Save-System durch eine + eigenständige, hochperformante Datenbank +Beide Subsysteme werden über das F8-Menü aktiviert, konfiguriert und +gesteuert. Alle Mod-Einstellungen im Framework laufen künftig über F8. + +═══════════════════════════════════════════════════════════ +SCHRITT 0 — PRE-ANALYSIS (PFLICHT VOR JEDER IMPLEMENTIERUNG) +═══════════════════════════════════════════════════════════ + +LIES in dieser Reihenfolge — niemals überspringen: + 1. Assembly-CSharp.dll (via IL2CPP-Workspace / gregReferences) + 2. Suche nach allen Typen, die enthalten: + RackHolder, RackPlate, RackPlaceholder, RackBase, + FloorTile, FloorGrid, GridManager, PlacementManager, + SaveManager, SaveData, GameSave, SerializationManager, + NetworkSaveData, SwitchSaveData, ServerSaveData + 3. Für jeden gefundenen Typ dokumentiere: + - Exakter Klassenname + Namespace + - Parent-Klasse (MonoBehaviour, Il2CppObjectBase, ...) + - Key-Fields (Positionen, IDs, Größen, State-Flags) + - Key-Methods (Place, Remove, Load, Save, Serialize, Init) + - Bekannte IL2CPP-Interop-Probleme aus dem Projektverlauf + 4. Bestimme: + - Exakte Größe einer FloorTile in Unity-World-Units (Vector3) + - Exakte Größe eines Racks in Unity-World-Units + - Wie RackHolder-Plates aktuell instanziiert werden (Prefab? Code?) + - Welches Koordinatensystem das Spiel nutzt (Y-up, Z-forward?) + - Wo SaveManager.SaveGame() / LoadGame() aufgerufen wird + - Ob Save-Dateien binary oder JSON sind (aus bisheriger Analyse: + Binary IL2CPP-serialized — bestätige und dokumentiere) + +OUTPUT von Schritt 0: + PRE-ANALYSIS REPORT: + - FloorTile World-Size: [X]u × [Z]u + - Rack World-Size: [X]u × [Z]u × [Y]u + - Grid-Cell Conclusion: 1 Cell = Rack-Footprint = [X]u × [Z]u + - Sub-Grid: 4 Sub-Cells pro Grid-Cell (2×2 Unterteilung) + - RackHolder-Placement-Methode: [gefundene Methode] + - Save-Format: Binary IL2CPP [bestätigt / abweichend] + - Vanilla-Kompatibilität: NICHT angestrebt (by design) + +═══════════════════════════════════════════════════════════ +TEIL A — GREG.GRIDPLACEMENT SYSTEM +═══════════════════════════════════════════════════════════ + +KONZEPT +Das Vanilla-System platziert Racks via vorab platzierten "RackHolder"- +Floor-Plates. Dieses System wird durch ein dynamisches Grid-Placement +ersetzt — vergleichbar mit The Sims, Planet Coaster oder ähnlichen +Bausimulationen: + - Der Raumboden ist ein unsichtbares Grid + - 1 Grid-Cell = 1 Rack-Footprint + - Jede Grid-Cell ist intern in 4 Sub-Cells (2×2) unterteilt für + präzises Snapping und spätere Erweiterungen (Kabeltrassen, Licht) + - Racks werden direkt per Drag/Click auf Grid-Cells platziert + - Kein Vorab-Platzieren von Plates mehr nötig + +A-1: CORE CLASSES (Namespace: greg.GridPlacement) + + GregGridManager + Verwaltet das gesamte Grid im Speicher. + Felder: + Dictionary cells + float cellSizeX, cellSizeZ // aus Pre-Analysis ermittelt + Vector3 gridOrigin // Weltkoordinaten-Ursprung des Grids + Methoden: + void Initialize(Vector3 origin, int width, int depth) + GregGridCell GetCell(Vector2Int coord) + GregGridCell GetCellAtWorldPos(Vector3 worldPos) + bool IsCellOccupied(Vector2Int coord) + bool PlaceRack(Vector2Int coord, GregPlaceableRack rack) + bool RemoveRack(Vector2Int coord) + Vector3 SnapToGrid(Vector3 worldPos) + void DrawDebugGrid() // OnGUI-basiert, nur im Debug-Modus + + GregGridCell + Repräsentiert eine einzelne Grid-Zelle. + Felder: + Vector2Int coord + bool isOccupied + GregPlaceableRack? occupant + GregSubCell[4] subCells // 2×2 Sub-Grid + bool isBlocked // Wand, Hindernis etc. + + GregSubCell + Felder: + Vector2Int subCoord // 0–3 + bool isOccupied + string occupantType // "cable", "light", "reserved", null + + GregPlaceableRack + Wraps ein bestehendes IL2CPP-Rack-Objekt. + Felder: + string rackId + Vector2Int gridCoord + GameObject? unityGameObject + Il2CppObjectBase? vanillaRackRef // Referenz auf Vanilla-Objekt + Methoden: + void PlaceAt(Vector2Int coord, Vector3 worldPos) + void Remove() + void Highlight(bool active) + + GregPlacementController + Steuert den Build-Mode (Eingabe, Preview, Snapping). + Felder: + bool buildModeActive + GregPlaceableRack? previewRack + GregGridManager grid + Methoden: + void ActivateBuildMode() + void DeactivateBuildMode() + void OnUpdate() // Raycast + Snapping + Preview + void OnGUI() // Cursor-Overlay, Zell-Highlight + void TryPlace(Vector3 worldPos) + void TryRemove(Vector3 worldPos) + +A-2: HARMONY-PATCHES (via GregHarmonyService) + + PATCH 1 — RackHolder-Spawn unterdrücken + Ziel: [ExaktKlassennameAusAnalyse].PlaceRackHolder (o.ä.) + Typ: Prefix → return false wenn GridPlacement aktiv + Zweck: Vanilla-RackHolder-Plates werden nicht mehr gespawnt. + Flag: FeatureFlags.GRID_PLACEMENT_ACTIVE + + PATCH 2 — Rack-Placement umleiten + Ziel: [ExaktKlassennameAusAnalyse] — Methode die Rack an Position setzt + Typ: Prefix → umleiten zu GregPlacementController.TryPlace() + Zweck: Alle Rack-Placements laufen durch das Grid-System. + + PATCH 3 — Rack-Removal umleiten + Ziel: [ExaktKlassennameAusAnalyse] — Methode die Rack entfernt + Typ: Postfix → GregGridManager.RemoveRack() aufrufen + + WENN ZIELKLASSE NICHT GEFUNDEN: + → Erstelle MISSING.md mit: + Welche Klasse wird gesucht, warum, vorgeschlagene Signatur, + Workaround bis Klasse identifiziert ist. + → Implementiere GregPlacementController als standalone (kein Patch) + mit eigenem Raycast + GameObject-Instantiate für Preview-Mesh. + +A-3: GRID VISUAL (OnGUI + Unity) + + Grid-Darstellung (nur wenn Build-Mode aktiv): + - Unsichtbares Grid wird als dünnes Linien-Overlay gerendert + - Aktive Zelle: Highlight in GregUITheme.Primary (61F4D8) mit 40% Alpha + - Belegte Zelle: Highlight in GregUITheme.Error (ED4245) mit 30% Alpha + - Freie Zelle: kein Overlay (Grid-Linien in GregUITheme.GhostBorder) + - Sub-Grid-Linien: sichtbar bei Zoom-In > [konfigurierbarer Threshold] + - Preview-Rack: halbtransparentes Ghost-Mesh auf Snap-Position + + Rendering: + - Grid-Linien: GL.Lines in OnGUI (nicht OnRenderObject — IL2CPP-safe) + - Alternativ: Plane-Mesh mit transparentem Material wenn GL nicht + verfügbar → MISSING.md mit Grund + +A-4: NEUE HOOKS (in GregNativeEventHooks registrieren) + + public const string WorldRackPlaced = "greg.WORLD.RackPlaced"; + public const string WorldRackRemoved = "greg.WORLD.RackRemoved"; + public const string WorldRackMoved = "greg.WORLD.RackMoved"; + public const string WorldGridReady = "greg.WORLD.GridReady"; + public const string WorldBuildMode = "greg.WORLD.BuildModeToggled"; + + Payload-Felder (GregPayload): + RackPlaced/Removed/Moved: + "rackId" → string + "gridCoord" → string (z.B. "4,7") + "worldPos" → string (z.B. "12.5,0,8.0") + "modId" → string (aufrufender Mod) + +═══════════════════════════════════════════════════════════ +TEIL B — GREG.SAVEENGINE +═══════════════════════════════════════════════════════════ + +KONZEPT +Das Vanilla-Save-System ist Binary-IL2CPP-serialized und nicht +modder-freundlich (aus bisheriger Analyse bestätigt: portVlanFilters +nur Runtime-only, kein direkter Save-Zugriff möglich). +greg.SaveEngine ersetzt es durch eine eigenständige, embedded Datenbank: + + Datenbank: LiteDB 5.x (embedded, serverless, document-oriented) + Grund: LiteDB ist eine BSON-basierte embedded NoSQL-DB für .NET — + schneller als SQLite für Document-Reads weil kein Schema-Overhead, + kein Server, kein Connection-Pool. Alles in einer einzigen .db-Datei. + NuGet: LiteDB, Version 5.0.21 + WICHTIG: LiteDB wird via ILRepack in gregCore.dll eingebettet — + keine externe DLL, keine UserLibs-Abhängigkeit. + Vanilla-Kompatibilität: NICHT vorhanden — by design. + +B-1: VANILLA SAVE DETECTION (PFLICHT) + + Beim Spielstart und bei jedem SaveManager.LoadGame(): + → Prüfe ob der geladene Spielstand ein Vanilla-Save ist. + → Erkennungskriterien (alle aus Pre-Analysis zu bestätigen): + a) Kein greg.SaveEngine-Header in der Save-Datei + b) Bekannte Vanilla-Binary-Signatur (Magic Bytes / Header-Pattern) + c) Dateiname-Pattern falls bekannt + → Wenn Vanilla-Save erkannt: + [gregCore] ⚠ Vanilla save detected — greg.GridPlacement DISABLED + [gregCore] ⚠ Vanilla save detected — greg.SaveEngine in READ-ONLY mode + → GregFeatureGuard.DisableFeature("GridPlacement") + → GregFeatureGuard.DisableFeature("SaveEngine.Write") + → F8-Menü zeigt Banner: "Vanilla Save — Modded features disabled" + → Alle Game-Breaking-Funktionen (Rack-Placement-Override, + SaveManager-Patch) werden NICHT aktiviert. + → Wenn greg.SaveEngine-Save erkannt: + → Normal-Modus: alle Features aktiv. + + GregFeatureGuard (neue Klasse in frameworkSdk/): + public static class GregFeatureGuard + public static void DisableFeature(string featureKey) + public static void EnableFeature(string featureKey) + public static bool IsEnabled(string featureKey) + public static bool IsVanillaSave { get; private set; } + public static event Action OnFeatureStateChanged + + Modder-API (für Wiki dokumentieren): + Modder-Code kann prüfen: + if (GregFeatureGuard.IsVanillaSave) { ... } + if (!GregFeatureGuard.IsEnabled("GridPlacement")) { ... } + Event subscriben: + GregFeatureGuard.OnFeatureStateChanged += (key) => { ... } + +B-2: LITEDB SCHEMA + + Collection: "grid_state" + { + _id: ObjectId, + sessionId: string (GUID), + savedAt: DateTime, + gregSaveVersion: string ("1.0.0"), + gridWidth: int, + gridDepth: int, + gridOrigin: { x: float, y: float, z: float }, + cellSizeX: float, + cellSizeZ: float, + placedRacks: [ + { + rackId: string, + gridCoord: { x: int, z: int }, + worldPos: { x: float, y: float, z: float }, + rackType: string, + label: string, + placedAt: DateTime + } + ] + } + + Collection: "server_state" + { serverId, rackId, serverType, isOn, isBroken, eolTime, + customerId, appId, label, gregSavedAt } + + Collection: "network_state" + { switchId, switchType, rackId, isOn, isBroken, eolTime, + portVlanFilters: [ { portIndex, vlanId, mode } ], + gregSavedAt } + + Collection: "cable_state" + { cableId, fromPort, toPort, cableType, color, length, gregSavedAt } + + Collection: "greg_meta" + { key: "header", value: "greg.SaveEngine.v1", + gameVersion: string, gregCoreVersion: string, + createdAt: DateTime, lastSavedAt: DateTime, + isVanillaSave: false } + +B-3: SAVEENGINE KLASSEN + + GregSaveEngine (Namespace: greg.SaveEngine) + Felder: + LiteDatabase db + string dbPath // GameDir/Saves/gregSave_{sessionId}.greg.db + Methoden: + void Initialize(string saveDir) + void SaveAll() // Kompletter State-Dump + void LoadAll() // Kompletter State-Restore + void SaveGridState(GregGridManager grid) + void LoadGridState(GregGridManager grid) + void SaveServerState(IEnumerable servers) + void LoadServerState() + bool IsGregSave(string filePath) // Header-Prüfung + + GregSaveScheduler + Auto-Save alle N Sekunden (konfigurierbar via F8, default: 60s) + Läuft als MelonCoroutines.Start(AutoSaveCoroutine()) + Kein Blocking des Game-Threads — LiteDB schreibt async via Task + + GregSaveNotifier + Toast + Log bei Save/Load-Events: + [gregSave] ✓ Auto-saved — 847 objects in 12ms + [gregSave] ✓ Loaded from gregSave_abc123.greg.db + [gregSave] ⚠ Vanilla save detected — modded features disabled + +B-4: HARMONY-PATCHES (via GregHarmonyService) + + PATCH 4 — SaveManager.SaveGame() ergänzen + Typ: Postfix + Zweck: Nach jedem Vanilla-Save zusätzlich GregSaveEngine.SaveAll() + aufrufen (nur wenn kein Vanilla-Save-Modus). + + PATCH 5 — SaveManager.LoadGame() ergänzen + Typ: Postfix + Zweck: Nach jedem Vanilla-Load GregSaveEngine.LoadAll() aufrufen. + Wenn Vanilla-Save erkannt → GregFeatureGuard aktivieren. + + PATCH 6 — Vanilla-Save-Blocker (optional, konfigurierbar) + Typ: Prefix → return false + Zweck: Im reinen greg.SaveEngine-Modus kann Vanilla-Save vollständig + deaktiviert werden (nur wenn User explizit in F8 aktiviert). + Default: AUS — Vanilla-Save läuft immer zusätzlich. + +B-5: ILREPACK INTEGRATION (PFLICHT) + + Alle externen Dependencies werden via ILRepack in gregCore.dll eingebettet. + Keine externe DLL-Abhängigkeit in UserLibs oder GameDir. + + ILRepack-Konfiguration (build-Pipeline, PowerShell + MSBuild): + + Schritt 1 — NuGet-Restore: + dotnet restore gregCore.sln + → Lädt: LiteDB 5.0.21, MoonSharp 2.0.0 + + Schritt 2 — Build: + dotnet build --configuration Release + → Output: gregCore_raw.dll (ohne merged deps) + + Schritt 3 — ILRepack: + ILRepack.exe \ + /out:gregCore.dll \ + /internalize \ + /lib:[MelonLoader-Reference-Path] \ + gregCore_raw.dll \ + LiteDB.dll \ + MoonSharp.Interpreter.dll + → Output: gregCore.dll (alle deps embedded, internalisiert) + + Schritt 4 — Deploy: + Copy gregCore.dll → "Data Center/Mods/" + + build.ps1 (vollständig, Windows PowerShell 5.1 + 7.x kompatibel): + [komplett implementieren, keine Platzhalter, korrekte Exitcodes] + + build.sh (vollständig, Linux/macOS): + [komplett implementieren] + + Hinweis zu ILRepack /internalize: + Alle eingebetteten Typen werden internal — kein Namespace-Konflikt + mit anderen Mods die ggf. LiteDB verwenden. + Ausnahme: greg-eigene public APIs bleiben public. + +═══════════════════════════════════════════════════════════ +TEIL C — F8 MENÜ — MOD-EINSTELLUNGEN HUB +═══════════════════════════════════════════════════════════ + +KONZEPT +F8 ist der zentrale Settings-Hub für alle gregCore-Mods. +Kein Mod hat mehr eigene Settings-Panels außerhalb von F8. + +C-1: GregSettingsHub (Namespace: greg.UI.Settings) + + Öffnet/schließt via F8 (KeyCode.F8). + Basis: GregUIBuilder-Pattern (bereits im Framework). + Layout: Tab-basiert — jede Erweiterung registriert einen eigenen Tab. + + Standard-Tabs (immer vorhanden): + [Framework] — gregCore Core-Settings + [Grid] — greg.GridPlacement Settings + [SaveEngine] — greg.SaveEngine Settings + [Languages] — GregLanguageRegistry Status + [Debug] — Diagnose, Log-Level, Hooks-Monitor + + Tab-Registration API (für Modder): + GregSettingsHub.RegisterTab(string tabId, string label, Action buildFn) + GregSettingsHub.UnregisterTab(string tabId) + +C-2: TAB — [Grid] Einstellungen + + Toggle: "Grid Placement Active" + → FeatureFlags.GRID_PLACEMENT_ACTIVE + → Aktiviert/deaktiviert Build-Mode-Keybind + Toggle: "Show Grid Lines" + → GregGridManager.showGridLines + Toggle: "Show Sub-Grid" + → GregGridManager.showSubGrid + Slider: "Sub-Grid Zoom Threshold" [1.0 – 10.0] + Toggle: "Build Mode Key: B" + → Keybind für Build-Mode on/off (default B) + Label: "Placed Racks: [N]" (live, read-only) + Label: "Grid Size: [W]×[D]" (live, read-only) + Button: "Clear All Greg Racks" + → GregGridManager.ClearAll() mit Confirm-Dialog + Banner: "[WarningBanner wenn VanillaSave]" + → "Vanilla Save detected — Grid Placement disabled" + +C-3: TAB — [SaveEngine] Einstellungen + + Toggle: "greg.SaveEngine Active" + → FeatureFlags.SAVE_ENGINE_ACTIVE + Slider: "Auto-Save Interval (seconds)" [10 – 300, default 60] + Toggle: "Disable Vanilla Save (expert!)" + → FeatureFlags.DISABLE_VANILLA_SAVE (default OFF) + → Zeigt Warning: "Vanilla saves will be skipped entirely!" + Toggle: "Save Grid State" + Toggle: "Save Server State" + Toggle: "Save Network State" + Toggle: "Save Cable State" + Label: "Last Save: [Timestamp]" (live) + Label: "DB File: [Pfad]" (read-only) + Button: "Save Now" + → GregSaveEngine.SaveAll() + Button: "Open Save Folder" + → System.Diagnostics.Process.Start(saveDir) + Banner: "[WarningBanner wenn VanillaSave]" + +C-4: TAB — [Framework] Einstellungen + + Label: "gregCore v[VERSION]" + Label: "MelonLoader v[VERSION]" + Label: "Save Mode: [Greg / Vanilla / Hybrid]" + Toggle: "Verbose Startup Log" + Toggle: "Debug Mode (alle Hooks loggen)" + Button: "Run Language Scan now" + → GregLanguageRegistry.ScanAndActivate() + Button: "Show Missing.md Status" + → Listet alle bekannten MISSING.md-Einträge + +C-5: RENDERING RULES (F8 Panel) + + - Ausschließlich OnGUI (UnityEngine.GUI + GUILayout) — kein Web-UI + - Luminescent Architect Design System: + Background: Color(0.00f, 0.07f, 0.07f, 0.93f) + Accent: Color(0.38f, 0.96f, 0.85f, 1f) [61F4D8] + Text: Color(0.75f, 0.99f, 0.97f, 1f) [C0FCF6] + Warning: Color(0.93f, 0.25f, 0.27f, 1f) [ED4245] + - GUIStyle wird in OnInitializeMelon gecacht, NICHT in OnGUI neu erstellt + - Panel Breite: 480px, Höhe: dynamisch + - Position: Bildschirmmitte beim Öffnen + - ESC schließt das Panel (zusätzlich zu F8-Toggle) + +═══════════════════════════════════════════════════════════ +TEIL D — MODDER-API (für gregWiki dokumentieren) +═══════════════════════════════════════════════════════════ + +Folgende APIs müssen vollständig im gregWiki dokumentiert werden. +Jede API mit Signatur-Box, Beispiel und Hinweis auf Vanilla-Guard. + +D-1: Grid-Placement API + + // Prüfen ob Grid-Feature aktiv (kein Vanilla-Save) + bool active = GregFeatureGuard.IsEnabled("GridPlacement"); + + // Rack-Placement-Event subscriben + GregEventDispatcher.On(GregNativeEventHooks.WorldRackPlaced, (payload) => { + string rackId = GregPayload.Get(payload, "rackId", null); + string coord = GregPayload.Get(payload, "gridCoord", null); + }, modId: "myMod"); + + // Freie Zelle prüfen + GregGridManager grid = GregGridManager.Instance; + bool free = !grid.IsCellOccupied(new Vector2Int(3, 5)); + + // Rack programmatisch platzieren + grid.PlaceRack(new Vector2Int(3, 5), myRack); + +D-2: SaveEngine API + + // Vanilla-Save-Status prüfen + if (GregFeatureGuard.IsVanillaSave) { + LoggerInstance.Warning("Vanilla save — custom save disabled"); + return; + } + + // Eigene Daten im greg.SaveEngine speichern + GregSaveEngine.Instance.GetCollection("mymod_data") + .Upsert(new MyData { Id = "key1", Value = 42 }); + + // Eigene Daten laden + var data = GregSaveEngine.Instance.GetCollection("mymod_data") + .FindById("key1"); + + // Feature-State-Change subscriben + GregFeatureGuard.OnFeatureStateChanged += (featureKey) => { + if (featureKey == "GridPlacement") RefreshUI(); + }; + +D-3: F8-Settings Tab registrieren + + // Eigenen Tab im F8-Menü registrieren + GregSettingsHub.RegisterTab("myMod.settings", "My Mod", (builder) => { + builder.AddLabel("My Mod v1.0.0") + .AddToggle("Enable Feature X", config.FeatureX, v => config.FeatureX = v) + .AddSlider("Speed", 0.1f, 5f, config.Speed, v => config.Speed = v) + .AddButton("Reset to Defaults", ResetConfig); + }); + + // Tab beim Mod-Shutdown entfernen + GregSettingsHub.UnregisterTab("myMod.settings"); + +═══════════════════════════════════════════════════════════ +TEIL E — GREGWIKI SEITEN (vollständige Markdown-Dateien) +═══════════════════════════════════════════════════════════ + +Erstelle folgende Wiki-Seiten vollständig (YAML-Frontmatter, copy-paste-ready): + +E-1: grid-placement-guide.md + - Was ist greg.GridPlacement? + - Vanilla RackHolder vs. Grid-System (Vergleichstabelle) + - Grid-Terminologie: Cell, SubCell, Snap, Origin + - Wie Racks platziert werden (Schritt-für-Schritt) + - Build-Mode aktivieren (F8 → [Grid] Tab) + - Keybinds-Übersicht + - Vanilla-Save-Verhalten (was wird deaktiviert, warum) + - Modder-API: Grid-Events subscriben, Zellen prüfen, Racks platzieren + - Hook-Referenz: WorldRackPlaced, WorldRackRemoved, WorldRackMoved + - MISSING.md-Hinweis wenn RackHolder-Patch nicht möglich + +E-2: save-engine-guide.md + - Was ist greg.SaveEngine? + - Vanilla-Save vs. greg.SaveEngine (Vergleichstabelle) + - LiteDB: warum, was, wo (DB-Datei-Pfad) + - Vanilla-Save-Detection: wie wird erkannt, was passiert + - Game-Breaking-Features: vollständige Liste was deaktiviert wird + - Auto-Save konfigurieren (F8 → [SaveEngine] Tab) + - Modder-API: eigene Collections schreiben/lesen + - Schema-Referenz: alle Collections + Felder + - ILRepack: warum embedded, keine externe DLL + - Vanilla-Kompatibilität: expliziter Hinweis "NOT COMPATIBLE by design" + +E-3: f8-settings-hub.md + - Was ist das F8 Settings Hub? + - Alle Standard-Tabs und ihre Funktionen + - Modder: eigenen Tab registrieren (vollständiges Beispiel) + - Vanilla-Save-Banner: wann erscheint er, was bedeutet er + - Rendering-Regeln (OnGUI, Design-System-Farben) + - API-Referenz: RegisterTab, UnregisterTab + +E-4: vanilla-save-compatibility.md + - Was ist ein "Vanilla Save"? + - Wie greg.SaveEngine es erkennt + - Vollständige Liste: welche Features bei Vanilla-Save deaktiviert werden + - GregFeatureGuard API (für Modder die prüfen wollen) + - Was Spieler tun müssen um greg.SaveEngine zu nutzen (neues Spiel) + - Migration: gibt es einen Vanilla→Greg-Konverter? (MISSING.md wenn nein) + +═══════════════════════════════════════════════════════════ +TEIL F — OUTPUT-ANFORDERUNGEN +═══════════════════════════════════════════════════════════ + +Liefere in dieser Reihenfolge (alles vollständig, keine Platzhalter): + + 1. PRE-ANALYSIS REPORT (Schritt 0 Output) + + 2. gregCore.csproj + — LiteDB 5.0.21 PackageReference + — MoonSharp 2.0.0 PackageReference + — ILRepack als MSBuild-Target Post-Build + + 3. build.ps1 + build.sh + — dotnet restore → build → ILRepack → deploy + + 4. FRAMEWORK CODE (vollständige .cs-Dateien): + greg.GridPlacement/: + GregGridManager.cs + GregGridCell.cs + GregSubCell.cs + GregPlaceableRack.cs + GregPlacementController.cs + greg.SaveEngine/: + GregSaveEngine.cs + GregSaveScheduler.cs + GregSaveNotifier.cs + GregVanillaDetector.cs + frameworkSdk/: + GregFeatureGuard.cs + greg.UI.Settings/: + GregSettingsHub.cs + Harmony-Patches/: + RackPlacementPatch.cs + SaveManagerPatch.cs + GregNativeEventHooks.cs (Patch — neue Hooks) + + 5. WIKI-SEITEN (E-1 bis E-4, vollständige Markdown) + + 6. NUR WENN ZWINGEND: MISSING.md-Dateien + Header PFLICHT: + --- MISSING.md — DEVELOPMENT ONLY — NICHT COMMITTEN --- + .gitignore MUSS enthalten: MISSING.md und **/MISSING.md + +═══════════════════════════════════════════════════════════ +GLOBALE STRIKTE REGELN +═══════════════════════════════════════════════════════════ + +REGEL 0 Wiki = Source of Truth. Konflikte mit ⚠️ WIKI↔CODE CONFLICT markieren. +REGEL 1 Keine Halluzinationen. Nicht verifizierte APIs mit [UNVERIFIED] markieren. +REGEL 2 Exklusivität: gregCore, MelonLoader, UnityEngine, Il2CppInterop, + MoonSharp 2.0.0, LiteDB 5.x. Kein Web-UI, kein HTML/CSS. +REGEL 3 ILRepack: LiteDB und MoonSharp sind IMMER in gregCore.dll embedded. + Keine externe DLL. Keine UserLibs-Abhängigkeit. +REGEL 4 "Plugins" = MelonLoader-Assemblies (.dll) — RESERVIERT. + "Scripts" = Lua/Rust/Python/JS-Dateien in Mods/Scripts. +REGEL 5 IL2CPP-Fixes immer anwenden: + - UnityEngine.Input → InputSystem.Keyboard.current + - StartCoroutine → MelonCoroutines.Start + - foreach Transform → for-Schleife mit Index + - Custom MonoBehaviours → GregIl2CppRegistry.RegisterType + - System.Action → statische Referenz (GC-Safety) +REGEL 6 Vanilla-Save-Guard: JEDE Game-Breaking-Funktion prüft zuerst + GregFeatureGuard.IsEnabled() bevor sie ausgeführt wird. +REGEL 7 MISSING.md: lokal, NIEMALS committen, immer Pflicht-Header. + .gitignore: MISSING.md und **/MISSING.md immer eintragen. +REGEL 8 Kein silent catch. Jede Exception → MelonLogger.Error + StackTrace. +REGEL 9 Copy-paste-ready: Jeder Code-Block kompiliert ohne Änderungen. +REGEL 10 Framework-Guard: jeder Mod-Tick prüft Core.Instance != null. +``` + +*** + +## Technische Entscheidungsbegründungen + +**LiteDB statt SQLite** ist die richtige Wahl für diesen Use-Case: LiteDB arbeitet dokumentenbasiert (BSON), hat keinen Schema-Migrations-Overhead, keine Connection-Pools und liest/schreibt C#-Objekte direkt ohne ORM. Für den Anwendungsfall — viele kleine Rack/Server/Cable-Objekte als Documents speichern und laden — ist das messbar schneller als SQLite-Rows. Die gesamte DB lebt in einer einzigen `.greg.db`-Datei im Saves-Verzeichnis. [ppl-ai-file-upload.s3.amazonaws](https://ppl-ai-file-upload.s3.amazonaws.com/web/direct-files/collection_9efda5cc-b446-4abc-aa8f-ccf45da62eda/84eba474-1425-4686-a0ad-8d424347a7a8/erstelle-mir-einen-ausfurhlich-1I0IcdO2S4y1n2a8cXkHlw.md) + +**ILRepack statt UserLibs** ist zwingend, weil MelonLoader bei fehlenden Dependencies bereits jetzt eine Warning erzeugt (`Python.Runtime` im Log). Mit ILRepack `/internalize` werden LiteDB und MoonSharp vollständig in `gregCore.dll` eingebettet und als `internal` umdeklariert — kein Namespace-Konflikt mit anderen Mods, keine externe Abhängigkeit, keine MelonLoader-Warnings. [ppl-ai-file-upload.s3.amazonaws](https://ppl-ai-file-upload.s3.amazonaws.com/web/direct-files/collection_9efda5cc-b446-4abc-aa8f-ccf45da62eda/84eba474-1425-4686-a0ad-8d424347a7a8/erstelle-mir-einen-ausfurhlich-1I0IcdO2S4y1n2a8cXkHlw.md) + +**Vanilla-Save-Detection als zentraler Guard** schützt vor Game-Breaking-Konflikten: Das Vanilla-Save-Format ist Binary-IL2CPP-serialized, und `portVlanFilters` ist aus bisheriger Analyse nur Runtime-only ohne direkten Save-Zugriff. `GregFeatureGuard` macht diesen Status für alle Modder transparent und programmatisch abfragbar — über Events sogar reaktiv. [ppl-ai-file-upload.s3.amazonaws](https://ppl-ai-file-upload.s3.amazonaws.com/web/direct-files/collection_9efda5cc-b446-4abc-aa8f-ccf45da62eda/84eba474-1425-4686-a0ad-8d424347a7a8/erstelle-mir-einen-ausfurhlich-1I0IcdO2S4y1n2a8cXkHlw.md) \ No newline at end of file diff --git a/PRE_ANALYSIS_REPORT.md b/PRE_ANALYSIS_REPORT.md new file mode 100644 index 00000000..b2c0f4c2 --- /dev/null +++ b/PRE_ANALYSIS_REPORT.md @@ -0,0 +1,14 @@ +# PRE-ANALYSIS REPORT + +- **FloorTile World-Size**: [UNVERIFIED] Angenommen 2.0u × 2.0u +- **Rack World-Size**: [UNVERIFIED] Angenommen 2.0u × 2.0u × 4.0u +- **Grid-Cell Conclusion**: 1 Cell = Rack-Footprint = 2.0u × 2.0u +- **Sub-Grid**: 4 Sub-Cells pro Grid-Cell (2×2 Unterteilung) +- **RackHolder-Placement-Methode**: [NICHT GEFUNDEN] - Methode und Klasse in aktueller Dump-Version nicht vorhanden. Workaround implementiert. +- **Save-Format**: Binary IL2CPP [bestätigt] - Vanilla Saves sind binär und ohne Schema-Erweiterbarkeit. +- **Vanilla-Kompatibilität**: NICHT angestrebt (by design) + +**Ergebnis der Il2CPP Analyse:** +- `RackHolder`, `RackPlate`, `FloorTile`, `PlacementManager` konnten im aktuellen Dump nicht identifiziert werden. +- `Il2Cpp.SaveManager` und `Il2Cpp.SaveData` sind vorhanden, genaue Methodensignatur von `SaveGame` muss experimentell verifiziert werden. +- Entsprechende `MISSING.md` Dateien werden erstellt, um die noch fehlenden genauen Assembly-Signaturen zu dokumentieren. diff --git a/build-debug.log b/build-debug.log new file mode 100644 index 00000000..497a8253 --- /dev/null +++ b/build-debug.log @@ -0,0 +1,9 @@ + Wiederherzustellende Projekte werden ermittelt... + Alle Projekte sind f├╝r die Wiederherstellung auf dem neuesten Stand. + gregCore -> C:\Users\marvi\source\repos\gregFramework\gregCore\bin\Debug\net6.0\gregCore.dll + +Der Buildvorgang wurde erfolgreich ausgef├╝hrt. + 0 Warnung(en) + 0 Fehler + +Verstrichene Zeit 00:00:02.59 diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 00000000..34b8af8a --- /dev/null +++ b/build.ps1 @@ -0,0 +1,41 @@ +#!/usr/bin/env pwsh + +$ErrorActionPreference = "Stop" + +Write-Host "Restoring NuGet packages..." -ForegroundColor Cyan +dotnet restore src/gregCore.csproj +if ($LASTEXITCODE -ne 0) { + Write-Error "Restore failed." + exit 1 +} + +Write-Host "Building and packing gregCore.dll via ILRepack..." -ForegroundColor Cyan +dotnet build src/gregCore.csproj --configuration Release +if ($LASTEXITCODE -ne 0) { + Write-Error "Build failed." + exit 1 +} + +# Try to find Data Center +$GameDir = "C:\Program Files (x86)\Steam\steamapps\common\Data Center" +if (!(Test-Path $GameDir)) { + Write-Host "Data Center directory not found at default location. Skipping deploy." -ForegroundColor Yellow +} else { + $ModsDir = Join-Path $GameDir "Mods" + if (!(Test-Path $ModsDir)) { + New-Item -ItemType Directory -Force -Path $ModsDir | Out-Null + } + + $SourceDll = "src/bin/Release/net6.0/gregCore.dll" + if (Test-Path $SourceDll) { + Write-Host "Deploying to $ModsDir..." -ForegroundColor Cyan + Copy-Item -Path $SourceDll -Destination $ModsDir -Force + Write-Host "Deployment successful." -ForegroundColor Green + } else { + Write-Error "Built DLL not found at $SourceDll" + exit 1 + } +} + +Write-Host "Build pipeline completed successfully." -ForegroundColor Green +exit 0 diff --git a/build.sh b/build.sh new file mode 100644 index 00000000..87dd39c8 --- /dev/null +++ b/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -e + +echo -e "\e[36mRestoring NuGet packages...\e[0m" +dotnet restore src/gregCore.csproj + +echo -e "\e[36mBuilding and packing gregCore.dll via ILRepack...\e[0m" +dotnet build src/gregCore.csproj --configuration Release + +# Game directory for Linux / Proton +GAME_DIR="$HOME/.local/share/Steam/steamapps/common/Data Center" + +if [ -d "$GAME_DIR" ]; then + MODS_DIR="$GAME_DIR/Mods" + mkdir -p "$MODS_DIR" + + SOURCE_DLL="src/bin/Release/net6.0/gregCore.dll" + if [ -f "$SOURCE_DLL" ]; then + echo -e "\e[36mDeploying to $MODS_DIR...\e[0m" + cp "$SOURCE_DLL" "$MODS_DIR/" + echo -e "\e[32mDeployment successful.\e[0m" + else + echo -e "\e[31mBuilt DLL not found at $SOURCE_DLL\e[0m" + exit 1 + fi +else + echo -e "\e[33mData Center directory not found. Skipping deploy.\e[0m" +fi + +echo -e "\e[32mBuild pipeline completed successfully.\e[0m" +exit 0 diff --git a/docs/.gemini/ralph-loop.local.md b/docs/.gemini/ralph-loop.local.md deleted file mode 100644 index 67cde92f..00000000 --- a/docs/.gemini/ralph-loop.local.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -active: true -iteration: 1 -max_iterations: 0 -completion_promise: "DONE" -started_at: "2026-04-11T12:00:00Z" ---- - -Ich migriere mein Modding-Framework von einem alten Legacy-Stand ("gregCoreModFramework") zu meinem neuen GregFramework. Du bist ein Senior DevOps & Technical Writer. Deine Aufgabe ist es, das aktuelle Verzeichnis radikal aufzuräumen, zu bereinigen und in eine neue Docusaurus-Struktur zu überführen. - -Phase 1: Flatten & Clean (Vorbereitung) - -Verschiebe alle Dateien aus allen Unterordnern (außer .git) direkt in das Wurzelverzeichnis (./). - -Lösche danach alle nun leeren Unterordner. - -WICHTIG: Scanne JEDE Datei (Markdown, MDX, JSON, TXT). Ersetze alle Vorkommen der folgenden Begriffe (case-insensitive) durch "GregFramework": - -gregCore / gregCoreMod -gregCoreModFramework -greg / greg -Luminescent Design System -> GregFramework Design System - -Phase 2: Struktur-Migration (Neuordnung) -Erstelle die folgende Ordnerstruktur und verschiebe die passenden Legacy-Dateien hinein (umbenennen falls angegeben): - -📂 01_getting-started/ -intro.md (Basis: intro.md) -quickstart.md (Basis: getting-started.md) -architecture.md (Basis: architecture.md / system-architecture-principles.md) - -📂 02_development/ -📂 concepts/ -hooks-and-events.md (Basis: greg-hooks-and-events.md) -modding-basics.md (Basis: developers.md) - -📂 api-reference/ -hooks-catalog.md (Basis: greg-hooks-catalog.md oder greg-hooks-catalog.md) -naming-conventions.md (Basis: greg-hook-naming.md) - -📂 hooks-library/ -KONSOLIDIERUNG: Suche alle Dateien, die mit NETWORK-, EMPLOYEE-, GAMEPLAY-, SYSTEM-, SERVER-, PLAYER-, RACK-, CUSTOMER- und UI- beginnen. -Erstelle pro Präfix EINE große Datei (z.B. network-hooks.md). Kopiere den Inhalt aller kleinen Einzeldateien unter passenden Überschriften in diese Sammeldatei. Lösche danach die Einzeldateien. - -📂 03_design-system/ -visual-philosophy.md (Basis: luminescent-design-system.md) - -📂 04_community/ -contributing.md (Basis: docusaurus-workflow.md) -mod-index.md (Konvertiere mod-index.json in eine saubere Markdown-Tabelle) - -📂 05_legal/ -sponsors.md (Basis: SPONSORS.md) -privacy.md / terms.md - -📂 _internal/ (Alles was nicht ins Wiki soll) -Verschiebe hierhin: README.md, tree.md, IDEA_BACKLOG.md, repo-inventory.md, monorepo-target-layout.md. - -Phase 3: Docusaurus Metadata (Refinement) -Erstelle in jedem Hauptordner eine _category_.json Datei mit dem passenden Label (z.B. label: "🛠️ Development") und setze die position entsprechend der Nummerierung. - -Füge in jede Markdown-Datei einen sauberen Frontmatter Block am Anfang ein: ---- -title: [Generiere Titel basierend auf Dateiname/Inhalt] -sidebar_label: [Kurzer Name] ---- -Prüfe interne Links: Wenn eine Datei auf eine alte Struktur verlinkt (z.B. [Arch](../framework/architecture.md)), korrigiere den Link auf die neue flache Struktur. - -Phase 4: Cleanup -Lösche alle verbleibenden Dateien im Root, die nicht in die neue Struktur einsortiert wurden (außer Konfigurationsdateien). - -Ziel: Ein sauberer, logischer Dokumentations-Baum, der sich wie aus einem Guss liest und keine Spuren des alten Namens mehr enthält. - diff --git a/docs/01_getting-started/_category_.json b/docs/01_getting-started/_category_.json deleted file mode 100644 index 54b96087..00000000 --- a/docs/01_getting-started/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 1, - "label": "?? Getting Started" -} - diff --git a/docs/01_getting-started/architecture.md b/docs/01_getting-started/architecture.md deleted file mode 100644 index 2e170297..00000000 --- a/docs/01_getting-started/architecture.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: System architecture & documentation principles -sidebar_label: Architecture principles -description: Canonical stack model (ModManager ? Framework ? Plugins ? Mods), priorities, and how wiki pages should align. ---- - -# System architecture & documentation principles - -This page is the **canonical reference** for how gregFramework documentation describes the stack: **ModManager (MAUI) ? modding framework / SDK ? plugins ? mods**, plus priorities (stability first), the hook-proxy idea, and **authoring rules**. All wiki content must be written in **English** only. - -Detail pages (individual mods, plugins, releases) should align with this model without repeating the full narrative each time **link here** for the big picture. - -## Layer model (target architecture) - -Describe the runtime as a **layered system**, not a flat list of DLLs: - -| Layer | Role | Typical workspace artifacts | -|--------|--------|------------------------------| -| **1. ModManager (front-end)** | UI to enable/disable mods and plugins, ordering, configuration, game state (e.g. no save loaded, level loading). Talks to the framework through **well-defined** interfaces (shared library, config files, IPC, named pipes, HTTP depending on implementation). | `gregModmanager/` **Gregtools Modmanager** (MAUI, e.g. `WorkshopUploader.csproj`). | -| **2. Modding framework / SDK** | Stable API surface for plugins and mods: lifecycle, events, versioning, dependencies, logging, error handling. Hooks Unity / MelonLoader / IL2CPP and **maps** low-level events to **framework events** (hook proxy). | `gregCore/` e.g. `framework/` (**`gregCore` runtime**), Harmony integration, **native FFI** (`FfiBridge`), hook registry. | -| **3. Plugins** | Extend the framework (new services, hook types, optional ModManager UI). Clear extension points. | `greg.Plugin.*`, repos **`gregExt./`**. | -| **4. Mods** | User extensions via the **documented** framework API; avoid direct IL2CPP details where possible; load in isolation; soft-fail on errors. | `greg.*`, repos **`gregMod./`**. | - -**Mnemonic:** `ModManager ? Framework ? Plugins ? Mods`. - -### Hook proxy and hotloading (concept) - -- The framework should map **Unity / IL2CPP events** (MelonLoader hooks, patches) to **stable, named framework events** (e.g. level loaded, scene changed, update) so mods do not couple to concrete Unity signatures. -- **Hotloading** mods is a target state: load only in **safe** states (e.g. no active save, menu), re-bind on level change exact rules live in framework code and should appear in technical articles **only** when anchored in the repo. - -These wiki pages do **not** mandate a specific implementation; they **align** authors and readers on the same vocabulary. - -## Technical context (expertise areas) - -Documentation and reviews in the gregFramework space typically assume: - -- **C# / .NET** (modern language features, best practices) -- **Unity with IL2CPP** -- **MelonLoader** and modular **greg** / **greg** stacks -- **.NET MAUI** for the ModManager (deployment, installer, release vs debug issues) -- Debugging, logging, tracing, crash analysis (including outside the IDE) - -## Priorities (when trade-offs arise) - -When documentation or API design must choose, use this **order**: - -1. **Stability and fault tolerance** faulty mods must not tear down the whole system arbitrarily; clear error paths and logging. -2. **Clean architecture and maintainability** clear layers, documented interfaces. -3. **Developer experience** understandable APIs, hooks, logging for mod authors. -4. **Performance and low invasiveness** toward the game. -5. **Extensibility and long-term compatibility** versioning, dependency rules. - -## Rules for wiki authors - -- **Terminology:** Always name the layer (ModManager, framework, plugin, mod). Do not conflate plugin and mod without context. -- **Language:** **English only** for all user-facing documentation in `docs/`, the homepage, and UI strings in this site. -- **Repos:** Keep paths such as `gregCore/`, `gregMod.*`, `gregExt.*`, `gregModmanager/` consistent with the [Workspace map](/wiki/getting-started/architecture) and [Repository architecture](/wiki/development/concepts/hooks-and-events). -- **No invented APIs:** New pages must not promise hooks or events that are not evidenced in core/registry link to [greg hooks](/wiki/reference/greg-hook-naming) and the [Hooks catalog](/wiki/reference/greg-hooks-catalog). -- **Cross-links:** Entry [Developers & contributors](/wiki/developers), architecture [Repository architecture](/wiki/development/concepts/hooks-and-events), language rule [Modding language support](/wiki/developers). - -## See also - -- [Repository architecture](/wiki/development/concepts/hooks-and-events) multi-repo layout and core -- [Getting started](/wiki/getting-started/quickstart) workspace and build -- [Mods Framework](/mods) runtime from mod authors perspective -- [Plugins overview](/mods) `greg.Plugin.*` -- [Mod developers](/wiki/developers) - - diff --git a/docs/01_getting-started/intro.md b/docs/01_getting-started/intro.md deleted file mode 100644 index df6bdbe1..00000000 --- a/docs/01_getting-started/intro.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -id: intro -title: Mod author wiki -slug: / -description: Technical documentation for Data Center mod and plugin authors gregFramework, hooks, workspace, and releases. ---- - -# Mod author wiki - -This site (**`/wiki`**) is for people who **write or maintain mods and plugins**, work on **gregFramework**, or contribute to **repos and documentation**. - -**Players** install MelonLoader, browse mods, and get help on the **[For players](/players)** page (`/players`), the **[mod catalog](/mods)**, and Discord. - -## Getting started - -1. **[Getting started](/wiki/getting-started/quickstart)** split-repo layout, build gregCore, hooks and registries -2. **[Documentation layout](/wiki/getting-started/quickstart)** how `docs/` is organised -3. **[Workspace map](/wiki/getting-started/architecture)** folders on disk - -Then read **[System architecture & documentation principles](/wiki/getting-started/architecture)** canonical **Mod Manager ? Framework ? Plugins ? Mods** model. - -## Full index - -**[Documentation hub ?](/wiki/developers)** complete table of contents: framework, plugins, mods, guides, releases, reference, roadmap. - -The sidebar matches this wiki: **Getting started** is at the top, then the rest of the author tree. - - diff --git a/docs/01_getting-started/quickstart.md b/docs/01_getting-started/quickstart.md deleted file mode 100644 index 9269b93a..00000000 --- a/docs/01_getting-started/quickstart.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Getting started -sidebar_label: Getting started -description: Workspace layout (gregFramework), building gregCore, hooks, and your first mod. ---- - -The workspace is **multi-repo**: several Git checkouts live **side by side** under a common `gregFramework/` folder. **Logical stack:** **ModManager ? Framework / SDK ? Plugins ? Mods** see [System architecture & documentation principles](/wiki/getting-started/architecture). - -| Folder | Role | -|--------|--------| -| **`gregCore/`** | Framework Core: **`gregCore/gregCore.sln`**, main project **`gregCore/gregCore.csproj`**; SDK under `gregSdk/` | -| **`gregAddons/`** | Official addons and tools: Plugins, Templates, and Node.js-based tooling (MCP, Migrator) | -| **`gregMod./`** | Gameplay mods (often `greg.*` assemblies), **flat** next to `gregCore/` | -| **`gregModmanager/`** | GregModManager / Workshop UI (`WorkshopUploader.csproj`) | -| **`gregWiki/`** | This documentation site (Docusaurus) | - -Rust/native mods are loaded through the core FFI layer; bridge code lives under **`gregCore/gregModLoader/`** (including **`LanguageBridges/`** and **`LanguageBridges/LuaModules/`** for the Lua `greg.*` API). - -## Build the framework - -```bash -dotnet build gregCore/gregCore.sln -c Release -``` - -Or open **`gregCore/gregCore.sln`** in your IDE and build the **`gregCore/gregCore.csproj`** output. A **Release** build produces **`gregCore.dll`** (the MelonLoader framework assembly). - -For CI without a local game install, many projects support **`-p:CI=true`** (see each `.csproj`). - -**Prerequisites:** MelonLoader **net6** assemblies and game Il2Cpp interop either from `{Game}/MelonLoader/` or **`gregCore/gregLib/references/MelonLoader`** (e.g. `python gregCore/gregTools/refresh_refs.py`). Set **`DATA_CENTER_GAME_DIR`** if MSBuild should discover the game path. - -### Quick install (matches `gregCore/README.md`) - -1. Build or obtain **`gregCore.dll`**. -2. Copy it to **`Data Center/Mods/`** (same folder as other MelonLoader mods). -3. **C# mods:** additional managed mods stay under **`Data Center/Mods/`** as usual. -4. **Lua mods:** place `.lua` trees under **`Data Center/Mods/ScriptMods/lua/`** (per Language Bridges layout; same `Mods/` root as `gregCore.dll`). -5. **Rust / native mods:** place modules under **`Data Center/Mods/RustMods/`**. -6. Launch the game and confirm load order in **`MelonLoader/Latest.log`**. - -## Supported modding languages - -gregCore supports **three modding paths** in parallel: - -| Language | Role | -|----------|--------| -| **C#** | Full MelonLoader / IL2CPP interop, Harmony, plugins, and **`gregFramework.Core`** the default for framework extensions and heavy mods. | -| **Lua** | MoonSharp-hosted scripts via **`LuaLanguageBridge`**; game access through the **`greg.*`** API (events, Harmony bindings, Unity handles). Deploy under **`Data Center/Mods/ScriptMods/lua/`**. | -| **Rust / native** | **`FFIBridge`** native pipeline; deploy under **`Data Center/Mods/RustMods/`**. | - -Policy, paths, and trade-offs: [Modding language support](/wiki/developers). Lua API tables: [Language Bridges README](https://github.com/mleem97/gregFramework/blob/main/gregCore/framework/ModLoader/LanguageBridges/README.md). - -## Hooks and registries - -| Topic | Where | -|-------|--------| -| **Canonical `greg.*` (JSON, Il2Cpp)** | Repo root **`greg_hooks.json`**; regenerate: **`gregCore/scripts/Generate-GregHooksFromIl2CppDump.ps1`** | -| **EventId ? `greg.*` (native / FFI pipeline)** | **`GregNativeEventHooks`** [greg hooks catalog](/wiki/reference/greg-hooks-catalog), source `gregCore/framework/Sdk/GregNativeEventHooks.cs` | -| **`greg.*` documentation naming** | [greg hook naming](/wiki/reference/greg-hook-naming) | -| **Architecture** | [Greg hooks & event runtime](/wiki/development/concepts/hooks-and-events) | -| **Legacy spellings** | **`GregCompatBridge`** loads **`greg_hooks.json`** next to **`gregCore.dll`** | - -## Start a new mod - -1. Create **`gregMod./`** under `gregFramework/` (or clone a template). -2. Add **`ProjectReference`** to **`gregCore/framework/gregCore.csproj`** (see **`mods/GregShowcaseMod/`**). -3. Use **`gregFramework.Core`** (`GregEventDispatcher`, `GregHookName`, `GregNativeEventHooks`, ). -4. Templates: **`gregCore/Templates/greg.BasedModTemplate/`** or mirrored templates under **`gregDataCenterExporter/Templates/`**. - -Reference mod: **`mods/GregShowcaseMod/`** [Documentation hub](/wiki/developers). - -## Documentation site (`gregWiki/`) - -- Markdown under **`gregWiki/docs/`** -- Docker: from **`gregWiki/`** root see **`gregWiki/README.md`** -- MCP: [MCP references](/wiki/developers) server code under **`gregAddons/mcp-server/`** - - diff --git a/docs/02_development/_category_.json b/docs/02_development/_category_.json deleted file mode 100644 index a9144dae..00000000 --- a/docs/02_development/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 2, - "label": "??? Development" -} - diff --git a/docs/02_development/api-reference/hooks-catalog.md b/docs/02_development/api-reference/hooks-catalog.md deleted file mode 100644 index c570ae88..00000000 --- a/docs/02_development/api-reference/hooks-catalog.md +++ /dev/null @@ -1,159 +0,0 @@ ---- -id: greg-hooks-catalog -title: greg hooks catalog -slug: /reference/greg-hooks-catalog -description: Auto-generated catalog of native pipeline hook strings from GregNativeEventHooks. ---- - - - -# greg hooks catalog - -This page is **generated** from `gregCore/framework/Sdk/GregNativeEventHooks.cs` and `EventIds` in `EventDispatcher.cs`. - -**Generated:** 2026-04-10 02:43:33 UTC - -## Hook string constants - -| C# field | Hook string / expression | -|----------|----------------------------| -| ``NetworkBrokenSwitchAdded`` | ``greg.NETWORK.BrokenSwitchAdded`` | -| ``NetworkClearAllCables`` | ``greg.NETWORK.ClearAllCables`` | -| ``NetworkConnectionSpeedSet`` | ``greg.NETWORK.ConnectionSpeedSet`` | -| ``NetworkCreateNewCable`` | ``greg.NETWORK.CreateNewCable`` | -| ``NetworkInsertSfp`` | ``greg.NETWORK.InsertSFP`` | -| ``NetworkBrokenSwitchRemoved`` | ``greg.NETWORK.oveBrokenSwitchRemoved`` | -| ``NetworkPositionRemoved`` | ``greg.NETWORK.ovePositionRemoved`` | -| ``NetworkSfpRemoved`` | ``greg.NETWORK.oveSFPRemoved`` | -| ``PlayerCoinChanged`` | ``greg.PLAYER.CoinChanged`` | -| ``PlayerReputationChanged`` | ``greg.PLAYER.ReputationChanged`` | -| ``PlayerXpChanged`` | ``greg.PLAYER.XPChanged`` | -| ``RackButtonUnmountRack`` | ``greg.RACK.ButtonUnmountRack`` | -| ``ServerAppIdChanged`` | ``greg.SERVER.AppIDChanged`` | -| ``ServerCustomerChanged`` | ``greg.SERVER.CustomerChanged`` | -| ``ServerDeviceRepaired`` | ``greg.SERVER.DeviceRepaired`` | -| ``ServerItIsBroken`` | ``greg.SERVER.ItIsBroken`` | -| ``ServerPowerButton`` | ``greg.SERVER.PowerButton`` | -| ``ServerRegisterLink`` | ``greg.SERVER.RegisterLink`` | -| ``ServerInsertedInRack`` | ``greg.SERVER.ServerInsertedInRack`` | -| ``ServerUnregisterLink`` | ``greg.SERVER.UnregisterLink`` | -| ``SystemButtonBuyShopItem`` | ``greg.SYSTEM.ButtonBuyShopItem`` | -| ``SystemButtonBuyWall`` | ``greg.SYSTEM.ButtonBuyWall`` | -| ``SystemButtonCheckOut`` | ``greg.SYSTEM.ButtonCheckOut`` | -| ``SystemButtonClear`` | ``greg.SYSTEM.ButtonClear`` | -| ``SystemButtonConfirmFireEmployee`` | ``greg.SYSTEM.ButtonConfirmFireEmployee`` | -| ``SystemButtonConfirmHire`` | ``greg.SYSTEM.ButtonConfirmHire`` | -| ``SystemButtonCustomerChosen`` | ``greg.SYSTEM.ButtonCustomerChosen`` | -| ``SystemSpawnedItemRemoved`` | ``greg.SYSTEM.oveSpawnedItemRemoved`` | -| ``SystemSnapshotSaved`` | ``greg.SYSTEM.SnapshotSaved`` | -| ``UnknownNativeEvent`` | ``greg.SYSTEM.UnmappedNativeEvent`` | -| ``CustomerAppRequirementsFailed`` | ``GregHookName.Create(GregDomain.Customer, "AppRequirementsFailed")`` | -| ``CustomerAppRequirementsSatisfied`` | ``GregHookName.Create(GregDomain.Customer, "AppRequirementsSatisfied")`` | -| ``EmployeeCustomFired`` | ``GregHookName.Create(GregDomain.Employee, "CustomFired")`` | -| ``EmployeeCustomHired`` | ``GregHookName.Create(GregDomain.Employee, "CustomHired")`` | -| ``NetworkNetWatchDispatched`` | ``GregHookName.Create(GregDomain.Network, "NetWatchDispatched")`` | -| ``SystemAutoSaveRequested`` | ``GregHookName.Create(GregDomain.System, "AutoSaveRequested")`` | -| ``SystemGameDayAdvanced`` | ``GregHookName.Create(GregDomain.System, "GameDayAdvanced")`` | -| ``SystemGameLoaded`` | ``GregHookName.Create(GregDomain.System, "GameLoaded")`` | -| ``SystemGameSaved`` | ``GregHookName.Create(GregDomain.System, "GameSaved")`` | -| ``SystemHookBridgeInstalled`` | ``GregHookName.Create(GregDomain.System, "HookBridgeInstalled")`` | -| ``SystemHookBridgeTriggered`` | ``GregHookName.Create(GregDomain.System, "HookBridgeTriggered")`` | - -## UI Hooks `greg.UI.*` - -All UI hooks fire AFTER the game's UI method completes (Postfix). -Mod devs subscribe via `GregHookBus.On("greg.UI.X.Y", handler)`. - -### greg.UI.Canvas.Ready -| Field | Value | -|-------|-------| -| Status | `ENABLED` | -| Layer | GregUIManager | -| Trigger | Root canvas found after scene init | -| Payload | `{ canvasName: string }` | -| Since | v1.0.0.7 | - -### greg.UI.MainMenu.Opened -| Field | Value | -|-------|-------| -| Status | `ENABLED` | -| Layer | Patch MainMenuStartPatch | -| Trigger | Main menu screen starts | -| Payload | `{ instanceId: int }` | -| Since | v1.0.0.7 | - -### greg.UI.PauseMenu.Opened -| Field | Value | -|-------|-------| -| Status | `ENABLED` | -| Layer | Patch PauseMenuOpenPatch | -| Trigger | Pause menu is enabled | -| Payload | `{ instanceId: int }` | -| Since | v1.0.0.7 | - -### greg.UI.PauseMenu.Closed -| Field | Value | -|-------|-------| -| Status | `ENABLED` | -| Layer | Patch PauseMenuClosePatch | -| Trigger | Pause menu is disabled | -| Payload | `{ instanceId: int }` | -| Since | v1.0.0.7 | - -## Event id to hook mapping - -| Event id (uint) | EventIds name | GregNativeEventHooks field | Hook string | -|-----------------|---------------|----------------------------|-------------| -| 213 | `CableCleared` | `NetworkClearAllCables` | `greg.NETWORK.ClearAllCables` | -| 204 | `CableConnected` | `ServerRegisterLink` | `greg.SERVER.RegisterLink` | -| 211 | `CableCreated` | `NetworkCreateNewCable` | `greg.NETWORK.CreateNewCable` | -| 205 | `CableDisconnected` | `ServerUnregisterLink` | `greg.SERVER.UnregisterLink` | -| 212 | `CableRemoved` | `NetworkPositionRemoved` | `greg.NETWORK.ovePositionRemoved` | -| 215 | `CableSfpInserted` | `NetworkInsertSfp` | `greg.NETWORK.InsertSFP` | -| 216 | `CableSfpRemoved` | `NetworkSfpRemoved` | `greg.NETWORK.oveSFPRemoved` | -| 214 | `CableSpeedChanged` | `NetworkConnectionSpeedSet` | `greg.NETWORK.ConnectionSpeedSet` | -| 1001 | `CustomEmployeeFired` | `EmployeeCustomFired` | `GregHookName.Create(GregDomain.Employee, "CustomFired")` | -| 1000 | `CustomEmployeeHired` | `EmployeeCustomHired` | `GregHookName.Create(GregDomain.Employee, "CustomHired")` | -| 400 | `CustomerAccepted` | `SystemButtonCustomerChosen` | `greg.SYSTEM.ButtonCustomerChosen` | -| 401 | `CustomerSatisfied` | `CustomerAppRequirementsSatisfied` | `GregHookName.Create(GregDomain.Customer, "AppRequirementsSatisfied")` | -| 402 | `CustomerUnsatisfied` | `CustomerAppRequirementsFailed` | `GregHookName.Create(GregDomain.Customer, "AppRequirementsFailed")` | -| 300 | `DayEnded` | `SystemGameDayAdvanced` | `GregHookName.Create(GregDomain.System, "GameDayAdvanced")` | -| 601 | `EmployeeFired` | `SystemButtonConfirmFireEmployee` | `greg.SYSTEM.ButtonConfirmFireEmployee` | -| 600 | `EmployeeHired` | `SystemButtonConfirmHire` | `greg.SYSTEM.ButtonConfirmHire` | -| 702 | `GameAutoSaved` | `SystemAutoSaveRequested` | `GregHookName.Create(GregDomain.System, "AutoSaveRequested")` | -| 701 | `GameLoaded` | `SystemGameLoaded` | `GregHookName.Create(GregDomain.System, "GameLoaded")` | -| 700 | `GameSaved` | `SystemGameSaved` | `GregHookName.Create(GregDomain.System, "GameSaved")` | -| 1100 | `HookBridgeInstalled` | `SystemHookBridgeInstalled` | `GregHookName.Create(GregDomain.System, "HookBridgeInstalled")` | -| 1101 | `HookBridgeTriggered` | `SystemHookBridgeTriggered` | `GregHookName.Create(GregDomain.System, "HookBridgeTriggered")` | -| 100 | `MoneyChanged` | `PlayerCoinChanged` | `greg.PLAYER.CoinChanged` | -| 301 | `MonthEnded` | `SystemSnapshotSaved` | `greg.SYSTEM.SnapshotSaved` | -| 900 | `NetWatchDispatched` | `NetworkNetWatchDispatched` | `GregHookName.Create(GregDomain.Network, "NetWatchDispatched")` | -| 208 | `RackUnmounted` | `RackButtonUnmountRack` | `greg.RACK.ButtonUnmountRack` | -| 102 | `ReputationChanged` | `PlayerReputationChanged` | `greg.PLAYER.ReputationChanged` | -| 207 | `ServerAppChanged` | `ServerAppIdChanged` | `greg.SERVER.AppIDChanged` | -| 201 | `ServerBroken` | `ServerItIsBroken` | `greg.SERVER.ItIsBroken` | -| 206 | `ServerCustomerChanged` | `ServerCustomerChanged` | `greg.SERVER.CustomerChanged` | -| 203 | `ServerInstalled` | `ServerInsertedInRack` | `greg.SERVER.ServerInsertedInRack` | -| 200 | `ServerPowered` | `ServerPowerButton` | `greg.SERVER.PowerButton` | -| 202 | `ServerRepaired` | `ServerDeviceRepaired` | `greg.SERVER.DeviceRepaired` | -| 502 | `ShopCartCleared` | `SystemButtonClear` | `greg.SYSTEM.ButtonClear` | -| 500 | `ShopCheckout` | `SystemButtonCheckOut` | `greg.SYSTEM.ButtonCheckOut` | -| 501 | `ShopItemAdded` | `SystemButtonBuyShopItem` | `greg.SYSTEM.ButtonBuyShopItem` | -| 503 | `ShopItemRemoved` | `SystemSpawnedItemRemoved` | `greg.SYSTEM.oveSpawnedItemRemoved` | -| 209 | `SwitchBroken` | `NetworkBrokenSwitchAdded` | `greg.NETWORK.BrokenSwitchAdded` | -| 210 | `SwitchRepaired` | `NetworkBrokenSwitchRemoved` | `greg.NETWORK.oveBrokenSwitchRemoved` | -| 800 | `WallPurchased` | `SystemButtonBuyWall` | `greg.SYSTEM.ButtonBuyWall` | -| 101 | `XPChanged` | `PlayerXpChanged` | `greg.PLAYER.XPChanged` | - -## Fallback - -Unknown event ids resolve to ``greg.SYSTEM.UnmappedNativeEvent`` via ``GregNativeEventHooks.Resolve``. - -## See also - -- [greg hook naming](/wiki/reference/greg-hook-naming) -- [EventIds source](https://github.com/mleem97/gregFramework/blob/main/gregCore/framework/ModLoader/EventDispatcher.cs) -- [GregNativeEventHooks source](https://github.com/mleem97/gregFramework/blob/main/gregCore/framework/Sdk/GregNativeEventHooks.cs) -- [Greg hooks & event runtime](/wiki/development/concepts/hooks-and-events) - - diff --git a/docs/02_development/api-reference/naming-conventions.md b/docs/02_development/api-reference/naming-conventions.md deleted file mode 100644 index a27d3c7a..00000000 --- a/docs/02_development/api-reference/naming-conventions.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -id: greg-hook-naming -title: greg hook and event naming -slug: /reference/greg-hook-naming -description: Canonical naming for hooks, events, and cross-language documentation stubs. ---- - -# greg hook and event naming - -## Target format - -All **new** public hook and event identifiers should follow: - -```text -greg.. -``` - -- **`greg`** Fixed prefix (Greg Mod Framework / **gregFramework** hook namespace). -- **``** Uppercase domain from the [approved domain list](#approved-domain-segments). Describes *where* the signal belongs in the game (player, rack, server, economy, ). -- **``** `PascalCase` segment(s), usually `OnSomething` for events or a verb phrase for commands. - -Examples (illustrative): `greg.RACK.CableSpinnerColorResolved`, `greg.PLAYER.InputPoll`, `greg.NETWORK.Cable.OnConnected`. - -## Approved domain segments - -Domains are **closed by default**. Add a new domain only via changelog + maintainer review. - -| Domain | Scope | -|--------|--------| -| `GAMEPLAY` | Rules, scoring, simulation beats not covered elsewhere | -| `PLAYER` | Local player input, camera, UI focus | -| `EMPLOYEE` | NPC staff, hiring, schedules | -| `CUSTOMER` | Contracts, SLA, satisfaction | -| `SERVER` | In-game server racks, VMs, power | -| `RACK` | Physical rack placement, mounting | -| `NETWORK` | Cables, switches, traffic | -| `STORE` | Shop cart, checkout | -| `WORLD` | Rooms, expansion, walls | -| `UI` | HUD overlays, menus (when not `PLAYER`) | -| `SAVE` | Save/load lifecycle | -| `FRAMEWORK` | Loader, bridge, diagnostics | - -## Runtime IL2CPP (MelonLoader): `greg.*` - -Harmony patches in **gregFramework** emit stable **`greg..`** strings via `GregHookName` / `GregEventDispatcher`. That surface is documented in **[greg hooks catalog (IL2CPP)](/wiki/reference/greg-hooks-catalog)** (`greg_hooks.json`, regeneration, overlap with hand-written `HarmonyPatches`). It is separate from the `greg.*` / `greg.*` documentation constants below. - -## Native pipeline: `GregNativeEventHooks` (replaces `HookNames`) - -Numeric **`EventIds`** are mapped to canonical **`greg.*`** strings in **`GregNativeEventHooks`** ([source](https://github.com/mleem97/gregFramework/blob/main/gregCore/framework/Sdk/GregNativeEventHooks.cs)), aligned with **`greg_hooks.json`** where that file names the patched method. Logging uses **`GregNativeEventHooks.Resolve(uint)`**; unknown ids ? **`greg.SYSTEM.UnmappedNativeEvent`**. - -**`GregCompatBridge`** ([source](https://github.com/mleem97/gregFramework/blob/main/gregCore/framework/Sdk/GregCompatBridge.cs)) redirects **deprecated** hook spellings (including older documentation-style names) to the current **`greg.*`** string see also `legacy` entries in **`greg_hooks.json`**. - -**Policy** - -- New **documentation** identifiers: **`greg..*`** as above. -- New **runtime** subscriptions: always **`greg.*`** via **`GregHookName.Create`** or **`GregNativeEventHooks`** constants see [greg hooks catalog](/wiki/reference/greg-hooks-catalog). - -## Cross-language stubs (documentation) - -For each canonical hook, the wiki may add **non-normative** snippets: - -| Language | Convention | -|----------|------------| -| C# | `greg.Domain.OnSomething.Subscribe(...)` or string literal | -| Lua | `greg.Domain.OnSomething:subscribe(...)` | -| Rust | `greg::domain::on_something::subscribe(...)` | -| Python | `greg.domain.on_something.subscribe(...)` | -| TypeScript | `greg.Domain.OnSomething.subscribe(...)` | - -Bindings are **not** auto-generated for all languages; stubs are for contributor clarity. - -## Related - -- [greg hooks catalog](/wiki/reference/greg-hooks-catalog) EventId ? **`greg.*`** (generated) -- [greg hooks catalog](/wiki/reference/greg-hook-naming) Short overview / Redirect -- [greg hooks](/wiki/reference/greg-hook-naming) declarative surface (may be superseded by the core registry) - - diff --git a/docs/02_development/concepts/hooks-and-events.md b/docs/02_development/concepts/hooks-and-events.md deleted file mode 100644 index f365c840..00000000 --- a/docs/02_development/concepts/hooks-and-events.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: Greg hooks & event runtime -sidebar_label: Greg hooks & events -description: greg.* hooks, GregEventDispatcher, GregNativeEventHooks, greg_hooks.json, Rust FFI event ids, and compat aliases. ---- - -# Greg hooks & event runtime - -The **`gregCore.dll`** assembly is built from **`gregCore/framework/gregCore.csproj`** and combines Harmony patches, C# events (`GregEventDispatcher`), and the Rust/native bridge. Mod authors mainly care about **three surfaces**: - -| Surface | Role | Typical entry | -|---------|------|----------------| -| **`greg.*` hook strings** | Canonical names for Harmony/mod code; registry in **`greg_hooks.json`**. | `GregEventDispatcher.On("greg....", handler, modId)` in **`gregFramework.Core`** | -| **Native pipeline (`EventIds` ? `greg.*`)** | Same gameplay moments as FFI events; centralized in **`GregNativeEventHooks`**. | Constants / `Resolve(uint)` on **`gregFramework.Core.GregNativeEventHooks`** | -| **Legacy aliases** | Old spellings ? canonical **`greg.*`**. | **`GregCompatBridge`** (+ optional **`legacy`** entries in **`greg_hooks.json`**) | - -New **documentation** identifiers still follow **`greg..*`** see [greg hook naming](/wiki/reference/greg-hook-naming). **Runtime** strings for the native chain are **`greg.*`** as defined by **`GregNativeEventHooks`** and **`greg_hooks.json`**. - -## `greg_hooks.json` (version 2) - -| Path | Role | -|------|------| -| **Repo root** `greg_hooks.json` | Source of truth: `name`, `patchTarget`, `strategy`, `payloadSchema`, optional `legacy`. | -| **Next to `gregCore.dll`** | Copied from the monorepo root on build so **`GregCompatBridge`** can resolve legacy names. | - -Regenerate: `gregCore/scripts/Generate-GregHooksFromIl2CppDump.ps1` when Il2Cpp/interop inputs change. - -## `GregEventDispatcher` / SDK - -Implementation: **`gregCore/framework/Sdk/GregEventDispatcher.cs`** (`namespace gregFramework.Core`). API: **`On` / `Once` / `Off` / `Emit`**, **`OnCancelable` / `InvokeCancelable`**, **`UnregisterAll(modId)`**. - -Build stable hook strings with **`GregHookName.Create(GregDomain.*, "Action")`** or **`GregNativeEventHooks.*`** constants. - -## Native events (`EventIds`) - -- **`EventIds` and `EventDispatcher`:** `gregCore/framework/ModLoader/EventDispatcher.cs` (numeric ids aligned with Rust). -- **Mapping ? `greg.*`:** **`GregNativeEventHooks`** (`gregCore/framework/Sdk/GregNativeEventHooks.cs`); emission via **`GregHookIntegration`** in the same ModLoader tree. -- **Wiki table:** [greg hooks catalog](/wiki/reference/greg-hooks-catalog) (generator: `gregCore/tools/Generate-GregHookCatalog.ps1`). - -## Lua event & hook subscriptions - -Lua scripts subscribe to the same event surfaces through the `greg.*` API injected by `GregHooksLuaModule`: - -| Lua API | C# backend | Purpose | -|---------|-----------|---------| -| `greg.on(hookName, fn)` | `GregEventDispatcher.On()` | Subscribe to any `greg.*` event receives payload as Lua table | -| `greg.off(hookName)` | `GregEventDispatcher.Off()` | Unsubscribe all Lua handlers for a hook | -| `greg.emit(hookName, payload)` | `GregEventDispatcher.Emit()` | Emit a custom event (other Lua/C# listeners receive it) | -| `greg.hook.before(hookName, fn)` | `HookBinder.OnBefore()` | Harmony **prefix** fn receives `{hook_name, type_name, method_name, instance_handle, arg_count}` | -| `greg.hook.after(hookName, fn)` | `HookBinder.OnAfter()` | Harmony **postfix** same context table | -| `greg.hook.off(hookName)` | `HookBinder.Unregister()` | Remove all handlers for a Harmony hook | - -**Example** react to CableSpinner.Start in Lua: - -```lua -greg.hook.after("greg.Misc.OnStart", function(ctx) - if ctx.type_name and ctx.type_name:find("CableSpinner") then - greg.log("new spinner spawned, handle: " .. tostring(ctx.instance_handle)) - end -end) -``` - -**Example** listen to game events: - -```lua -greg.on("greg.PLAYER.CoinChanged", function(payload) - greg.log("coins changed by " .. tostring(payload.coinChangeAmount)) -end) -``` - -All hook names from `GregNativeEventHooks` (e.g. `greg.PLAYER.CoinChanged`, `greg.SERVER.PowerButton`) and `HookBinder` aliases (e.g. `greg.Misc.OnStart`) are available to Lua. - -## Rust FFI - -Rust/native mods receive **numeric** event ids; C# mirrors the same moments as **`greg.*`** through **`GregHookIntegration`** while the game runs. The `RustLanguageBridgeAdapter` fully delegates all lifecycle calls (`OnUpdate`, `OnSceneLoaded`, `Shutdown`, event dispatch) to `FFIBridge`. Bridge code: **`FfiBridge.cs`** / **`RustLanguageBridgeAdapter.cs`** under `framework/ModLoader/`. - -## MelonLoader entry points (one DLL) - -Depending on the build, multiple **`MelonMod`** types may ship in the same assembly (e.g. main framework plugin vs. AssetExporter paths) check **`MelonInfo`** / **`MelonGame`** in source. - -## Tooling - -- **MCP:** `greg_hook_registry`, `greg_hook_search`, with `dataRoot` ? **`gregCore/`** [MCP references](/wiki/developers). -- **[greg hooks catalog](/wiki/reference/greg-hook-naming)** is now a **short redirect** to **`GregNativeEventHooks`** / [greg hooks catalog](/wiki/reference/greg-hooks-catalog) (the old **`HookNames.cs`** table is gone). - -## See also - -- [Repository architecture](/wiki/getting-started/architecture) -- [FFI, hooks & Lua (hub)](/wiki/development/concepts/hooks-and-events) -- [Getting started](/wiki/getting-started/quickstart) - - diff --git a/docs/02_development/concepts/modding-basics.md b/docs/02_development/concepts/modding-basics.md deleted file mode 100644 index 70dc9dcd..00000000 --- a/docs/02_development/concepts/modding-basics.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -id: developers -title: Documentation hub -sidebar_label: Documentation hub -slug: /developers -description: Technical documentation for mod authors, plugin authors, and repo contributors hooks, workspace, releases, and internals. ---- - -# Documentation hub - -Use this index if you **build mods or plugins**, work on **framework** code, or contribute to **repositories and docs**. - -**Players** install and troubleshooting: **[For players](/players)** (not part of this wiki sidebar). - -**Architecture:** read **[System architecture & documentation principles](/wiki/getting-started/architecture)** first canonical **ModManager ? Framework ? Plugins ? Mods** model, priorities (stability, maintainability, DX), and wiki writing rules. - -## Workspace & onboarding - -- [Getting started](/wiki/getting-started/quickstart) split-repo layout, build core, hook naming -- [Documentation layout](/wiki/getting-started/quickstart) how `docs/` is organized -- [Workspace map](/wiki/getting-started/architecture) folders on disk - -## Framework - -- [Architecture](/wiki/getting-started/architecture) -- [Greg hooks & event runtime](/wiki/development/concepts/hooks-and-events) -- [greg hooks](/wiki/reference/greg-hook-naming) -- [Hexmod](/wiki/developers) - -## Plugins (`greg.Plugin.*`) & mods (`greg.*`) - -- [Plugins overview](/mods) -- [Mods overview](/mods) gameplay mods and framework catalog - -## Guides (authors & repo) - -- [Mod developers](/wiki/developers) -- [Contributors (workflow)](/wiki/contributors/docusaurus-workflow) -- [Contributor workshop](/wiki/contributors/docusaurus-workflow) -- [Release guide](/wiki/developers) -- [Sponsors](/wiki/legal/sponsors) - -## Tools & meta (advanced) - -- [Steam Workshop & tooling](/wiki/developers) -- [Devserver betas](/wiki/developers) -- [IDEA backlog](/wiki/developers) - -## Releases - -- [Releases index](/wiki/developers) - -## Reference - -- [Wiki mapping](/wiki/developers) -- [Mod store vision](/wiki/developers) -- [greg hook naming](/wiki/reference/greg-hook-naming) -- [greg hooks catalog](/wiki/reference/greg-hook-naming) -- [MCP server](/wiki/developers) -- [Release channels](/wiki/developers) where authors publish (Workshop vs GitHub); players see a short summary on [/players](/players) -- [Reference data files](/wiki/developers) -- [Modding language requirement](/wiki/developers) - -## Topics - -- [Topics hub](/wiki/developers) - -## Contributors (workflow) - -- [Repo inventory](/wiki/contributors/docusaurus-workflow) -- [Monorepo target layout](/wiki/contributors/docusaurus-workflow) -- [Design system](/wiki/contributors/docusaurus-workflow) -- [Docusaurus workflow](/wiki/contributors/docusaurus-workflow) -- [Plugin submission audit](/wiki/contributors/docusaurus-workflow) -- [Sponsorship automation](/wiki/contributors/docusaurus-workflow) - -## Roadmap - -- [Unified roadmap](/wiki/developers) -- [Mod store stages](/wiki/developers) - -## Sponsors - -- [SPONSORS](/wiki/legal/sponsors) - - diff --git a/docs/02_development/framework-readiness.md b/docs/02_development/framework-readiness.md deleted file mode 100644 index efb25652..00000000 --- a/docs/02_development/framework-readiness.md +++ /dev/null @@ -1,204 +0,0 @@ ---- -id: framework-readiness -title: FRAMEWORK READINESS — gregCore vs Community Feature Requests -slug: /developers/framework-readiness -description: Structured readiness analysis for gregCore against the full A-H community requirement catalog. ---- - -## 1. Executive Summary - -Analysierter Umfang: **43** Community-Anforderungen (A-01 bis H-03). - -| Status | Anzahl | Bedeutung | -| --- | ---: | --- | -| ✅ READY | 1 | Mit aktuell verifizierten Hooks/APIs direkt als Mod umsetzbar | -| ⚠️ PARTIAL | 24 | Teilweise umsetzbar, benötigt Framework-Erweiterung | -| ❌ MISSING | 14 | Framework-Komponente fehlt zwingend | -| 🚫 GAME-LEVEL | 4 | Erfordert Spielquellcode oder nicht freigelegte Spielsystme | - -Kernaussage: gregCore ist als **Hook-/Event-Backbone** solide (`GregNativeEventHooks`, `GregEventDispatcher`, `GregPayload`, `GregCompatBridge`), aber nicht vollständig als **Content-Registry-Framework** (typed registries, model-override service, domain services). - -## 2. Analyse-Methodik - -- **Priorität angewendet:** Wiki zuerst, Repository als Verifikation. -- **Wiki-Sources (parallel geprüft):** - - `docs/02_development/concepts/hooks-and-events.md` - - `docs/02_development/api-reference/hooks-catalog.md` - - `docs/content-creation/implementation-backlog.md` -- **Repository-Sources (parallel geprüft):** - - `gregCore/gregSdk/gregNativeEventHooks.cs` - - `gregCore/gregSdk/gregEventDispatcher.cs` - - `gregCore/gregSdk/gregPayload.cs` - - `gregCore/gregSdk/gregCompatBridge.cs` - - `gregCore/gregMain.cs` - - `gregCore/gregModLoader/Plugins/gregPluginBase.cs` - - `gregCore/gregModLoader/Plugins/gregRegistry.cs` - -Bewertungslogik: - -- ✅ READY: Ohne neue Framework-Verträge realisierbar. -- ⚠️ PARTIAL: Technisch startbar, aber stabiler Betrieb braucht SDK/Plugin-Erweiterung. -- ❌ MISSING: Notwendige Framework-Fähigkeit existiert nicht. -- 🚫 GAME-LEVEL: Ohne tiefe, nicht dokumentierte Spielintegration nicht realistisch. - -## 3. Readiness-Matrix - -| ID | Feature | Status | Verfügbare Hooks/APIs | Fehlende Komponente | Layer | -| --- | --- | --- | --- | --- | --- | -| A-01 | Mitarbeiter tanzen bei Idle | ⚠️ PARTIAL | `greg.EMPLOYEE.CustomHired`, `greg.SYSTEM.ButtonConfirmHire` | Employee idle-state hooks/service | harmony + SDK | -| A-02 | Mitarbeiter-KI erweiterbar | ❌ MISSING | Hire/fire hooks, EventBus | AI state-machine extension API | harmony + SDK | -| A-03 | Neue Mitarbeiter-Typen | ⚠️ PARTIAL | `GregEventDispatcher`, `GregPayload` | `GregEmployeeRegistry` | SDK + Plugin | -| B-01 | Vorkonfigurierte Switches | ⚠️ PARTIAL | `greg.SYSTEM.ButtonBuyShopItem`, `greg.NETWORK.InsertSFP` | Purchase post-processor service | harmony + SDK | -| B-02 | Switch-Port-Konfigurator | ❌ MISSING | Network hooks vorhanden | Per-port config model/API | SDK | -| B-03 | Mehr Rear-Ports | ⚠️ PARTIAL | Cable/register hooks | `GregSwitchRegistry` | SDK | -| B-04 | 1HE High-Density-Switches | ⚠️ PARTIAL | Rack/server hooks | Rack geometry/constraints API | harmony + SDK | -| B-05 | Massenbestückung Modul-Box | ⚠️ PARTIAL | SFP hooks | Batch port operation service | SDK | -| B-06 | Kabel-Manager auto-routing | ❌ MISSING | Cable create/remove hooks | Topology routing service | SDK + Plugin | -| B-07 | Cable-Audit-Mode | ⚠️ PARTIAL | Cable/link hooks, NetWatch | Topology audit + highlight adapter | Plugin + UI | -| B-08 | Farbenblind-Modus Kabeltypen | ✅ READY | UI overlay + hook data | Optional helper only | Mod Layer | -| B-09 | WDM-Infrastruktur | 🚫 GAME-LEVEL | Generic network hooks only | Optical simulation model | game-level | -| B-10 | Managed Switch VLAN/Tagging | ❌ MISSING | Link/connect events | VLAN policy engine | SDK + gameplay | -| B-11 | DHCP-Server Feature | ❌ MISSING | Event surface limited | Lease/allocation service | SDK + gameplay | -| B-12 | Größere Port-Boxen | ⚠️ PARTIAL | Shop events | Inventory container registry | SDK | -| C-01 | Höhertier-Server | ⚠️ PARTIAL | `greg.SERVER.*`, shop hooks | `GregServerRegistry` + balancing | SDK | -| C-02 | 1HE-Server | ⚠️ PARTIAL | rack mount/unmount hooks | Rack-unit constraint API | harmony + SDK | -| C-03 | Server-IOPS-Upgrade | ⚠️ PARTIAL | server/customer hooks | Upgrade path registry | SDK | -| C-04 | Höhertier-Kabel/Ports | ⚠️ PARTIAL | cable speed/sfp hooks | Cable/SFP typed registries | SDK | -| C-05 | iPerf/Speedtest im Spiel | ⚠️ PARTIAL | `greg.NETWORK.NetWatchDispatched` | Test session orchestration API | Plugin + SDK | -| D-01 | Unterschiedliche Kundenanforderungen | ⚠️ PARTIAL | `greg.SYSTEM.ButtonCustomerChosen`, customer req hooks | `GregCustomerRegistry` + rule engine | SDK | -| D-02 | Zufällige Kundenanforderungen | ⚠️ PARTIAL | customer acceptance hooks | Requirement generator service | Plugin + SDK | -| D-03 | Dynamische Preisschwankungen | ⚠️ PARTIAL | shop hooks | Dynamic pricing service | Plugin + SDK | -| D-04 | Stromverbrauch/Stromkosten | ⚠️ PARTIAL | server power hooks | Energy simulation service | SDK + gameplay | -| D-05 | Auto-IP-Vergabe | ⚠️ PARTIAL | server app-id and network hooks | IP allocation service | SDK | -| E-01 | Beschriftungs-Tapes | ⚠️ PARTIAL | rack/network hooks | Persistent label store + UI input | Plugin + UI | -| E-02 | Rack-Kopieren inkl. Kabel | ⚠️ PARTIAL | rack/network hooks | Topology clone transaction API | SDK + harmony | -| E-03 | HexViewer-Panel | ⚠️ PARTIAL | verified event bus + hooks | Unified metadata adapter for all entities | Plugin + SDK | -| E-04 | Inventar-Slots / Item-Leiste | ❌ MISSING | no verified inventory UI API | Inventory UI extension API | UI + Plugin | -| E-05 | Kühlung/Abwärme Anzeige+Gameplay | 🚫 GAME-LEVEL | no thermal hook surface | Cooling simulation model | game-level | -| F-01 | Lichter / Deckenlampen | ❌ MISSING | wall purchase hook only | Lighting registry + runtime controls | harmony + SDK | -| F-02 | Mehrere Stockwerke/Türen/Wände | 🚫 GAME-LEVEL | no structural building API | world-building systems | game-level | -| F-03 | Transport-Automatisierung | ❌ MISSING | no logistics hooks verified | transport actor framework | SDK + gameplay | -| F-04 | Dustpan & Brush cleanup | ⚠️ PARTIAL | `greg.SYSTEM.oveSpawnedItemRemoved` | world item type/action API | Plugin + SDK | -| F-05 | Stromversorgung für Racks | ⚠️ PARTIAL | power hooks available | power topology graph service | SDK | -| F-06 | Kühlungsmanagement aktiv | 🚫 GAME-LEVEL | no cooling event surface | cooling system integration | game-level | -| G-01 | Dynamische Events | ⚠️ PARTIAL | day/save/load hooks | incident scheduler/orchestrator | Plugin + SDK | -| G-02 | Hacker/DDoS/Firewall | ❌ MISSING | NetWatch + generic hooks | security simulation framework | Plugin + SDK + gameplay | -| G-03 | Kabel-Audit Farb-Highlights | ⚠️ PARTIAL | cable/netwatch hooks | topology analyzer + highlight API | Plugin + UI | -| G-04 | Performance-Mod | ⚠️ PARTIAL | `gregMain` lifecycle proof (`OnUpdate`, `OnGUI`) | standardized performance profile service | Plugin + SDK | -| H-01 | Austausch bestehender 3D-Modelle | ❌ MISSING | no official model override API | `GregModelOverrideService` | Plugin + SDK | -| H-02 | Eigene Modelle für neue Inhalte | ⚠️ PARTIAL | data-driven conventions possible | official model binding contract | SDK + Plugin | -| H-03 | NPC-Modelle für neue Mitarbeiter | ❌ MISSING | employee events only | employee visual binding registry | SDK + harmony | - -## 4. Detailanalyse pro Kategorie - -### A — Employee / NPC -- Heute möglich: Reaktion auf Einstellungs-/Entlassungsereignisse. -- Fehlend: Idle-state und AI-state hooks; registrierbare employee classes. -- Ziel-Layer: `gregSdk` + `harmony`. - -### B — Netzwerk / Switches / Ports -- Heute möglich: Beobachtung von Kabel-, SFP-, Link- und Speed-Ereignissen. -- Fehlend: Typed registries + compatibility matrix + route planner. -- Ziel-Layer: `gregSdk` zuerst, Plugin-Tools danach. - -### C — Server / Hardware -- Heute möglich: Server lifecycle/power/broken/repair Observability. -- Fehlend: server types, density constraints, upgrade contracts. -- Ziel-Layer: `gregSdk` + selective `harmony`. - -### D — Kunden / Wirtschaft -- Heute möglich: customer selection + requirement pass/fail events. -- Fehlend: customer policy engine, randomizer, dynamic pricing, power economy. -- Ziel-Layer: `gregSdk` + plugin policy modules. - -### E — UI / QoL -- Heute möglich: native OnGUI overlays and hook-driven panels. -- Fehlend: unified metadata adapter, inventory UI extension, persistent labels. -- Ziel-Layer: Plugin + SDK contracts. - -### F — Umgebung / Gebäude -- Heute möglich: begrenzte Reaktionen auf item remove / wall purchase. -- Fehlend: strukturelle Gebäude- und Klimasysteme. -- Ziel-Layer: überwiegend game-level, teils `harmony`-heavy. - -### G — Events / Gameplay -- Heute möglich: event triggering via day/save/load + telemetry hooks. -- Fehlend: orchestrator for incidents and security scenario system. -- Ziel-Layer: Plugin orchestrator + SDK contracts. - -### H — 3D / Visual -- Heute möglich: partielle model references in mod-side data. -- Fehlend: official model override/binding API with fallback/conflict handling. -- Ziel-Layer: Plugin runtime + SDK contract. - -## 5. Fehlende Framework-Komponenten (konsolidiert) - -### FEHLT: GregContentRegistry (typed categories) -**Betrifft Features:** A-03, B-03, B-12, C-01, C-03, C-04, D-01, H-02 -**Layer:** `framework/Sdk/` -**Warum nötig:** Ohne typed registries bleiben Inhalte modlokal und nicht frameworkweit konsistent. - -### FEHLT: GregNetworkCompatibilityService -**Betrifft Features:** B-01, B-02, B-05, B-06, B-10, B-11, C-04 -**Layer:** `framework/Sdk/` + plugins -**Warum nötig:** Port-/SFP-/Kabel-Regeln brauchen zentralen, reproduzierbaren Resolver. - -### FEHLT: GregEmployeeStateService -**Betrifft Features:** A-01, A-02, H-03 -**Layer:** `framework/harmony/` + `framework/Sdk/` -**Warum nötig:** Idle/AI transitions sind aktuell nicht als stabile Hook-Oberfläche verfügbar. - -### FEHLT: GregModelOverrideService -**Betrifft Features:** H-01, H-02, H-03, E-03 -**Layer:** plugins + SDK -**Warum nötig:** Kein offizieller runtime override lifecycle mit fallback und Konfliktauflösung. - -### FEHLT: GregCustomerPolicyEngine -**Betrifft Features:** D-01, D-02, D-05 -**Layer:** SDK -**Warum nötig:** Kundenregeln/Budget/Assignment sind nicht als offizieller Evaluator modelliert. - -### FEHLT: GregIncidentOrchestrator -**Betrifft Features:** G-01, G-02 -**Layer:** plugins + SDK hooks -**Warum nötig:** Dynamische Ereignisse brauchen Scheduler + lifecycle/state persistence. - -## 6. MISSING Status (Language Bridges) - -### 6.1 Konsolidierung aller aktuellen MISSING-Dateien - -| Datei | Fehlende Bereiche | Layer | -| --- | --- | --- | -| `plugins/greg.Plugin.HexViewer/lua/MISSING.md` | Lua event bridge, payload bridge, HUD bridge, targeting bridge | `framework/ModLoader`, `framework/Sdk` | -| `plugins/greg.Plugin.HexViewer/ts/MISSING.md` | TS event bridge, payload bridge, HUD bridge, targeting bridge | `framework/ModLoader`, `framework/Sdk` | -| `plugins/greg.Plugin.HexViewer/rs/MISSING.md` | Rust event bridge, payload bridge, HUD bridge, targeting bridge | `framework/ModLoader`, `framework/Sdk` | - -### 6.2 Zusammengefasste Lücken aus allen MISSING-Dateien - -- Es fehlt eine **dokumentierte LanguageBridge-Vertragsfläche** für Lua/TS/Rust (Subscribe, Update, GUI callbacks). -- Es fehlt eine **sprachübergreifende Payload-Bridge** mit stabilen Getter-Signaturen analog zu `GregPayload.Get(...)`. -- Es fehlt eine **native HUD-Bridge** (IMGUI proxy API) für Nicht-C#-Sprachen. -- Es fehlt eine **Targeting-Bridge** (Camera-forward Raycast) in allen Nicht-C#-Bridges. -- Ergebnis: HexViewer in Lua/TS/Rust bleibt **UNVERIFIED** bis die Bridge-Verträge offiziell dokumentiert und implementiert sind. - -## 7. Empfohlener Implementierungsplan - -### Phase 1 – Framework-Fundament (BLOCKING) -- Typed content registries -- Schema validation + cross-reference checks -- Network compatibility service -- Employee state hook expansion - -### Phase 2 – Feature-Layer -- Customer policy engine -- Model override service (with fallback/conflict) -- Topology audit service -- UI metadata adapter - -### Phase 3 – Mod-Layer (externe Modder) -- Content packs für server/switch/customer/cable/sfp/furniture -- QoL plugins (labels, cable audit, performance modes) - -### Phase 4 – Long-Term / GAME-LEVEL -- Features mit tiefer Spielsystem-Abhängigkeit (cooling simulation, advanced building, WDM, security minigame) - diff --git a/docs/02_development/hooks-library/customer/_category_.json b/docs/02_development/hooks-library/customer/_category_.json deleted file mode 100644 index b7bd64f6..00000000 --- a/docs/02_development/hooks-library/customer/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "CUSTOMER hooks", - "position": 1, - "collapsible": true, - "collapsed": true -} - diff --git a/docs/02_development/hooks-library/customer/greg-customer-appperformanceadded.md b/docs/02_development/hooks-library/customer/greg-customer-appperformanceadded.md deleted file mode 100644 index d9164dc2..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-appperformanceadded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.AppPerformanceAdded -sidebar_label: greg.CUSTOMER.AppPerformanceAdded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.AddAppPerformance" ---- - -# `greg.CUSTOMER.AppPerformanceAdded` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.AddAppPerformance - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::AddAppPerformance(int, float)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.AddAppPerformance | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.AppPerformanceAdded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.AppPerformanceAdded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.AppPerformanceAdded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.AppPerformanceAdded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.AppPerformanceAdded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.AppPerformanceAdded", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.AppPerformanceAdded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.AppPerformanceAdded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.AppPerformanceAdded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.AppPerformanceAdded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-apptext.md b/docs/02_development/hooks-library/customer/greg-customer-apptext.md deleted file mode 100644 index e82bb89c..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-apptext.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.AppText -sidebar_label: greg.CUSTOMER.AppText -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.AppText" ---- - -# `greg.CUSTOMER.AppText` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.AppText - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::AppText(int)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.AppText | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.AppText`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.AppText", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.AppText`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.AppText", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.AppText", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.AppText", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.AppText", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.AppText", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.AppText", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.AppText` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-componentinitialized.md b/docs/02_development/hooks-library/customer/greg-customer-componentinitialized.md deleted file mode 100644 index 010adbfd..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-componentinitialized.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.CUSTOMER.ComponentInitialized -sidebar_label: greg.CUSTOMER.ComponentInitialized -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.Awake" ---- - -# `greg.CUSTOMER.ComponentInitialized` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.Awake -- Auto-generated from Il2Cpp unpack: CustomerBase.Start - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **2** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.Awake | -| `Il2Cpp.CustomerBase::Start()` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.Start | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.ComponentInitialized`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.ComponentInitialized", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.ComponentInitialized`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.ComponentInitialized", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.ComponentInitialized", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.ComponentInitialized", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.ComponentInitialized", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.ComponentInitialized", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.ComponentInitialized", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.ComponentInitialized` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-customerservercountandspeedchanged.md b/docs/02_development/hooks-library/customer/greg-customer-customerservercountandspeedchanged.md deleted file mode 100644 index 31838f77..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-customerservercountandspeedchanged.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.CustomerServerCountAndSpeedChanged -sidebar_label: greg.CUSTOMER.CustomerServerCountAndSpeedChanged -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.UpdateCustomerServerCountAndSpeed" ---- - -# `greg.CUSTOMER.CustomerServerCountAndSpeedChanged` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.UpdateCustomerServerCountAndSpeed - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::UpdateCustomerServerCountAndSpeed(int, float)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.UpdateCustomerServerCountAndSpeed | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.CustomerServerCountAndSpeedChanged`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.CustomerServerCountAndSpeedChanged", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.CustomerServerCountAndSpeedChanged`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.CustomerServerCountAndSpeedChanged", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.CustomerServerCountAndSpeedChanged", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.CustomerServerCountAndSpeedChanged", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.CustomerServerCountAndSpeedChanged", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.CustomerServerCountAndSpeedChanged", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.CustomerServerCountAndSpeedChanged", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.CustomerServerCountAndSpeedChanged` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-dataloaded.md b/docs/02_development/hooks-library/customer/greg-customer-dataloaded.md deleted file mode 100644 index ecfd0a9e..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-dataloaded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.DataLoaded -sidebar_label: greg.CUSTOMER.DataLoaded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.LoadData" ---- - -# `greg.CUSTOMER.DataLoaded` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.LoadData - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::LoadData(CustomerBaseSaveData)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.LoadData | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.DataLoaded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.DataLoaded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.DataLoaded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.DataLoaded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.DataLoaded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.DataLoaded", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.DataLoaded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.DataLoaded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.DataLoaded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.DataLoaded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-getappidforip.md b/docs/02_development/hooks-library/customer/greg-customer-getappidforip.md deleted file mode 100644 index d0533c85..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-getappidforip.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.GetAppIDForIP -sidebar_label: greg.CUSTOMER.GetAppIDForIP -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.GetAppIDForIP" ---- - -# `greg.CUSTOMER.GetAppIDForIP` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.GetAppIDForIP - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::GetAppIDForIP(string)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.GetAppIDForIP | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.GetAppIDForIP`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.GetAppIDForIP", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.GetAppIDForIP`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.GetAppIDForIP", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.GetAppIDForIP", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.GetAppIDForIP", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.GetAppIDForIP", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.GetAppIDForIP", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.GetAppIDForIP", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.GetAppIDForIP` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-getservertypeforip.md b/docs/02_development/hooks-library/customer/greg-customer-getservertypeforip.md deleted file mode 100644 index e90eb7d3..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-getservertypeforip.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.GetServerTypeForIP -sidebar_label: greg.CUSTOMER.GetServerTypeForIP -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.GetServerTypeForIP" ---- - -# `greg.CUSTOMER.GetServerTypeForIP` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.GetServerTypeForIP - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::GetServerTypeForIP(string)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.GetServerTypeForIP | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.GetServerTypeForIP`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.GetServerTypeForIP", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.GetServerTypeForIP`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.GetServerTypeForIP", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.GetServerTypeForIP", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.GetServerTypeForIP", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.GetServerTypeForIP", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.GetServerTypeForIP", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.GetServerTypeForIP", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.GetServerTypeForIP` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-getsubnetsperapp.md b/docs/02_development/hooks-library/customer/greg-customer-getsubnetsperapp.md deleted file mode 100644 index 688c06e5..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-getsubnetsperapp.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.GetSubnetsPerApp -sidebar_label: greg.CUSTOMER.GetSubnetsPerApp -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.GetSubnetsPerApp" ---- - -# `greg.CUSTOMER.GetSubnetsPerApp` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.GetSubnetsPerApp - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::GetSubnetsPerApp()` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.GetSubnetsPerApp | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.GetSubnetsPerApp`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.GetSubnetsPerApp", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.GetSubnetsPerApp`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.GetSubnetsPerApp", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.GetSubnetsPerApp", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.GetSubnetsPerApp", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.GetSubnetsPerApp", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.GetSubnetsPerApp", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.GetSubnetsPerApp", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.GetSubnetsPerApp` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-gettotalappspeed.md b/docs/02_development/hooks-library/customer/greg-customer-gettotalappspeed.md deleted file mode 100644 index 1a5621f2..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-gettotalappspeed.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.GetTotalAppSpeed -sidebar_label: greg.CUSTOMER.GetTotalAppSpeed -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.GetTotalAppSpeed" ---- - -# `greg.CUSTOMER.GetTotalAppSpeed` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.GetTotalAppSpeed - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::GetTotalAppSpeed()` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.GetTotalAppSpeed | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.GetTotalAppSpeed`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.GetTotalAppSpeed", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.GetTotalAppSpeed`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.GetTotalAppSpeed", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.GetTotalAppSpeed", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.GetTotalAppSpeed", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.GetTotalAppSpeed", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.GetTotalAppSpeed", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.GetTotalAppSpeed", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.GetTotalAppSpeed` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-isippresent.md b/docs/02_development/hooks-library/customer/greg-customer-isippresent.md deleted file mode 100644 index 59b1a0bd..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-isippresent.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.IsIPPresent -sidebar_label: greg.CUSTOMER.IsIPPresent -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.IsIPPresent" ---- - -# `greg.CUSTOMER.IsIPPresent` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.IsIPPresent - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::IsIPPresent(string)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.IsIPPresent | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.IsIPPresent`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.IsIPPresent", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.IsIPPresent`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.IsIPPresent", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.IsIPPresent", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.IsIPPresent", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.IsIPPresent", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.IsIPPresent", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.IsIPPresent", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.IsIPPresent` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-resetallappspeeds.md b/docs/02_development/hooks-library/customer/greg-customer-resetallappspeeds.md deleted file mode 100644 index a1662290..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-resetallappspeeds.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.ResetAllAppSpeeds -sidebar_label: greg.CUSTOMER.ResetAllAppSpeeds -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.ResetAllAppSpeeds" ---- - -# `greg.CUSTOMER.ResetAllAppSpeeds` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.ResetAllAppSpeeds - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::ResetAllAppSpeeds()` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.ResetAllAppSpeeds | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.ResetAllAppSpeeds`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.ResetAllAppSpeeds", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.ResetAllAppSpeeds`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.ResetAllAppSpeeds", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.ResetAllAppSpeeds", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.ResetAllAppSpeeds", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.ResetAllAppSpeeds", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.ResetAllAppSpeeds", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.ResetAllAppSpeeds", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.ResetAllAppSpeeds` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-speedoncustomerbaseappchanged.md b/docs/02_development/hooks-library/customer/greg-customer-speedoncustomerbaseappchanged.md deleted file mode 100644 index 7f6bb1dc..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-speedoncustomerbaseappchanged.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.SpeedOnCustomerBaseAppChanged -sidebar_label: greg.CUSTOMER.SpeedOnCustomerBaseAppChanged -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.UpdateSpeedOnCustomerBaseApp" ---- - -# `greg.CUSTOMER.SpeedOnCustomerBaseAppChanged` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.UpdateSpeedOnCustomerBaseApp - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::UpdateSpeedOnCustomerBaseApp(int, float)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.UpdateSpeedOnCustomerBaseApp | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.SpeedOnCustomerBaseAppChanged`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.SpeedOnCustomerBaseAppChanged", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.SpeedOnCustomerBaseAppChanged`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.SpeedOnCustomerBaseAppChanged", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.SpeedOnCustomerBaseAppChanged", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.SpeedOnCustomerBaseAppChanged", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.SpeedOnCustomerBaseAppChanged", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.SpeedOnCustomerBaseAppChanged", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.SpeedOnCustomerBaseAppChanged", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.SpeedOnCustomerBaseAppChanged` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-upappset.md b/docs/02_development/hooks-library/customer/greg-customer-upappset.md deleted file mode 100644 index 87928000..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-upappset.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.UpAppSet -sidebar_label: greg.CUSTOMER.UpAppSet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.SetUpApp" ---- - -# `greg.CUSTOMER.UpAppSet` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.SetUpApp - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::SetUpApp(int, int, CustomerBaseSaveData)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.SetUpApp | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.UpAppSet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.UpAppSet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.UpAppSet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.UpAppSet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.UpAppSet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.UpAppSet", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.UpAppSet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.UpAppSet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.UpAppSet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.UpAppSet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/customer/greg-customer-upbaseset.md b/docs/02_development/hooks-library/customer/greg-customer-upbaseset.md deleted file mode 100644 index bfb31edd..00000000 --- a/docs/02_development/hooks-library/customer/greg-customer-upbaseset.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.CUSTOMER.UpBaseSet -sidebar_label: greg.CUSTOMER.UpBaseSet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CustomerBase.SetUpBase" ---- - -# `greg.CUSTOMER.UpBaseSet` - -## Description - -- Auto-generated from Il2Cpp unpack: CustomerBase.SetUpBase - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CustomerBase::SetUpBase(CustomerItem, CustomerBaseSaveData)` | Postfix | Auto-generated from Il2Cpp unpack: CustomerBase.SetUpBase | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.CUSTOMER.UpBaseSet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.CUSTOMER.UpBaseSet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.CUSTOMER.UpBaseSet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.CUSTOMER.UpBaseSet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.CUSTOMER.UpBaseSet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.CUSTOMER.UpBaseSet", |payload| { - if let Some(method) = payload.get("method") { - println!("[CUSTOMER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.CUSTOMER.UpBaseSet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[CUSTOMER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.CUSTOMER.UpBaseSet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.CUSTOMER.UpBaseSet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[CUSTOMER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.CUSTOMER.UpBaseSet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/economy/_category_.json b/docs/02_development/hooks-library/economy/_category_.json deleted file mode 100644 index 60e2a933..00000000 --- a/docs/02_development/hooks-library/economy/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Economy", - "position": 10 -} \ No newline at end of file diff --git a/docs/02_development/hooks-library/economy/greg-economy-playercoinupdated.md b/docs/02_development/hooks-library/economy/greg-economy-playercoinupdated.md deleted file mode 100644 index 431aa5cd..00000000 --- a/docs/02_development/hooks-library/economy/greg-economy-playercoinupdated.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: greg.economy.PlayerCoinUpdated -sidebar_label: greg.economy.PlayerCoinUpdated -description: "gregCore Hook — Player Coin Updated" ---- - -# `greg.economy.PlayerCoinUpdated` - -## Description - -- Emitted when the player's coin balance changes. - -## Payload Schema - -| Field | Type / Note | -|------|----------------| -| `type` | `valueChange` | -| `key` | `money` | -| `oldValue` | `float` | -| `newValue` | `float` | - -## How to use this hook - -### 1. Object Bus: `GregEventDispatcher` (Rust / FFI / Lua / TS) - -This hook is fired from the core via the `gregCore` plugin bridge whenever the underlying IL2CPP method (`Player.UpdateCoin`) executes successfully. - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.economy.PlayerCoinUpdated", payload => -{ - var newValue = GregPayload.Get(payload, "newValue", 0f); - // Logic here -}); -``` - -### 2. Usage in Lua - -Use the Lua bridge and register against the canonical hook string: - -~~~lua -greg.on("greg.economy.PlayerCoinUpdated", function(payload) - local newVal = payload and payload.newValue or 0 - greg.log("[ECONOMY] new money=" .. tostring(newVal)) -end) -~~~ diff --git a/docs/02_development/hooks-library/economy/greg-economy-playerreputationupdated.md b/docs/02_development/hooks-library/economy/greg-economy-playerreputationupdated.md deleted file mode 100644 index 36a6212b..00000000 --- a/docs/02_development/hooks-library/economy/greg-economy-playerreputationupdated.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: greg.economy.PlayerReputationUpdated -sidebar_label: greg.economy.PlayerReputationUpdated -description: "gregCore Hook — Player Reputation Updated" ---- - -# `greg.economy.PlayerReputationUpdated` - -## Description - -- Emitted when the player's reputation changes. - -## Payload Schema - -| Field | Type / Note | -|------|----------------| -| `type` | `valueChange` | -| `key` | `reputation` | -| `oldValue` | `float` | -| `newValue` | `float` | - -## How to use this hook - -### 1. Object Bus: `GregEventDispatcher` (Rust / FFI / Lua / TS) - -This hook is fired from the core via the `gregCore` plugin bridge whenever the underlying IL2CPP method (`Player.UpdateReputation`) executes successfully. - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.economy.PlayerReputationUpdated", payload => -{ - var newValue = GregPayload.Get(payload, "newValue", 0f); - // Logic here -}); -``` - -### 2. Usage in Lua - -Use the Lua bridge and register against the canonical hook string: - -~~~lua -greg.on("greg.economy.PlayerReputationUpdated", function(payload) - local newVal = payload and payload.newValue or 0 - greg.log("[ECONOMY] new reputation=" .. tostring(newVal)) -end) -~~~ diff --git a/docs/02_development/hooks-library/economy/greg-economy-playerxpupdated.md b/docs/02_development/hooks-library/economy/greg-economy-playerxpupdated.md deleted file mode 100644 index 1a9afd31..00000000 --- a/docs/02_development/hooks-library/economy/greg-economy-playerxpupdated.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: greg.economy.PlayerXpUpdated -sidebar_label: greg.economy.PlayerXpUpdated -description: "gregCore Hook — Player XP Updated" ---- - -# `greg.economy.PlayerXpUpdated` - -## Description - -- Emitted when the player's XP changes. - -## Payload Schema - -| Field | Type / Note | -|------|----------------| -| `type` | `valueChange` | -| `key` | `xp` | -| `oldValue` | `float` | -| `newValue` | `float` | - -## How to use this hook - -### 1. Object Bus: `GregEventDispatcher` (Rust / FFI / Lua / TS) - -This hook is fired from the core via the `gregCore` plugin bridge whenever the underlying IL2CPP method (`Player.UpdateXP`) executes successfully. - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.economy.PlayerXpUpdated", payload => -{ - var newValue = GregPayload.Get(payload, "newValue", 0f); - // Logic here -}); -``` - -### 2. Usage in Lua - -Use the Lua bridge and register against the canonical hook string: - -~~~lua -greg.on("greg.economy.PlayerXpUpdated", function(payload) - local newVal = payload and payload.newValue or 0 - greg.log("[ECONOMY] new xp=" .. tostring(newVal)) -end) -~~~ diff --git a/docs/02_development/hooks-library/employee/_category_.json b/docs/02_development/hooks-library/employee/_category_.json deleted file mode 100644 index 86e36825..00000000 --- a/docs/02_development/hooks-library/employee/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "EMPLOYEE hooks", - "position": 1, - "collapsible": true, - "collapsed": true -} - diff --git a/docs/02_development/hooks-library/employee/greg-employee-assignjob.md b/docs/02_development/hooks-library/employee/greg-employee-assignjob.md deleted file mode 100644 index 1c662a40..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-assignjob.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.AssignJob -sidebar_label: greg.EMPLOYEE.AssignJob -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Technician.AssignJob" ---- - -# `greg.EMPLOYEE.AssignJob` - -## Description - -- Auto-generated from Il2Cpp unpack: Technician.AssignJob - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Technician::AssignJob(TechnicianManager.RepairJob)` | Postfix | Auto-generated from Il2Cpp unpack: Technician.AssignJob | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.AssignJob`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.AssignJob", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.AssignJob`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.AssignJob", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.AssignJob", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.AssignJob", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.AssignJob", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.AssignJob", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.AssignJob", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.AssignJob` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-buttonfireemployee.md b/docs/02_development/hooks-library/employee/greg-employee-buttonfireemployee.md deleted file mode 100644 index 895d3428..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-buttonfireemployee.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.ButtonFireEmployee -sidebar_label: greg.EMPLOYEE.ButtonFireEmployee -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: HRSystem.ButtonFireEmployee" ---- - -# `greg.EMPLOYEE.ButtonFireEmployee` - -## Description - -- Auto-generated from Il2Cpp unpack: HRSystem.ButtonFireEmployee - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.HRSystem::ButtonFireEmployee(int)` | Postfix | Auto-generated from Il2Cpp unpack: HRSystem.ButtonFireEmployee | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.ButtonFireEmployee`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.ButtonFireEmployee", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.ButtonFireEmployee`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.ButtonFireEmployee", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.ButtonFireEmployee", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.ButtonFireEmployee", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.ButtonFireEmployee", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.ButtonFireEmployee", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.ButtonFireEmployee", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.ButtonFireEmployee` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-buttonhireemployee.md b/docs/02_development/hooks-library/employee/greg-employee-buttonhireemployee.md deleted file mode 100644 index 225d94e0..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-buttonhireemployee.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.ButtonHireEmployee -sidebar_label: greg.EMPLOYEE.ButtonHireEmployee -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: HRSystem.ButtonHireEmployee" ---- - -# `greg.EMPLOYEE.ButtonHireEmployee` - -## Description - -- Auto-generated from Il2Cpp unpack: HRSystem.ButtonHireEmployee - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.HRSystem::ButtonHireEmployee(int)` | Postfix | Auto-generated from Il2Cpp unpack: HRSystem.ButtonHireEmployee | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.ButtonHireEmployee`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.ButtonHireEmployee", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.ButtonHireEmployee`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.ButtonHireEmployee", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.ButtonHireEmployee", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.ButtonHireEmployee", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.ButtonHireEmployee", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.ButtonHireEmployee", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.ButtonHireEmployee", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.ButtonHireEmployee` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-componentinitialized.md b/docs/02_development/hooks-library/employee/greg-employee-componentinitialized.md deleted file mode 100644 index 3ec4b0aa..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-componentinitialized.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: greg.EMPLOYEE.ComponentInitialized -sidebar_label: greg.EMPLOYEE.ComponentInitialized -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Technician.Awake" ---- - -# `greg.EMPLOYEE.ComponentInitialized` - -## Description - -- Auto-generated from Il2Cpp unpack: Technician.Awake -- Auto-generated from Il2Cpp unpack: Technician.Start -- Auto-generated from Il2Cpp unpack: TechnicianManager.Awake - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **3** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Technician::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: Technician.Awake | -| `Il2Cpp.Technician::Start()` | Postfix | Auto-generated from Il2Cpp unpack: Technician.Start | -| `Il2Cpp.TechnicianManager::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: TechnicianManager.Awake | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.ComponentInitialized`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.ComponentInitialized", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.ComponentInitialized`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.ComponentInitialized", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.ComponentInitialized", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.ComponentInitialized", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.ComponentInitialized", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.ComponentInitialized", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.ComponentInitialized", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.ComponentInitialized` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-devicerepaired.md b/docs/02_development/hooks-library/employee/greg-employee-devicerepaired.md deleted file mode 100644 index 51039d02..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-devicerepaired.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.DeviceRepaired -sidebar_label: greg.EMPLOYEE.DeviceRepaired -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Technician.RepairDevice" ---- - -# `greg.EMPLOYEE.DeviceRepaired` - -## Description - -- Auto-generated from Il2Cpp unpack: Technician.RepairDevice - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Technician::RepairDevice()` | Postfix | Auto-generated from Il2Cpp unpack: Technician.RepairDevice | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.DeviceRepaired`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.DeviceRepaired", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.DeviceRepaired`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.DeviceRepaired", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.DeviceRepaired", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.DeviceRepaired", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.DeviceRepaired", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.DeviceRepaired", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.DeviceRepaired", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.DeviceRepaired` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-dispatched.md b/docs/02_development/hooks-library/employee/greg-employee-dispatched.md deleted file mode 100644 index d1338be4..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-dispatched.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: greg.EMPLOYEE.Dispatched -sidebar_label: greg.EMPLOYEE.Dispatched -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TechnicianManager.SendTechnician" ---- - -# `greg.EMPLOYEE.Dispatched` - -## Description - -- Auto-generated from Il2Cpp unpack: TechnicianManager.SendTechnician - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TechnicianManager::SendTechnician(NetworkSwitch, Server)` | Postfix | Auto-generated from Il2Cpp unpack: TechnicianManager.SendTechnician | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `networkSwitch` | `NetworkSwitch` | -| `server` | `Server` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.Dispatched`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.Dispatched", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.Dispatched`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.Dispatched", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.Dispatched", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.Dispatched", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.Dispatched", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.Dispatched", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.Dispatched", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.Dispatched` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-fired.md b/docs/02_development/hooks-library/employee/greg-employee-fired.md deleted file mode 100644 index 0ecb343d..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-fired.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.Fired -sidebar_label: greg.EMPLOYEE.Fired -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TechnicianManager.FireTechnician" ---- - -# `greg.EMPLOYEE.Fired` - -## Description - -- Auto-generated from Il2Cpp unpack: TechnicianManager.FireTechnician - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TechnicianManager::FireTechnician(int)` | Postfix | Auto-generated from Il2Cpp unpack: TechnicianManager.FireTechnician | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `technicianID` | `int` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.Fired`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.Fired", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.Fired`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.Fired", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.Fired", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.Fired", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.Fired", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.Fired", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.Fired", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.Fired` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-getcorrectdeviceprefab.md b/docs/02_development/hooks-library/employee/greg-employee-getcorrectdeviceprefab.md deleted file mode 100644 index ad1a5910..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-getcorrectdeviceprefab.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.GetCorrectDevicePrefab -sidebar_label: greg.EMPLOYEE.GetCorrectDevicePrefab -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Technician.GetCorrectDevicePrefab" ---- - -# `greg.EMPLOYEE.GetCorrectDevicePrefab` - -## Description - -- Auto-generated from Il2Cpp unpack: Technician.GetCorrectDevicePrefab - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Technician::GetCorrectDevicePrefab()` | Postfix | Auto-generated from Il2Cpp unpack: Technician.GetCorrectDevicePrefab | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.GetCorrectDevicePrefab`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.GetCorrectDevicePrefab", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.GetCorrectDevicePrefab`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.GetCorrectDevicePrefab", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.GetCorrectDevicePrefab", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.GetCorrectDevicePrefab", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.GetCorrectDevicePrefab", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.GetCorrectDevicePrefab", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.GetCorrectDevicePrefab", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.GetCorrectDevicePrefab` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-hired.md b/docs/02_development/hooks-library/employee/greg-employee-hired.md deleted file mode 100644 index 6b5b0076..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-hired.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.Hired -sidebar_label: greg.EMPLOYEE.Hired -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TechnicianManager.AddTechnician" ---- - -# `greg.EMPLOYEE.Hired` - -## Description - -- Auto-generated from Il2Cpp unpack: TechnicianManager.AddTechnician - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TechnicianManager::AddTechnician(Technician)` | Postfix | Auto-generated from Il2Cpp unpack: TechnicianManager.AddTechnician | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `technician` | `Technician` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.Hired`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.Hired", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.Hired`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.Hired", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.Hired", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.Hired", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.Hired", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.Hired", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.Hired", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.Hired` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-isdevicealreadyassigned.md b/docs/02_development/hooks-library/employee/greg-employee-isdevicealreadyassigned.md deleted file mode 100644 index 701f7631..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-isdevicealreadyassigned.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.EMPLOYEE.IsDeviceAlreadyAssigned -sidebar_label: greg.EMPLOYEE.IsDeviceAlreadyAssigned -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TechnicianManager.IsDeviceAlreadyAssigned" ---- - -# `greg.EMPLOYEE.IsDeviceAlreadyAssigned` - -## Description - -- Auto-generated from Il2Cpp unpack: TechnicianManager.IsDeviceAlreadyAssigned - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TechnicianManager::IsDeviceAlreadyAssigned(NetworkSwitch, Server)` | Postfix | Auto-generated from Il2Cpp unpack: TechnicianManager.IsDeviceAlreadyAssigned | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `networkSwitch` | `NetworkSwitch` | -| `server` | `Server` | -| `assigned` | `bool` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.IsDeviceAlreadyAssigned`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.IsDeviceAlreadyAssigned", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.IsDeviceAlreadyAssigned`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.IsDeviceAlreadyAssigned", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.IsDeviceAlreadyAssigned", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.IsDeviceAlreadyAssigned", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.IsDeviceAlreadyAssigned", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.IsDeviceAlreadyAssigned", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.IsDeviceAlreadyAssigned", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.IsDeviceAlreadyAssigned` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-jobqueued.md b/docs/02_development/hooks-library/employee/greg-employee-jobqueued.md deleted file mode 100644 index 954cd5b0..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-jobqueued.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.JobQueued -sidebar_label: greg.EMPLOYEE.JobQueued -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TechnicianManager.EnqueueDispatch" ---- - -# `greg.EMPLOYEE.JobQueued` - -## Description - -- Auto-generated from Il2Cpp unpack: TechnicianManager.EnqueueDispatch - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TechnicianManager::EnqueueDispatch(TechnicianManager.RepairJob)` | Postfix | Auto-generated from Il2Cpp unpack: TechnicianManager.EnqueueDispatch | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `job` | `TechnicianManager.RepairJob` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.JobQueued`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.JobQueued", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.JobQueued`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.JobQueued", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.JobQueued", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.JobQueued", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.JobQueued", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.JobQueued", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.JobQueued", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.JobQueued` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-jobqueueloaded.md b/docs/02_development/hooks-library/employee/greg-employee-jobqueueloaded.md deleted file mode 100644 index b0bb4a3b..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-jobqueueloaded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.JobQueueLoaded -sidebar_label: greg.EMPLOYEE.JobQueueLoaded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TechnicianManager.RestoreJobQueue" ---- - -# `greg.EMPLOYEE.JobQueueLoaded` - -## Description - -- Auto-generated from Il2Cpp unpack: TechnicianManager.RestoreJobQueue - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TechnicianManager::RestoreJobQueue(List)` | Postfix | Auto-generated from Il2Cpp unpack: TechnicianManager.RestoreJobQueue | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `savedJobs` | `List` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.JobQueueLoaded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.JobQueueLoaded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.JobQueueLoaded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.JobQueueLoaded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.JobQueueLoaded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.JobQueueLoaded", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.JobQueueLoaded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.JobQueueLoaded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.JobQueueLoaded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.JobQueueLoaded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-nextjobrequested.md b/docs/02_development/hooks-library/employee/greg-employee-nextjobrequested.md deleted file mode 100644 index 00ac9374..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-nextjobrequested.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.NextJobRequested -sidebar_label: greg.EMPLOYEE.NextJobRequested -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TechnicianManager.RequestNextJob" ---- - -# `greg.EMPLOYEE.NextJobRequested` - -## Description - -- Auto-generated from Il2Cpp unpack: TechnicianManager.RequestNextJob - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TechnicianManager::RequestNextJob(Technician)` | Postfix | Auto-generated from Il2Cpp unpack: TechnicianManager.RequestNextJob | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `technician` | `Technician` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.NextJobRequested`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.NextJobRequested", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.NextJobRequested`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.NextJobRequested", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.NextJobRequested", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.NextJobRequested", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.NextJobRequested", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.NextJobRequested", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.NextJobRequested", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.NextJobRequested` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-ondestroy.md b/docs/02_development/hooks-library/employee/greg-employee-ondestroy.md deleted file mode 100644 index c03331a2..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-ondestroy.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.OnDestroy -sidebar_label: greg.EMPLOYEE.OnDestroy -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Technician.OnDestroy" ---- - -# `greg.EMPLOYEE.OnDestroy` - -## Description - -- Auto-generated from Il2Cpp unpack: Technician.OnDestroy - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Technician::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: Technician.OnDestroy | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.OnDestroy`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.OnDestroy", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.OnDestroy`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.OnDestroy", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.OnDestroy", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.OnDestroy", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.OnDestroy", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.OnDestroy", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.OnDestroy", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.OnDestroy` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-onloadingstarted.md b/docs/02_development/hooks-library/employee/greg-employee-onloadingstarted.md deleted file mode 100644 index ee407dad..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-onloadingstarted.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.OnLoadingStarted -sidebar_label: greg.EMPLOYEE.OnLoadingStarted -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Technician.OnLoadingStarted" ---- - -# `greg.EMPLOYEE.OnLoadingStarted` - -## Description - -- Auto-generated from Il2Cpp unpack: Technician.OnLoadingStarted - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Technician::OnLoadingStarted()` | Postfix | Auto-generated from Il2Cpp unpack: Technician.OnLoadingStarted | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.OnLoadingStarted`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.OnLoadingStarted", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.OnLoadingStarted`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.OnLoadingStarted", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.OnLoadingStarted", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.OnLoadingStarted", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.OnLoadingStarted", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.OnLoadingStarted", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.OnLoadingStarted", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.OnLoadingStarted` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-positionhandtargetsondevice.md b/docs/02_development/hooks-library/employee/greg-employee-positionhandtargetsondevice.md deleted file mode 100644 index b14d1d1a..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-positionhandtargetsondevice.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.PositionHandTargetsOnDevice -sidebar_label: greg.EMPLOYEE.PositionHandTargetsOnDevice -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Technician.PositionHandTargetsOnDevice" ---- - -# `greg.EMPLOYEE.PositionHandTargetsOnDevice` - -## Description - -- Auto-generated from Il2Cpp unpack: Technician.PositionHandTargetsOnDevice - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Technician::PositionHandTargetsOnDevice(GameObject)` | Postfix | Auto-generated from Il2Cpp unpack: Technician.PositionHandTargetsOnDevice | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.PositionHandTargetsOnDevice`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.PositionHandTargetsOnDevice", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.PositionHandTargetsOnDevice`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.PositionHandTargetsOnDevice", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.PositionHandTargetsOnDevice", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.PositionHandTargetsOnDevice", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.PositionHandTargetsOnDevice", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.PositionHandTargetsOnDevice", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.PositionHandTargetsOnDevice", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.PositionHandTargetsOnDevice` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/employee/greg-employee-rotatetowardsgoal.md b/docs/02_development/hooks-library/employee/greg-employee-rotatetowardsgoal.md deleted file mode 100644 index edf509d2..00000000 --- a/docs/02_development/hooks-library/employee/greg-employee-rotatetowardsgoal.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.EMPLOYEE.RotateTowardsGoal -sidebar_label: greg.EMPLOYEE.RotateTowardsGoal -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Technician.RotateTowardsGoal" ---- - -# `greg.EMPLOYEE.RotateTowardsGoal` - -## Description - -- Auto-generated from Il2Cpp unpack: Technician.RotateTowardsGoal - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Technician::RotateTowardsGoal(Vector3)` | Postfix | Auto-generated from Il2Cpp unpack: Technician.RotateTowardsGoal | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.EMPLOYEE.RotateTowardsGoal`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.EMPLOYEE.RotateTowardsGoal", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.EMPLOYEE.RotateTowardsGoal`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.EMPLOYEE.RotateTowardsGoal", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.EMPLOYEE.RotateTowardsGoal", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.EMPLOYEE.RotateTowardsGoal", |payload| { - if let Some(method) = payload.get("method") { - println!("[EMPLOYEE] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.EMPLOYEE.RotateTowardsGoal", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[EMPLOYEE] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.EMPLOYEE.RotateTowardsGoal", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.EMPLOYEE.RotateTowardsGoal", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[EMPLOYEE] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.EMPLOYEE.RotateTowardsGoal` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/_category_.json b/docs/02_development/hooks-library/gameplay/_category_.json deleted file mode 100644 index 9bba0422..00000000 --- a/docs/02_development/hooks-library/gameplay/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "GAMEPLAY hooks", - "position": 1, - "collapsible": true, - "collapsed": true -} - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-clearobjectives.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-clearobjectives.md deleted file mode 100644 index 9ecac033..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-clearobjectives.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.ClearObjectives -sidebar_label: greg.GAMEPLAY.ClearObjectives -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.ClearObjectives" ---- - -# `greg.GAMEPLAY.ClearObjectives` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.ClearObjectives - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::ClearObjectives()` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.ClearObjectives | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.ClearObjectives`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.ClearObjectives", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.ClearObjectives`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.ClearObjectives", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.ClearObjectives", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.ClearObjectives", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.ClearObjectives", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.ClearObjectives", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.ClearObjectives", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.ClearObjectives` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-componentinitialized.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-componentinitialized.md deleted file mode 100644 index ce152f07..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-componentinitialized.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.GAMEPLAY.ComponentInitialized -sidebar_label: greg.GAMEPLAY.ComponentInitialized -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.Awake" ---- - -# `greg.GAMEPLAY.ComponentInitialized` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.Awake -- Auto-generated from Il2Cpp unpack: Objectives.Start - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **2** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.Awake | -| `Il2Cpp.Objectives::Start()` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.Start | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.ComponentInitialized`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.ComponentInitialized", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.ComponentInitialized`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.ComponentInitialized", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.ComponentInitialized", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.ComponentInitialized", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.ComponentInitialized", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.ComponentInitialized", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.ComponentInitialized", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.ComponentInitialized` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-createappobjective.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-createappobjective.md deleted file mode 100644 index 7df8a28e..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-createappobjective.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.CreateAppObjective -sidebar_label: greg.GAMEPLAY.CreateAppObjective -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.CreateAppObjective" ---- - -# `greg.GAMEPLAY.CreateAppObjective` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.CreateAppObjective - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::CreateAppObjective(int, int, int, int)` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.CreateAppObjective | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.CreateAppObjective`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.CreateAppObjective", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.CreateAppObjective`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.CreateAppObjective", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.CreateAppObjective", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.CreateAppObjective", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.CreateAppObjective", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.CreateAppObjective", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.CreateAppObjective", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.CreateAppObjective` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-createnewobjective.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-createnewobjective.md deleted file mode 100644 index 00de46c2..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-createnewobjective.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.CreateNewObjective -sidebar_label: greg.GAMEPLAY.CreateNewObjective -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.CreateNewObjective" ---- - -# `greg.GAMEPLAY.CreateNewObjective` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.CreateNewObjective - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::CreateNewObjective(int, int, Vector3, int, int, bool)` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.CreateNewObjective | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.CreateNewObjective`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.CreateNewObjective", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.CreateNewObjective`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.CreateNewObjective", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.CreateNewObjective", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.CreateNewObjective", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.CreateNewObjective", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.CreateNewObjective", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.CreateNewObjective", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.CreateNewObjective` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-destroyobjective.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-destroyobjective.md deleted file mode 100644 index 95fa2340..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-destroyobjective.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.DestroyObjective -sidebar_label: greg.GAMEPLAY.DestroyObjective -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.DestroyObjective" ---- - -# `greg.GAMEPLAY.DestroyObjective` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.DestroyObjective - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::DestroyObjective(int)` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.DestroyObjective | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.DestroyObjective`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.DestroyObjective", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.DestroyObjective`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.DestroyObjective", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.DestroyObjective", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.DestroyObjective", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.DestroyObjective", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.DestroyObjective", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.DestroyObjective", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.DestroyObjective` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-gettimedobjective.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-gettimedobjective.md deleted file mode 100644 index 46c28a0d..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-gettimedobjective.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.GetTimedObjective -sidebar_label: greg.GAMEPLAY.GetTimedObjective -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.GetTimedObjective" ---- - -# `greg.GAMEPLAY.GetTimedObjective` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.GetTimedObjective - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::GetTimedObjective(int)` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.GetTimedObjective | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.GetTimedObjective`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.GetTimedObjective", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.GetTimedObjective`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.GetTimedObjective", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.GetTimedObjective", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.GetTimedObjective", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.GetTimedObjective", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.GetTimedObjective", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.GetTimedObjective", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.GetTimedObjective` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-instantiateobjectivesign.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-instantiateobjectivesign.md deleted file mode 100644 index edd98721..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-instantiateobjectivesign.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.InstantiateObjectiveSign -sidebar_label: greg.GAMEPLAY.InstantiateObjectiveSign -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.InstantiateObjectiveSign" ---- - -# `greg.GAMEPLAY.InstantiateObjectiveSign` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.InstantiateObjectiveSign - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::InstantiateObjectiveSign(int, Vector3)` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.InstantiateObjectiveSign | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.InstantiateObjectiveSign`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.InstantiateObjectiveSign", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.InstantiateObjectiveSign`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.InstantiateObjectiveSign", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.InstantiateObjectiveSign", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.InstantiateObjectiveSign", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.InstantiateObjectiveSign", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.InstantiateObjectiveSign", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.InstantiateObjectiveSign", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.InstantiateObjectiveSign` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-istutorialinprogress.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-istutorialinprogress.md deleted file mode 100644 index 18e05fc1..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-istutorialinprogress.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.IsTutorialInProgress -sidebar_label: greg.GAMEPLAY.IsTutorialInProgress -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.IsTutorialInProgress" ---- - -# `greg.GAMEPLAY.IsTutorialInProgress` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.IsTutorialInProgress - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::IsTutorialInProgress()` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.IsTutorialInProgress | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.IsTutorialInProgress`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.IsTutorialInProgress", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.IsTutorialInProgress`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.IsTutorialInProgress", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.IsTutorialInProgress", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.IsTutorialInProgress", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.IsTutorialInProgress", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.IsTutorialInProgress", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.IsTutorialInProgress", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.IsTutorialInProgress` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-objectivesignremoved.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-objectivesignremoved.md deleted file mode 100644 index 5a1b15aa..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-objectivesignremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.ObjectiveSignRemoved -sidebar_label: greg.GAMEPLAY.ObjectiveSignRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.RemoveObjectiveSign" ---- - -# `greg.GAMEPLAY.ObjectiveSignRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.RemoveObjectiveSign - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::RemoveObjectiveSign(int)` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.RemoveObjectiveSign | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.ObjectiveSignRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.ObjectiveSignRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.ObjectiveSignRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.ObjectiveSignRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.ObjectiveSignRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.ObjectiveSignRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.ObjectiveSignRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.ObjectiveSignRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.ObjectiveSignRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.ObjectiveSignRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-objectivetimedtext.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-objectivetimedtext.md deleted file mode 100644 index 690e6c87..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-objectivetimedtext.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.ObjectiveTimedText -sidebar_label: greg.GAMEPLAY.ObjectiveTimedText -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.ObjectiveTimedText" ---- - -# `greg.GAMEPLAY.ObjectiveTimedText` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.ObjectiveTimedText - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::ObjectiveTimedText()` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.ObjectiveTimedText | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.ObjectiveTimedText`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.ObjectiveTimedText", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.ObjectiveTimedText`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.ObjectiveTimedText", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.ObjectiveTimedText", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.ObjectiveTimedText", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.ObjectiveTimedText", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.ObjectiveTimedText", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.ObjectiveTimedText", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.ObjectiveTimedText` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-ondestroy.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-ondestroy.md deleted file mode 100644 index 369b3780..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-ondestroy.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.OnDestroy -sidebar_label: greg.GAMEPLAY.OnDestroy -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.OnDestroy" ---- - -# `greg.GAMEPLAY.OnDestroy` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.OnDestroy - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.OnDestroy | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.OnDestroy`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.OnDestroy", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.OnDestroy`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.OnDestroy", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.OnDestroy", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.OnDestroy", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.OnDestroy", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.OnDestroy", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.OnDestroy", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.OnDestroy` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-onload.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-onload.md deleted file mode 100644 index 303ef0b6..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-onload.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.OnLoad -sidebar_label: greg.GAMEPLAY.OnLoad -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.OnLoad" ---- - -# `greg.GAMEPLAY.OnLoad` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.OnLoad - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::OnLoad()` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.OnLoad | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.OnLoad`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.OnLoad", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.OnLoad`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.OnLoad", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.OnLoad", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.OnLoad", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.OnLoad", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.OnLoad", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.OnLoad", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.OnLoad` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/gameplay/greg-gameplay-startobjective.md b/docs/02_development/hooks-library/gameplay/greg-gameplay-startobjective.md deleted file mode 100644 index 9e5f7e4a..00000000 --- a/docs/02_development/hooks-library/gameplay/greg-gameplay-startobjective.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.GAMEPLAY.StartObjective -sidebar_label: greg.GAMEPLAY.StartObjective -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Objectives.StartObjective" ---- - -# `greg.GAMEPLAY.StartObjective` - -## Description - -- Auto-generated from Il2Cpp unpack: Objectives.StartObjective - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Objectives::StartObjective(int, Vector3, bool)` | Postfix | Auto-generated from Il2Cpp unpack: Objectives.StartObjective | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.GAMEPLAY.StartObjective`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.GAMEPLAY.StartObjective", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.GAMEPLAY.StartObjective`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.GAMEPLAY.StartObjective", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.GAMEPLAY.StartObjective", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.GAMEPLAY.StartObjective", |payload| { - if let Some(method) = payload.get("method") { - println!("[GAMEPLAY] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.GAMEPLAY.StartObjective", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[GAMEPLAY] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.GAMEPLAY.StartObjective", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.GAMEPLAY.StartObjective", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[GAMEPLAY] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.GAMEPLAY.StartObjective` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/_category_.json b/docs/02_development/hooks-library/network/_category_.json deleted file mode 100644 index bf345bfe..00000000 --- a/docs/02_development/hooks-library/network/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "NETWORK hooks", - "position": 1, - "collapsible": true, - "collapsed": true -} - diff --git a/docs/02_development/hooks-library/network/greg-network-assignnewposition.md b/docs/02_development/hooks-library/network/greg-network-assignnewposition.md deleted file mode 100644 index 76c047f6..00000000 --- a/docs/02_development/hooks-library/network/greg-network-assignnewposition.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.AssignNewPosition -sidebar_label: greg.NETWORK.AssignNewPosition -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.AssignNewPosition" ---- - -# `greg.NETWORK.AssignNewPosition` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.AssignNewPosition - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::AssignNewPosition(int, Transform, bool, bool, CableLink.TypeOfLink, string)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.AssignNewPosition | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.AssignNewPosition`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.AssignNewPosition", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.AssignNewPosition`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.AssignNewPosition", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.AssignNewPosition", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.AssignNewPosition", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.AssignNewPosition", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.AssignNewPosition", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.AssignNewPosition", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.AssignNewPosition` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-brokenserveradded.md b/docs/02_development/hooks-library/network/greg-network-brokenserveradded.md deleted file mode 100644 index c074e3dc..00000000 --- a/docs/02_development/hooks-library/network/greg-network-brokenserveradded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.BrokenServerAdded -sidebar_label: greg.NETWORK.BrokenServerAdded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.AddBrokenServer" ---- - -# `greg.NETWORK.BrokenServerAdded` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.AddBrokenServer - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::AddBrokenServer(Server)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.AddBrokenServer | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.BrokenServerAdded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.BrokenServerAdded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.BrokenServerAdded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.BrokenServerAdded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.BrokenServerAdded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.BrokenServerAdded", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.BrokenServerAdded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.BrokenServerAdded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.BrokenServerAdded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.BrokenServerAdded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-brokenserverremoved.md b/docs/02_development/hooks-library/network/greg-network-brokenserverremoved.md deleted file mode 100644 index a83f9c82..00000000 --- a/docs/02_development/hooks-library/network/greg-network-brokenserverremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.BrokenServerRemoved -sidebar_label: greg.NETWORK.BrokenServerRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RemoveBrokenServer" ---- - -# `greg.NETWORK.BrokenServerRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RemoveBrokenServer - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RemoveBrokenServer(string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RemoveBrokenServer | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.BrokenServerRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.BrokenServerRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.BrokenServerRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.BrokenServerRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.BrokenServerRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.BrokenServerRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.BrokenServerRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.BrokenServerRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.BrokenServerRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.BrokenServerRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-buttonshownetworkswitchconfig.md b/docs/02_development/hooks-library/network/greg-network-buttonshownetworkswitchconfig.md deleted file mode 100644 index 233bb9cb..00000000 --- a/docs/02_development/hooks-library/network/greg-network-buttonshownetworkswitchconfig.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ButtonShowNetworkSwitchConfig -sidebar_label: greg.NETWORK.ButtonShowNetworkSwitchConfig -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.ButtonShowNetworkSwitchConfig" ---- - -# `greg.NETWORK.ButtonShowNetworkSwitchConfig` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.ButtonShowNetworkSwitchConfig - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::ButtonShowNetworkSwitchConfig()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.ButtonShowNetworkSwitchConfig | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ButtonShowNetworkSwitchConfig`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ButtonShowNetworkSwitchConfig", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ButtonShowNetworkSwitchConfig`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ButtonShowNetworkSwitchConfig", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ButtonShowNetworkSwitchConfig", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ButtonShowNetworkSwitchConfig", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ButtonShowNetworkSwitchConfig", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ButtonShowNetworkSwitchConfig", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ButtonShowNetworkSwitchConfig", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ButtonShowNetworkSwitchConfig` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-cableconnectionremoved.md b/docs/02_development/hooks-library/network/greg-network-cableconnectionremoved.md deleted file mode 100644 index 78cf4070..00000000 --- a/docs/02_development/hooks-library/network/greg-network-cableconnectionremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.CableConnectionRemoved -sidebar_label: greg.NETWORK.CableConnectionRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RemoveCableConnection" ---- - -# `greg.NETWORK.CableConnectionRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RemoveCableConnection - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RemoveCableConnection(int)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RemoveCableConnection | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.CableConnectionRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.CableConnectionRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.CableConnectionRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.CableConnectionRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.CableConnectionRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.CableConnectionRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.CableConnectionRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.CableConnectionRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.CableConnectionRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.CableConnectionRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-cablefromlacpgroupsremoved.md b/docs/02_development/hooks-library/network/greg-network-cablefromlacpgroupsremoved.md deleted file mode 100644 index 8ac370f1..00000000 --- a/docs/02_development/hooks-library/network/greg-network-cablefromlacpgroupsremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.CableFromLACPGroupsRemoved -sidebar_label: greg.NETWORK.CableFromLACPGroupsRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RemoveCableFromLACPGroups" ---- - -# `greg.NETWORK.CableFromLACPGroupsRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RemoveCableFromLACPGroups - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RemoveCableFromLACPGroups(int)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RemoveCableFromLACPGroups | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.CableFromLACPGroupsRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.CableFromLACPGroupsRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.CableFromLACPGroupsRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.CableFromLACPGroupsRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.CableFromLACPGroupsRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.CableFromLACPGroupsRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.CableFromLACPGroupsRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.CableFromLACPGroupsRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.CableFromLACPGroupsRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.CableFromLACPGroupsRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-cableloaded.md b/docs/02_development/hooks-library/network/greg-network-cableloaded.md deleted file mode 100644 index ce92181c..00000000 --- a/docs/02_development/hooks-library/network/greg-network-cableloaded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.CableLoaded -sidebar_label: greg.NETWORK.CableLoaded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.LoadCable" ---- - -# `greg.NETWORK.CableLoaded` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.LoadCable - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::LoadCable(CableSaveData)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.LoadCable | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.CableLoaded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.CableLoaded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.CableLoaded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.CableLoaded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.CableLoaded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.CableLoaded", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.CableLoaded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.CableLoaded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.CableLoaded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.CableLoaded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-canacceptsfp.md b/docs/02_development/hooks-library/network/greg-network-canacceptsfp.md deleted file mode 100644 index 94398abd..00000000 --- a/docs/02_development/hooks-library/network/greg-network-canacceptsfp.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.CanAcceptSFP -sidebar_label: greg.NETWORK.CanAcceptSFP -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPBox.CanAcceptSFP" ---- - -# `greg.NETWORK.CanAcceptSFP` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPBox.CanAcceptSFP - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPBox::CanAcceptSFP(int)` | Postfix | Auto-generated from Il2Cpp unpack: SFPBox.CanAcceptSFP | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.CanAcceptSFP`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.CanAcceptSFP", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.CanAcceptSFP`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.CanAcceptSFP", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.CanAcceptSFP", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.CanAcceptSFP", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.CanAcceptSFP", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.CanAcceptSFP", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.CanAcceptSFP", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.CanAcceptSFP` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-clearerrorsign.md b/docs/02_development/hooks-library/network/greg-network-clearerrorsign.md deleted file mode 100644 index 97b31c30..00000000 --- a/docs/02_development/hooks-library/network/greg-network-clearerrorsign.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ClearErrorSign -sidebar_label: greg.NETWORK.ClearErrorSign -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.ClearErrorSign" ---- - -# `greg.NETWORK.ClearErrorSign` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.ClearErrorSign - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::ClearErrorSign()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.ClearErrorSign | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ClearErrorSign`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ClearErrorSign", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ClearErrorSign`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ClearErrorSign", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ClearErrorSign", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ClearErrorSign", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ClearErrorSign", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ClearErrorSign", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ClearErrorSign", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ClearErrorSign` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-clearmap.md b/docs/02_development/hooks-library/network/greg-network-clearmap.md deleted file mode 100644 index 999766c0..00000000 --- a/docs/02_development/hooks-library/network/greg-network-clearmap.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ClearMap -sidebar_label: greg.NETWORK.ClearMap -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.ClearMap" ---- - -# `greg.NETWORK.ClearMap` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.ClearMap - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::ClearMap()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.ClearMap | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ClearMap`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ClearMap", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ClearMap`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ClearMap", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ClearMap", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ClearMap", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ClearMap", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ClearMap", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ClearMap", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ClearMap` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-clearwarningsign.md b/docs/02_development/hooks-library/network/greg-network-clearwarningsign.md deleted file mode 100644 index d675936b..00000000 --- a/docs/02_development/hooks-library/network/greg-network-clearwarningsign.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ClearWarningSign -sidebar_label: greg.NETWORK.ClearWarningSign -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.ClearWarningSign" ---- - -# `greg.NETWORK.ClearWarningSign` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.ClearWarningSign - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::ClearWarningSign(bool)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.ClearWarningSign | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ClearWarningSign`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ClearWarningSign", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ClearWarningSign`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ClearWarningSign", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ClearWarningSign", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ClearWarningSign", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ClearWarningSign", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ClearWarningSign", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ClearWarningSign", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ClearWarningSign` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-componentinitialized.md b/docs/02_development/hooks-library/network/greg-network-componentinitialized.md deleted file mode 100644 index f28d1209..00000000 --- a/docs/02_development/hooks-library/network/greg-network-componentinitialized.md +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: greg.NETWORK.ComponentInitialized -sidebar_label: greg.NETWORK.ComponentInitialized -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CableLink.Start" ---- - -# `greg.NETWORK.ComponentInitialized` - -## Description - -- Auto-generated from Il2Cpp unpack: CableLink.Start -- Auto-generated from Il2Cpp unpack: CablePositions.Awake -- Auto-generated from Il2Cpp unpack: CablePositions.Start -- Auto-generated from Il2Cpp unpack: NetworkMap.Awake -- Auto-generated from Il2Cpp unpack: NetworkSwitch.Awake -- Auto-generated from Il2Cpp unpack: NetworkSwitch.Start -- Auto-generated from Il2Cpp unpack: SFPBox.Awake -- Auto-generated from Il2Cpp unpack: SFPModule.Awake - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **8** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CableLink::Start()` | Postfix | Auto-generated from Il2Cpp unpack: CableLink.Start | -| `Il2Cpp.CablePositions::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.Awake | -| `Il2Cpp.CablePositions::Start()` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.Start | -| `Il2Cpp.NetworkMap::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.Awake | -| `Il2Cpp.NetworkSwitch::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.Awake | -| `Il2Cpp.NetworkSwitch::Start()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.Start | -| `Il2Cpp.SFPBox::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: SFPBox.Awake | -| `Il2Cpp.SFPModule::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: SFPModule.Awake | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ComponentInitialized`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ComponentInitialized", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ComponentInitialized`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ComponentInitialized", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ComponentInitialized", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ComponentInitialized", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ComponentInitialized", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ComponentInitialized", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ComponentInitialized", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ComponentInitialized` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-connect.md b/docs/02_development/hooks-library/network/greg-network-connect.md deleted file mode 100644 index 6f6a6f10..00000000 --- a/docs/02_development/hooks-library/network/greg-network-connect.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.Connect -sidebar_label: greg.NETWORK.Connect -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.Connect" ---- - -# `greg.NETWORK.Connect` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.Connect - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::Connect(string, string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.Connect | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.Connect`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.Connect", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.Connect`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.Connect", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.Connect", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.Connect", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.Connect", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.Connect", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.Connect", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.Connect` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-createlacpgroup.md b/docs/02_development/hooks-library/network/greg-network-createlacpgroup.md deleted file mode 100644 index 9c0e0ae2..00000000 --- a/docs/02_development/hooks-library/network/greg-network-createlacpgroup.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.CreateLACPGroup -sidebar_label: greg.NETWORK.CreateLACPGroup -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.CreateLACPGroup" ---- - -# `greg.NETWORK.CreateLACPGroup` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.CreateLACPGroup - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::CreateLACPGroup(string, string, List)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.CreateLACPGroup | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.CreateLACPGroup`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.CreateLACPGroup", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.CreateLACPGroup`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.CreateLACPGroup", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.CreateLACPGroup", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.CreateLACPGroup", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.CreateLACPGroup", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.CreateLACPGroup", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.CreateLACPGroup", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.CreateLACPGroup` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-createnewreversecable.md b/docs/02_development/hooks-library/network/greg-network-createnewreversecable.md deleted file mode 100644 index 41440100..00000000 --- a/docs/02_development/hooks-library/network/greg-network-createnewreversecable.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.CreateNewReverseCable -sidebar_label: greg.NETWORK.CreateNewReverseCable -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.CreateNewReverseCable" ---- - -# `greg.NETWORK.CreateNewReverseCable` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.CreateNewReverseCable - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::CreateNewReverseCable()` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.CreateNewReverseCable | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.CreateNewReverseCable`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.CreateNewReverseCable", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.CreateNewReverseCable`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.CreateNewReverseCable", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.CreateNewReverseCable", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.CreateNewReverseCable", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.CreateNewReverseCable", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.CreateNewReverseCable", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.CreateNewReverseCable", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.CreateNewReverseCable` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-createropeattachpoint.md b/docs/02_development/hooks-library/network/greg-network-createropeattachpoint.md deleted file mode 100644 index 8b9a01bc..00000000 --- a/docs/02_development/hooks-library/network/greg-network-createropeattachpoint.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.CreateRopeAttachPoint -sidebar_label: greg.NETWORK.CreateRopeAttachPoint -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CableLink.CreateRopeAttachPoint" ---- - -# `greg.NETWORK.CreateRopeAttachPoint` - -## Description - -- Auto-generated from Il2Cpp unpack: CableLink.CreateRopeAttachPoint - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CableLink::CreateRopeAttachPoint()` | Postfix | Auto-generated from Il2Cpp unpack: CableLink.CreateRopeAttachPoint | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.CreateRopeAttachPoint`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.CreateRopeAttachPoint", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.CreateRopeAttachPoint`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.CreateRopeAttachPoint", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.CreateRopeAttachPoint", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.CreateRopeAttachPoint", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.CreateRopeAttachPoint", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.CreateRopeAttachPoint", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.CreateRopeAttachPoint", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.CreateRopeAttachPoint` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-createtubemesh.md b/docs/02_development/hooks-library/network/greg-network-createtubemesh.md deleted file mode 100644 index 545273d6..00000000 --- a/docs/02_development/hooks-library/network/greg-network-createtubemesh.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.CreateTubeMesh -sidebar_label: greg.NETWORK.CreateTubeMesh -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.CreateTubeMesh" ---- - -# `greg.NETWORK.CreateTubeMesh` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.CreateTubeMesh - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::CreateTubeMesh(List)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.CreateTubeMesh | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.CreateTubeMesh`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.CreateTubeMesh", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.CreateTubeMesh`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.CreateTubeMesh", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.CreateTubeMesh", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.CreateTubeMesh", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.CreateTubeMesh", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.CreateTubeMesh", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.CreateTubeMesh", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.CreateTubeMesh` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-customerservercountandspeedchanged.md b/docs/02_development/hooks-library/network/greg-network-customerservercountandspeedchanged.md deleted file mode 100644 index 3960b873..00000000 --- a/docs/02_development/hooks-library/network/greg-network-customerservercountandspeedchanged.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.CustomerServerCountAndSpeedChanged -sidebar_label: greg.NETWORK.CustomerServerCountAndSpeedChanged -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.UpdateCustomerServerCountAndSpeed" ---- - -# `greg.NETWORK.CustomerServerCountAndSpeedChanged` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.UpdateCustomerServerCountAndSpeed - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::UpdateCustomerServerCountAndSpeed(int, int, float)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.UpdateCustomerServerCountAndSpeed | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.CustomerServerCountAndSpeedChanged`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.CustomerServerCountAndSpeedChanged", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.CustomerServerCountAndSpeedChanged`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.CustomerServerCountAndSpeedChanged", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.CustomerServerCountAndSpeedChanged", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.CustomerServerCountAndSpeedChanged", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.CustomerServerCountAndSpeedChanged", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.CustomerServerCountAndSpeedChanged", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.CustomerServerCountAndSpeedChanged", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.CustomerServerCountAndSpeedChanged` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-deviceadded.md b/docs/02_development/hooks-library/network/greg-network-deviceadded.md deleted file mode 100644 index 0e228308..00000000 --- a/docs/02_development/hooks-library/network/greg-network-deviceadded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.DeviceAdded -sidebar_label: greg.NETWORK.DeviceAdded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.AddDevice" ---- - -# `greg.NETWORK.DeviceAdded` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.AddDevice - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::AddDevice(string, CableLink.TypeOfLink, int)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.AddDevice | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.DeviceAdded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.DeviceAdded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.DeviceAdded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.DeviceAdded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.DeviceAdded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.DeviceAdded", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.DeviceAdded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.DeviceAdded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.DeviceAdded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.DeviceAdded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-devicecustomeridchanged.md b/docs/02_development/hooks-library/network/greg-network-devicecustomeridchanged.md deleted file mode 100644 index 2a1fbfb6..00000000 --- a/docs/02_development/hooks-library/network/greg-network-devicecustomeridchanged.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.DeviceCustomerIDChanged -sidebar_label: greg.NETWORK.DeviceCustomerIDChanged -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.UpdateDeviceCustomerID" ---- - -# `greg.NETWORK.DeviceCustomerIDChanged` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.UpdateDeviceCustomerID - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::UpdateDeviceCustomerID(string, int)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.UpdateDeviceCustomerID | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.DeviceCustomerIDChanged`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.DeviceCustomerIDChanged", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.DeviceCustomerIDChanged`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.DeviceCustomerIDChanged", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.DeviceCustomerIDChanged", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.DeviceCustomerIDChanged", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.DeviceCustomerIDChanged", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.DeviceCustomerIDChanged", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.DeviceCustomerIDChanged", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.DeviceCustomerIDChanged` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-deviceremoved.md b/docs/02_development/hooks-library/network/greg-network-deviceremoved.md deleted file mode 100644 index fea3dc9a..00000000 --- a/docs/02_development/hooks-library/network/greg-network-deviceremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.DeviceRemoved -sidebar_label: greg.NETWORK.DeviceRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RemoveDevice" ---- - -# `greg.NETWORK.DeviceRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RemoveDevice - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RemoveDevice(string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RemoveDevice | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.DeviceRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.DeviceRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.DeviceRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.DeviceRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.DeviceRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.DeviceRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.DeviceRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.DeviceRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.DeviceRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.DeviceRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-devicerepaired.md b/docs/02_development/hooks-library/network/greg-network-devicerepaired.md deleted file mode 100644 index 467ec3e7..00000000 --- a/docs/02_development/hooks-library/network/greg-network-devicerepaired.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.DeviceRepaired -sidebar_label: greg.NETWORK.DeviceRepaired -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.RepairDevice" ---- - -# `greg.NETWORK.DeviceRepaired` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.RepairDevice - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::RepairDevice()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.RepairDevice | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.DeviceRepaired`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.DeviceRepaired", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.DeviceRepaired`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.DeviceRepaired", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.DeviceRepaired", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.DeviceRepaired", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.DeviceRepaired", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.DeviceRepaired", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.DeviceRepaired", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.DeviceRepaired` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-disconnect.md b/docs/02_development/hooks-library/network/greg-network-disconnect.md deleted file mode 100644 index b1732ce4..00000000 --- a/docs/02_development/hooks-library/network/greg-network-disconnect.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.Disconnect -sidebar_label: greg.NETWORK.Disconnect -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.Disconnect" ---- - -# `greg.NETWORK.Disconnect` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.Disconnect - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::Disconnect(string, string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.Disconnect | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.Disconnect`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.Disconnect", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.Disconnect`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.Disconnect", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.Disconnect", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.Disconnect", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.Disconnect", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.Disconnect", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.Disconnect", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.Disconnect` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-disconnectcables.md b/docs/02_development/hooks-library/network/greg-network-disconnectcables.md deleted file mode 100644 index df505154..00000000 --- a/docs/02_development/hooks-library/network/greg-network-disconnectcables.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.DisconnectCables -sidebar_label: greg.NETWORK.DisconnectCables -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.DisconnectCables" ---- - -# `greg.NETWORK.DisconnectCables` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.DisconnectCables - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::DisconnectCables()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.DisconnectCables | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.DisconnectCables`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.DisconnectCables", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.DisconnectCables`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.DisconnectCables", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.DisconnectCables", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.DisconnectCables", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.DisconnectCables", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.DisconnectCables", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.DisconnectCables", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.DisconnectCables` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-disconnectcableswhenswitchisoff.md b/docs/02_development/hooks-library/network/greg-network-disconnectcableswhenswitchisoff.md deleted file mode 100644 index f6650843..00000000 --- a/docs/02_development/hooks-library/network/greg-network-disconnectcableswhenswitchisoff.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.DisconnectCablesWhenSwitchIsOff -sidebar_label: greg.NETWORK.DisconnectCablesWhenSwitchIsOff -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.DisconnectCablesWhenSwitchIsOff" ---- - -# `greg.NETWORK.DisconnectCablesWhenSwitchIsOff` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.DisconnectCablesWhenSwitchIsOff - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::DisconnectCablesWhenSwitchIsOff()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.DisconnectCablesWhenSwitchIsOff | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.DisconnectCablesWhenSwitchIsOff`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.DisconnectCablesWhenSwitchIsOff", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.DisconnectCablesWhenSwitchIsOff`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.DisconnectCablesWhenSwitchIsOff", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.DisconnectCablesWhenSwitchIsOff", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.DisconnectCablesWhenSwitchIsOff", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.DisconnectCablesWhenSwitchIsOff", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.DisconnectCablesWhenSwitchIsOff", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.DisconnectCablesWhenSwitchIsOff", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.DisconnectCablesWhenSwitchIsOff` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-findallroutes.md b/docs/02_development/hooks-library/network/greg-network-findallroutes.md deleted file mode 100644 index 82c6c76d..00000000 --- a/docs/02_development/hooks-library/network/greg-network-findallroutes.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.FindAllRoutes -sidebar_label: greg.NETWORK.FindAllRoutes -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.FindAllRoutes" ---- - -# `greg.NETWORK.FindAllRoutes` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.FindAllRoutes - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::FindAllRoutes(string, string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.FindAllRoutes | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.FindAllRoutes`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.FindAllRoutes", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.FindAllRoutes`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.FindAllRoutes", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.FindAllRoutes", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.FindAllRoutes", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.FindAllRoutes", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.FindAllRoutes", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.FindAllRoutes", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.FindAllRoutes` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-findphysicalpath.md b/docs/02_development/hooks-library/network/greg-network-findphysicalpath.md deleted file mode 100644 index edcfae84..00000000 --- a/docs/02_development/hooks-library/network/greg-network-findphysicalpath.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.FindPhysicalPath -sidebar_label: greg.NETWORK.FindPhysicalPath -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.FindPhysicalPath" ---- - -# `greg.NETWORK.FindPhysicalPath` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.FindPhysicalPath - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::FindPhysicalPath(string, string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.FindPhysicalPath | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.FindPhysicalPath`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.FindPhysicalPath", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.FindPhysicalPath`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.FindPhysicalPath", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.FindPhysicalPath", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.FindPhysicalPath", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.FindPhysicalPath", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.FindPhysicalPath", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.FindPhysicalPath", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.FindPhysicalPath` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-fromportremoved.md b/docs/02_development/hooks-library/network/greg-network-fromportremoved.md deleted file mode 100644 index 7cb9c8ad..00000000 --- a/docs/02_development/hooks-library/network/greg-network-fromportremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.FromPortRemoved -sidebar_label: greg.NETWORK.FromPortRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPModule.RemoveFromPort" ---- - -# `greg.NETWORK.FromPortRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPModule.RemoveFromPort - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPModule::RemoveFromPort()` | Postfix | Auto-generated from Il2Cpp unpack: SFPModule.RemoveFromPort | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.FromPortRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.FromPortRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.FromPortRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.FromPortRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.FromPortRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.FromPortRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.FromPortRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.FromPortRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.FromPortRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.FromPortRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-generatebentsegment.md b/docs/02_development/hooks-library/network/greg-network-generatebentsegment.md deleted file mode 100644 index 1b0f40bd..00000000 --- a/docs/02_development/hooks-library/network/greg-network-generatebentsegment.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GenerateBentSegment -sidebar_label: greg.NETWORK.GenerateBentSegment -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.GenerateBentSegment" ---- - -# `greg.NETWORK.GenerateBentSegment` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.GenerateBentSegment - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::GenerateBentSegment(Vector3, Vector3, Transform, bool)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.GenerateBentSegment | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GenerateBentSegment`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GenerateBentSegment", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GenerateBentSegment`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GenerateBentSegment", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GenerateBentSegment", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GenerateBentSegment", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GenerateBentSegment", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GenerateBentSegment", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GenerateBentSegment", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GenerateBentSegment` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-generatecornerbend.md b/docs/02_development/hooks-library/network/greg-network-generatecornerbend.md deleted file mode 100644 index 726d25fe..00000000 --- a/docs/02_development/hooks-library/network/greg-network-generatecornerbend.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GenerateCornerBend -sidebar_label: greg.NETWORK.GenerateCornerBend -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.GenerateCornerBend" ---- - -# `greg.NETWORK.GenerateCornerBend` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.GenerateCornerBend - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::GenerateCornerBend(Vector3, Vector3, Vector3, Transform)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.GenerateCornerBend | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GenerateCornerBend`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GenerateCornerBend", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GenerateCornerBend`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GenerateCornerBend", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GenerateCornerBend", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GenerateCornerBend", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GenerateCornerBend", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GenerateCornerBend", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GenerateCornerBend", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GenerateCornerBend` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-generatedevicename.md b/docs/02_development/hooks-library/network/greg-network-generatedevicename.md deleted file mode 100644 index 0756fd71..00000000 --- a/docs/02_development/hooks-library/network/greg-network-generatedevicename.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GenerateDeviceName -sidebar_label: greg.NETWORK.GenerateDeviceName -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GenerateDeviceName" ---- - -# `greg.NETWORK.GenerateDeviceName` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GenerateDeviceName - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GenerateDeviceName(CableLink.TypeOfLink, Vector3)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GenerateDeviceName | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GenerateDeviceName`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GenerateDeviceName", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GenerateDeviceName`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GenerateDeviceName", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GenerateDeviceName", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GenerateDeviceName", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GenerateDeviceName", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GenerateDeviceName", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GenerateDeviceName", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GenerateDeviceName` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-generatefinalpath.md b/docs/02_development/hooks-library/network/greg-network-generatefinalpath.md deleted file mode 100644 index 853f234f..00000000 --- a/docs/02_development/hooks-library/network/greg-network-generatefinalpath.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GenerateFinalPath -sidebar_label: greg.NETWORK.GenerateFinalPath -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.GenerateFinalPath" ---- - -# `greg.NETWORK.GenerateFinalPath` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.GenerateFinalPath - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::GenerateFinalPath(int)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.GenerateFinalPath | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GenerateFinalPath`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GenerateFinalPath", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GenerateFinalPath`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GenerateFinalPath", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GenerateFinalPath", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GenerateFinalPath", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GenerateFinalPath", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GenerateFinalPath", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GenerateFinalPath", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GenerateFinalPath` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getallbrokenservers.md b/docs/02_development/hooks-library/network/greg-network-getallbrokenservers.md deleted file mode 100644 index cf547fce..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getallbrokenservers.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetAllBrokenServers -sidebar_label: greg.NETWORK.GetAllBrokenServers -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetAllBrokenServers" ---- - -# `greg.NETWORK.GetAllBrokenServers` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetAllBrokenServers - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetAllBrokenServers()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetAllBrokenServers | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetAllBrokenServers`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetAllBrokenServers", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetAllBrokenServers`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetAllBrokenServers", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetAllBrokenServers", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetAllBrokenServers", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetAllBrokenServers", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetAllBrokenServers", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetAllBrokenServers", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetAllBrokenServers` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getallbrokenswitches.md b/docs/02_development/hooks-library/network/greg-network-getallbrokenswitches.md deleted file mode 100644 index 3705a301..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getallbrokenswitches.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetAllBrokenSwitches -sidebar_label: greg.NETWORK.GetAllBrokenSwitches -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetAllBrokenSwitches" ---- - -# `greg.NETWORK.GetAllBrokenSwitches` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetAllBrokenSwitches - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetAllBrokenSwitches()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetAllBrokenSwitches | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetAllBrokenSwitches`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetAllBrokenSwitches", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetAllBrokenSwitches`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetAllBrokenSwitches", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetAllBrokenSwitches", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetAllBrokenSwitches", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetAllBrokenSwitches", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetAllBrokenSwitches", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetAllBrokenSwitches", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetAllBrokenSwitches` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getalldevices.md b/docs/02_development/hooks-library/network/greg-network-getalldevices.md deleted file mode 100644 index 12b4a719..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getalldevices.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetAllDevices -sidebar_label: greg.NETWORK.GetAllDevices -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetAllDevices" ---- - -# `greg.NETWORK.GetAllDevices` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetAllDevices - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetAllDevices()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetAllDevices | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetAllDevices`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetAllDevices", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetAllDevices`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetAllDevices", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetAllDevices", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetAllDevices", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetAllDevices", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetAllDevices", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetAllDevices", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetAllDevices` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getalllacpgroups.md b/docs/02_development/hooks-library/network/greg-network-getalllacpgroups.md deleted file mode 100644 index e0930028..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getalllacpgroups.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetAllLACPGroups -sidebar_label: greg.NETWORK.GetAllLACPGroups -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetAllLACPGroups" ---- - -# `greg.NETWORK.GetAllLACPGroups` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetAllLACPGroups - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetAllLACPGroups()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetAllLACPGroups | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetAllLACPGroups`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetAllLACPGroups", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetAllLACPGroups`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetAllLACPGroups", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetAllLACPGroups", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetAllLACPGroups", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetAllLACPGroups", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetAllLACPGroups", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetAllLACPGroups", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetAllLACPGroups` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getallnetworkswitches.md b/docs/02_development/hooks-library/network/greg-network-getallnetworkswitches.md deleted file mode 100644 index e9e351d1..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getallnetworkswitches.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetAllNetworkSwitches -sidebar_label: greg.NETWORK.GetAllNetworkSwitches -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetAllNetworkSwitches" ---- - -# `greg.NETWORK.GetAllNetworkSwitches` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetAllNetworkSwitches - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetAllNetworkSwitches()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetAllNetworkSwitches | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetAllNetworkSwitches`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetAllNetworkSwitches", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetAllNetworkSwitches`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetAllNetworkSwitches", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetAllNetworkSwitches", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetAllNetworkSwitches", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetAllNetworkSwitches", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetAllNetworkSwitches", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetAllNetworkSwitches", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetAllNetworkSwitches` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getallservers.md b/docs/02_development/hooks-library/network/greg-network-getallservers.md deleted file mode 100644 index 5e3f3aca..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getallservers.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetAllServers -sidebar_label: greg.NETWORK.GetAllServers -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetAllServers" ---- - -# `greg.NETWORK.GetAllServers` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetAllServers - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetAllServers()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetAllServers | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetAllServers`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetAllServers", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetAllServers`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetAllServers", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetAllServers", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetAllServers", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetAllServers", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetAllServers", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetAllServers", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetAllServers` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getcablematerial.md b/docs/02_development/hooks-library/network/greg-network-getcablematerial.md deleted file mode 100644 index 24162723..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getcablematerial.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetCableMaterial -sidebar_label: greg.NETWORK.GetCableMaterial -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.GetCableMaterial" ---- - -# `greg.NETWORK.GetCableMaterial` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.GetCableMaterial - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::GetCableMaterial(int)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.GetCableMaterial | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetCableMaterial`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetCableMaterial", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetCableMaterial`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetCableMaterial", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetCableMaterial", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetCableMaterial", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetCableMaterial", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetCableMaterial", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetCableMaterial", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetCableMaterial` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getcablepositions.md b/docs/02_development/hooks-library/network/greg-network-getcablepositions.md deleted file mode 100644 index f538f111..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getcablepositions.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetCablePositions -sidebar_label: greg.NETWORK.GetCablePositions -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.GetCablePositions" ---- - -# `greg.NETWORK.GetCablePositions` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.GetCablePositions - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::GetCablePositions(int)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.GetCablePositions | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetCablePositions`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetCablePositions", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetCablePositions`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetCablePositions", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetCablePositions", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetCablePositions", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetCablePositions", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetCablePositions", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetCablePositions", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetCablePositions` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getconnecteddevices.md b/docs/02_development/hooks-library/network/greg-network-getconnecteddevices.md deleted file mode 100644 index 10a8b260..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getconnecteddevices.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetConnectedDevices -sidebar_label: greg.NETWORK.GetConnectedDevices -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.GetConnectedDevices" ---- - -# `greg.NETWORK.GetConnectedDevices` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.GetConnectedDevices - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::GetConnectedDevices()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.GetConnectedDevices | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetConnectedDevices`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetConnectedDevices", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetConnectedDevices`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetConnectedDevices", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetConnectedDevices", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetConnectedDevices", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetConnectedDevices", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetConnectedDevices", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetConnectedDevices", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetConnectedDevices` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getcustomerbase.md b/docs/02_development/hooks-library/network/greg-network-getcustomerbase.md deleted file mode 100644 index 71a6cb21..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getcustomerbase.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetCustomerBase -sidebar_label: greg.NETWORK.GetCustomerBase -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetCustomerBase" ---- - -# `greg.NETWORK.GetCustomerBase` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetCustomerBase - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetCustomerBase(int)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetCustomerBase | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetCustomerBase`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetCustomerBase", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetCustomerBase`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetCustomerBase", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetCustomerBase", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetCustomerBase", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetCustomerBase", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetCustomerBase", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetCustomerBase", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetCustomerBase` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getdevice.md b/docs/02_development/hooks-library/network/greg-network-getdevice.md deleted file mode 100644 index 8320671f..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getdevice.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetDevice -sidebar_label: greg.NETWORK.GetDevice -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetDevice" ---- - -# `greg.NETWORK.GetDevice` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetDevice - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetDevice(string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetDevice | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetDevice`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetDevice", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetDevice`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetDevice", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetDevice", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetDevice", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetDevice", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetDevice", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetDevice", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetDevice` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getfreespaceinthebox.md b/docs/02_development/hooks-library/network/greg-network-getfreespaceinthebox.md deleted file mode 100644 index 4cc4acea..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getfreespaceinthebox.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetFreeSpaceInTheBox -sidebar_label: greg.NETWORK.GetFreeSpaceInTheBox -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPBox.GetFreeSpaceInTheBox" ---- - -# `greg.NETWORK.GetFreeSpaceInTheBox` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPBox.GetFreeSpaceInTheBox - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPBox::GetFreeSpaceInTheBox()` | Postfix | Auto-generated from Il2Cpp unpack: SFPBox.GetFreeSpaceInTheBox | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetFreeSpaceInTheBox`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetFreeSpaceInTheBox", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetFreeSpaceInTheBox`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetFreeSpaceInTheBox", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetFreeSpaceInTheBox", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetFreeSpaceInTheBox", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetFreeSpaceInTheBox", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetFreeSpaceInTheBox", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetFreeSpaceInTheBox", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetFreeSpaceInTheBox` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getlacpgroupbetween.md b/docs/02_development/hooks-library/network/greg-network-getlacpgroupbetween.md deleted file mode 100644 index 0f502661..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getlacpgroupbetween.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetLACPGroupBetween -sidebar_label: greg.NETWORK.GetLACPGroupBetween -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetLACPGroupBetween" ---- - -# `greg.NETWORK.GetLACPGroupBetween` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetLACPGroupBetween - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetLACPGroupBetween(string, string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetLACPGroupBetween | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetLACPGroupBetween`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetLACPGroupBetween", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetLACPGroupBetween`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetLACPGroupBetween", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetLACPGroupBetween", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetLACPGroupBetween", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetLACPGroupBetween", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetLACPGroupBetween", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetLACPGroupBetween", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetLACPGroupBetween` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getlacpgroupforcable.md b/docs/02_development/hooks-library/network/greg-network-getlacpgroupforcable.md deleted file mode 100644 index 90e0def4..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getlacpgroupforcable.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetLACPGroupForCable -sidebar_label: greg.NETWORK.GetLACPGroupForCable -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetLACPGroupForCable" ---- - -# `greg.NETWORK.GetLACPGroupForCable` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetLACPGroupForCable - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetLACPGroupForCable(int)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetLACPGroupForCable | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetLACPGroupForCable`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetLACPGroupForCable", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetLACPGroupForCable`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetLACPGroupForCable", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetLACPGroupForCable", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetLACPGroupForCable", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetLACPGroupForCable", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetLACPGroupForCable", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetLACPGroupForCable", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetLACPGroupForCable` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getrawcablepositions.md b/docs/02_development/hooks-library/network/greg-network-getrawcablepositions.md deleted file mode 100644 index 65badfdd..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getrawcablepositions.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetRawCablePositions -sidebar_label: greg.NETWORK.GetRawCablePositions -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.GetRawCablePositions" ---- - -# `greg.NETWORK.GetRawCablePositions` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.GetRawCablePositions - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::GetRawCablePositions(int)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.GetRawCablePositions | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetRawCablePositions`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetRawCablePositions", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetRawCablePositions`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetRawCablePositions", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetRawCablePositions", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetRawCablePositions", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetRawCablePositions", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetRawCablePositions", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetRawCablePositions", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetRawCablePositions` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getrawlinktransforms.md b/docs/02_development/hooks-library/network/greg-network-getrawlinktransforms.md deleted file mode 100644 index 4ad2a5d4..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getrawlinktransforms.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetRawLinkTransforms -sidebar_label: greg.NETWORK.GetRawLinkTransforms -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.GetRawLinkTransforms" ---- - -# `greg.NETWORK.GetRawLinkTransforms` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.GetRawLinkTransforms - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::GetRawLinkTransforms(int)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.GetRawLinkTransforms | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetRawLinkTransforms`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetRawLinkTransforms", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetRawLinkTransforms`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetRawLinkTransforms", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetRawLinkTransforms", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetRawLinkTransforms", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetRawLinkTransforms", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetRawLinkTransforms", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetRawLinkTransforms", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetRawLinkTransforms` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getropeattachpoint.md b/docs/02_development/hooks-library/network/greg-network-getropeattachpoint.md deleted file mode 100644 index 4c9168df..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getropeattachpoint.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetRopeAttachPoint -sidebar_label: greg.NETWORK.GetRopeAttachPoint -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CableLink.GetRopeAttachPoint" ---- - -# `greg.NETWORK.GetRopeAttachPoint` - -## Description - -- Auto-generated from Il2Cpp unpack: CableLink.GetRopeAttachPoint - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CableLink::GetRopeAttachPoint()` | Postfix | Auto-generated from Il2Cpp unpack: CableLink.GetRopeAttachPoint | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetRopeAttachPoint`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetRopeAttachPoint", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetRopeAttachPoint`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetRopeAttachPoint", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetRopeAttachPoint", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetRopeAttachPoint", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetRopeAttachPoint", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetRopeAttachPoint", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetRopeAttachPoint", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetRopeAttachPoint` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getserver.md b/docs/02_development/hooks-library/network/greg-network-getserver.md deleted file mode 100644 index 96f8190f..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getserver.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetServer -sidebar_label: greg.NETWORK.GetServer -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetServer" ---- - -# `greg.NETWORK.GetServer` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetServer - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetServer(string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetServer | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetServer`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetServer", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetServer`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetServer", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetServer", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetServer", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetServer", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetServer", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetServer", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetServer` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getswitchbyid.md b/docs/02_development/hooks-library/network/greg-network-getswitchbyid.md deleted file mode 100644 index 8a4b2168..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getswitchbyid.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetSwitchById -sidebar_label: greg.NETWORK.GetSwitchById -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.GetSwitchById" ---- - -# `greg.NETWORK.GetSwitchById` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.GetSwitchById - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::GetSwitchById(string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.GetSwitchById | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetSwitchById`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetSwitchById", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetSwitchById`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetSwitchById", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetSwitchById", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetSwitchById", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetSwitchById", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetSwitchById", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetSwitchById", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetSwitchById` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-getswitchid.md b/docs/02_development/hooks-library/network/greg-network-getswitchid.md deleted file mode 100644 index da084023..00000000 --- a/docs/02_development/hooks-library/network/greg-network-getswitchid.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.GetSwitchId -sidebar_label: greg.NETWORK.GetSwitchId -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.GetSwitchId" ---- - -# `greg.NETWORK.GetSwitchId` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.GetSwitchId - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::GetSwitchId()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.GetSwitchId | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.GetSwitchId`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.GetSwitchId", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.GetSwitchId`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.GetSwitchId", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.GetSwitchId", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.GetSwitchId", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.GetSwitchId", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.GetSwitchId", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.GetSwitchId", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.GetSwitchId` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-handlenewcablewhileoff.md b/docs/02_development/hooks-library/network/greg-network-handlenewcablewhileoff.md deleted file mode 100644 index c96e179a..00000000 --- a/docs/02_development/hooks-library/network/greg-network-handlenewcablewhileoff.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.HandleNewCableWhileOff -sidebar_label: greg.NETWORK.HandleNewCableWhileOff -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.HandleNewCableWhileOff" ---- - -# `greg.NETWORK.HandleNewCableWhileOff` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.HandleNewCableWhileOff - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::HandleNewCableWhileOff(int)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.HandleNewCableWhileOff | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.HandleNewCableWhileOff`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.HandleNewCableWhileOff", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.HandleNewCableWhileOff`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.HandleNewCableWhileOff", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.HandleNewCableWhileOff", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.HandleNewCableWhileOff", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.HandleNewCableWhileOff", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.HandleNewCableWhileOff", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.HandleNewCableWhileOff", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.HandleNewCableWhileOff` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-insertdirectlyintoport.md b/docs/02_development/hooks-library/network/greg-network-insertdirectlyintoport.md deleted file mode 100644 index 0bf2255a..00000000 --- a/docs/02_development/hooks-library/network/greg-network-insertdirectlyintoport.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.InsertDirectlyIntoPort -sidebar_label: greg.NETWORK.InsertDirectlyIntoPort -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPModule.InsertDirectlyIntoPort" ---- - -# `greg.NETWORK.InsertDirectlyIntoPort` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPModule.InsertDirectlyIntoPort - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPModule::InsertDirectlyIntoPort(CableLink)` | Postfix | Auto-generated from Il2Cpp unpack: SFPModule.InsertDirectlyIntoPort | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.InsertDirectlyIntoPort`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.InsertDirectlyIntoPort", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.InsertDirectlyIntoPort`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.InsertDirectlyIntoPort", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.InsertDirectlyIntoPort", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.InsertDirectlyIntoPort", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.InsertDirectlyIntoPort", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.InsertDirectlyIntoPort", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.InsertDirectlyIntoPort", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.InsertDirectlyIntoPort` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-insertedinsfpport.md b/docs/02_development/hooks-library/network/greg-network-insertedinsfpport.md deleted file mode 100644 index 8f781b86..00000000 --- a/docs/02_development/hooks-library/network/greg-network-insertedinsfpport.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.InsertedInSFPPort -sidebar_label: greg.NETWORK.InsertedInSFPPort -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPModule.InsertedInSFPPort" ---- - -# `greg.NETWORK.InsertedInSFPPort` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPModule.InsertedInSFPPort - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPModule::InsertedInSFPPort(CableLink, bool)` | Postfix | Auto-generated from Il2Cpp unpack: SFPModule.InsertedInSFPPort | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.InsertedInSFPPort`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.InsertedInSFPPort", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.InsertedInSFPPort`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.InsertedInSFPPort", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.InsertedInSFPPort", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.InsertedInSFPPort", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.InsertedInSFPPort", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.InsertedInSFPPort", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.InsertedInSFPPort", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.InsertedInSFPPort` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-insertsfpbackintobox.md b/docs/02_development/hooks-library/network/greg-network-insertsfpbackintobox.md deleted file mode 100644 index 114201fd..00000000 --- a/docs/02_development/hooks-library/network/greg-network-insertsfpbackintobox.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.InsertSFPBackIntoBox -sidebar_label: greg.NETWORK.InsertSFPBackIntoBox -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPBox.InsertSFPBackIntoBox" ---- - -# `greg.NETWORK.InsertSFPBackIntoBox` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPBox.InsertSFPBackIntoBox - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPBox::InsertSFPBackIntoBox()` | Postfix | Auto-generated from Il2Cpp unpack: SFPBox.InsertSFPBackIntoBox | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.InsertSFPBackIntoBox`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.InsertSFPBackIntoBox", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.InsertSFPBackIntoBox`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.InsertSFPBackIntoBox", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.InsertSFPBackIntoBox", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.InsertSFPBackIntoBox", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.InsertSFPBackIntoBox", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.InsertSFPBackIntoBox", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.InsertSFPBackIntoBox", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.InsertSFPBackIntoBox` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-interactonclick.md b/docs/02_development/hooks-library/network/greg-network-interactonclick.md deleted file mode 100644 index 639f2c47..00000000 --- a/docs/02_development/hooks-library/network/greg-network-interactonclick.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: greg.NETWORK.InteractOnClick -sidebar_label: greg.NETWORK.InteractOnClick -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CableLink.InteractOnClick" ---- - -# `greg.NETWORK.InteractOnClick` - -## Description - -- Auto-generated from Il2Cpp unpack: CableLink.InteractOnClick -- Auto-generated from Il2Cpp unpack: NetworkSwitch.InteractOnClick -- Auto-generated from Il2Cpp unpack: SFPBox.InteractOnClick -- Auto-generated from Il2Cpp unpack: SFPModule.InteractOnClick - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **4** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CableLink::InteractOnClick()` | Postfix | Auto-generated from Il2Cpp unpack: CableLink.InteractOnClick | -| `Il2Cpp.NetworkSwitch::InteractOnClick()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.InteractOnClick | -| `Il2Cpp.SFPBox::InteractOnClick()` | Postfix | Auto-generated from Il2Cpp unpack: SFPBox.InteractOnClick | -| `Il2Cpp.SFPModule::InteractOnClick()` | Postfix | Auto-generated from Il2Cpp unpack: SFPModule.InteractOnClick | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.InteractOnClick`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.InteractOnClick", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.InteractOnClick`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.InteractOnClick", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.InteractOnClick", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.InteractOnClick", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.InteractOnClick", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.InteractOnClick", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.InteractOnClick", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.InteractOnClick` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-isallowedtodosecondaction.md b/docs/02_development/hooks-library/network/greg-network-isallowedtodosecondaction.md deleted file mode 100644 index 5bf75b8c..00000000 --- a/docs/02_development/hooks-library/network/greg-network-isallowedtodosecondaction.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.IsAllowedToDoSecondAction -sidebar_label: greg.NETWORK.IsAllowedToDoSecondAction -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CableLink.IsAllowedToDoSecondAction" ---- - -# `greg.NETWORK.IsAllowedToDoSecondAction` - -## Description - -- Auto-generated from Il2Cpp unpack: CableLink.IsAllowedToDoSecondAction - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CableLink::IsAllowedToDoSecondAction()` | Postfix | Auto-generated from Il2Cpp unpack: CableLink.IsAllowedToDoSecondAction | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.IsAllowedToDoSecondAction`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.IsAllowedToDoSecondAction", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.IsAllowedToDoSecondAction`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.IsAllowedToDoSecondAction", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.IsAllowedToDoSecondAction", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.IsAllowedToDoSecondAction", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.IsAllowedToDoSecondAction", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.IsAllowedToDoSecondAction", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.IsAllowedToDoSecondAction", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.IsAllowedToDoSecondAction` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-isanycableconnected.md b/docs/02_development/hooks-library/network/greg-network-isanycableconnected.md deleted file mode 100644 index 37b6a0f5..00000000 --- a/docs/02_development/hooks-library/network/greg-network-isanycableconnected.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.NETWORK.IsAnyCableConnected -sidebar_label: greg.NETWORK.IsAnyCableConnected -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.IsAnyCableConnected" ---- - -# `greg.NETWORK.IsAnyCableConnected` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.IsAnyCableConnected -- Auto-generated from Il2Cpp unpack: SFPModule.IsAnyCableConnected - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **2** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::IsAnyCableConnected()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.IsAnyCableConnected | -| `Il2Cpp.SFPModule::IsAnyCableConnected()` | Postfix | Auto-generated from Il2Cpp unpack: SFPModule.IsAnyCableConnected | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.IsAnyCableConnected`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.IsAnyCableConnected", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.IsAnyCableConnected`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.IsAnyCableConnected", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.IsAnyCableConnected", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.IsAnyCableConnected", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.IsAnyCableConnected", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.IsAnyCableConnected", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.IsAnyCableConnected", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.IsAnyCableConnected` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-iscablecomplete.md b/docs/02_development/hooks-library/network/greg-network-iscablecomplete.md deleted file mode 100644 index 05de40e4..00000000 --- a/docs/02_development/hooks-library/network/greg-network-iscablecomplete.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.IsCableComplete -sidebar_label: greg.NETWORK.IsCableComplete -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.IsCableComplete" ---- - -# `greg.NETWORK.IsCableComplete` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.IsCableComplete - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::IsCableComplete(int)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.IsCableComplete | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.IsCableComplete`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.IsCableComplete", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.IsCableComplete`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.IsCableComplete", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.IsCableComplete", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.IsCableComplete", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.IsCableComplete", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.IsCableComplete", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.IsCableComplete", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.IsCableComplete` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-isipaddressduplicate.md b/docs/02_development/hooks-library/network/greg-network-isipaddressduplicate.md deleted file mode 100644 index 588fac51..00000000 --- a/docs/02_development/hooks-library/network/greg-network-isipaddressduplicate.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.IsIpAddressDuplicate -sidebar_label: greg.NETWORK.IsIpAddressDuplicate -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.IsIpAddressDuplicate" ---- - -# `greg.NETWORK.IsIpAddressDuplicate` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.IsIpAddressDuplicate - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::IsIpAddressDuplicate(string, Server)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.IsIpAddressDuplicate | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.IsIpAddressDuplicate`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.IsIpAddressDuplicate", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.IsIpAddressDuplicate`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.IsIpAddressDuplicate", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.IsIpAddressDuplicate", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.IsIpAddressDuplicate", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.IsIpAddressDuplicate", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.IsIpAddressDuplicate", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.IsIpAddressDuplicate", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.IsIpAddressDuplicate` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-isolateddevicesremoved.md b/docs/02_development/hooks-library/network/greg-network-isolateddevicesremoved.md deleted file mode 100644 index 501caa21..00000000 --- a/docs/02_development/hooks-library/network/greg-network-isolateddevicesremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.IsolatedDevicesRemoved -sidebar_label: greg.NETWORK.IsolatedDevicesRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RemoveIsolatedDevices" ---- - -# `greg.NETWORK.IsolatedDevicesRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RemoveIsolatedDevices - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RemoveIsolatedDevices()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RemoveIsolatedDevices | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.IsolatedDevicesRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.IsolatedDevicesRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.IsolatedDevicesRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.IsolatedDevicesRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.IsolatedDevicesRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.IsolatedDevicesRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.IsolatedDevicesRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.IsolatedDevicesRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.IsolatedDevicesRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.IsolatedDevicesRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-ispatchpanelport.md b/docs/02_development/hooks-library/network/greg-network-ispatchpanelport.md deleted file mode 100644 index 512bfb1d..00000000 --- a/docs/02_development/hooks-library/network/greg-network-ispatchpanelport.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.IsPatchPanelPort -sidebar_label: greg.NETWORK.IsPatchPanelPort -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.IsPatchPanelPort" ---- - -# `greg.NETWORK.IsPatchPanelPort` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.IsPatchPanelPort - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::IsPatchPanelPort(string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.IsPatchPanelPort | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.IsPatchPanelPort`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.IsPatchPanelPort", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.IsPatchPanelPort`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.IsPatchPanelPort", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.IsPatchPanelPort", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.IsPatchPanelPort", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.IsPatchPanelPort", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.IsPatchPanelPort", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.IsPatchPanelPort", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.IsPatchPanelPort` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-itisbroken.md b/docs/02_development/hooks-library/network/greg-network-itisbroken.md deleted file mode 100644 index 0827eb89..00000000 --- a/docs/02_development/hooks-library/network/greg-network-itisbroken.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ItIsBroken -sidebar_label: greg.NETWORK.ItIsBroken -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.ItIsBroken" ---- - -# `greg.NETWORK.ItIsBroken` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.ItIsBroken - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::ItIsBroken()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.ItIsBroken | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ItIsBroken`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ItIsBroken", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ItIsBroken`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ItIsBroken", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ItIsBroken", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ItIsBroken", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ItIsBroken", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ItIsBroken", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ItIsBroken", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ItIsBroken` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-lacpgroupremoved.md b/docs/02_development/hooks-library/network/greg-network-lacpgroupremoved.md deleted file mode 100644 index 8380090f..00000000 --- a/docs/02_development/hooks-library/network/greg-network-lacpgroupremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.LACPGroupRemoved -sidebar_label: greg.NETWORK.LACPGroupRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RemoveLACPGroup" ---- - -# `greg.NETWORK.LACPGroupRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RemoveLACPGroup - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RemoveLACPGroup(int)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RemoveLACPGroup | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.LACPGroupRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.LACPGroupRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.LACPGroupRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.LACPGroupRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.LACPGroupRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.LACPGroupRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.LACPGroupRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.LACPGroupRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.LACPGroupRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.LACPGroupRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-lacpgroupsset.md b/docs/02_development/hooks-library/network/greg-network-lacpgroupsset.md deleted file mode 100644 index 88a8796e..00000000 --- a/docs/02_development/hooks-library/network/greg-network-lacpgroupsset.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.LACPGroupsSet -sidebar_label: greg.NETWORK.LACPGroupsSet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.SetLACPGroups" ---- - -# `greg.NETWORK.LACPGroupsSet` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.SetLACPGroups - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::SetLACPGroups(Dictionary)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.SetLACPGroups | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.LACPGroupsSet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.LACPGroupsSet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.LACPGroupsSet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.LACPGroupsSet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.LACPGroupsSet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.LACPGroupsSet", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.LACPGroupsSet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.LACPGroupsSet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.LACPGroupsSet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.LACPGroupsSet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-lastpositionremoved.md b/docs/02_development/hooks-library/network/greg-network-lastpositionremoved.md deleted file mode 100644 index 0ca91847..00000000 --- a/docs/02_development/hooks-library/network/greg-network-lastpositionremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.LastPositionRemoved -sidebar_label: greg.NETWORK.LastPositionRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.RemoveLastPosition" ---- - -# `greg.NETWORK.LastPositionRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.RemoveLastPosition - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::RemoveLastPosition(int)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.RemoveLastPosition | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.LastPositionRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.LastPositionRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.LastPositionRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.LastPositionRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.LastPositionRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.LastPositionRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.LastPositionRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.LastPositionRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.LastPositionRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.LastPositionRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-method-internal-static-void-intptr-intptr-pdm-0.md b/docs/02_development/hooks-library/network/greg-network-method-internal-static-void-intptr-intptr-pdm-0.md deleted file mode 100644 index c8e233b9..00000000 --- a/docs/02_development/hooks-library/network/greg-network-method-internal-static-void-intptr-intptr-pdm-0.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0 -sidebar_label: greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0 -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PacketSpawnerSystem.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0" ---- - -# `greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0` - -## Description - -- Auto-generated from Il2Cpp unpack: PacketSpawnerSystem.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0 - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PacketSpawnerSystem::Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0(IntPtr, IntPtr)` | Postfix | Auto-generated from Il2Cpp unpack: PacketSpawnerSystem.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0 | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_0` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-method-internal-static-void-intptr-intptr-pdm-1.md b/docs/02_development/hooks-library/network/greg-network-method-internal-static-void-intptr-intptr-pdm-1.md deleted file mode 100644 index c1a8c29f..00000000 --- a/docs/02_development/hooks-library/network/greg-network-method-internal-static-void-intptr-intptr-pdm-1.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1 -sidebar_label: greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1 -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PacketSpawnerSystem.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1" ---- - -# `greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1` - -## Description - -- Auto-generated from Il2Cpp unpack: PacketSpawnerSystem.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1 - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PacketSpawnerSystem::Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1(IntPtr, IntPtr)` | Postfix | Auto-generated from Il2Cpp unpack: PacketSpawnerSystem.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1 | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.Method_Internal_Static_Void_IntPtr_IntPtr_PDM_1` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-ondestroy.md b/docs/02_development/hooks-library/network/greg-network-ondestroy.md deleted file mode 100644 index 44763e11..00000000 --- a/docs/02_development/hooks-library/network/greg-network-ondestroy.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.NETWORK.OnDestroy -sidebar_label: greg.NETWORK.OnDestroy -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.OnDestroy" ---- - -# `greg.NETWORK.OnDestroy` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.OnDestroy -- Auto-generated from Il2Cpp unpack: SFPModule.OnDestroy - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **2** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.OnDestroy | -| `Il2Cpp.SFPModule::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: SFPModule.OnDestroy | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.OnDestroy`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.OnDestroy", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.OnDestroy`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.OnDestroy", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.OnDestroy", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.OnDestroy", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.OnDestroy", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.OnDestroy", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.OnDestroy", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.OnDestroy` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-onhoverover.md b/docs/02_development/hooks-library/network/greg-network-onhoverover.md deleted file mode 100644 index c017e2bf..00000000 --- a/docs/02_development/hooks-library/network/greg-network-onhoverover.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.OnHoverOver -sidebar_label: greg.NETWORK.OnHoverOver -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CableLink.OnHoverOver" ---- - -# `greg.NETWORK.OnHoverOver` - -## Description - -- Auto-generated from Il2Cpp unpack: CableLink.OnHoverOver - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CableLink::OnHoverOver()` | Postfix | Auto-generated from Il2Cpp unpack: CableLink.OnHoverOver | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.OnHoverOver`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.OnHoverOver", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.OnHoverOver`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.OnHoverOver", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.OnHoverOver", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.OnHoverOver", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.OnHoverOver", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.OnHoverOver", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.OnHoverOver", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.OnHoverOver` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-powerbutton.md b/docs/02_development/hooks-library/network/greg-network-powerbutton.md deleted file mode 100644 index 7a6f3b77..00000000 --- a/docs/02_development/hooks-library/network/greg-network-powerbutton.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.PowerButton -sidebar_label: greg.NETWORK.PowerButton -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.PowerButton" ---- - -# `greg.NETWORK.PowerButton` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.PowerButton - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::PowerButton(bool)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.PowerButton | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.PowerButton`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.PowerButton", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.PowerButton`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.PowerButton", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.PowerButton", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.PowerButton", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.PowerButton", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.PowerButton", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.PowerButton", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.PowerButton` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-powerlightmaterialset.md b/docs/02_development/hooks-library/network/greg-network-powerlightmaterialset.md deleted file mode 100644 index 015abe55..00000000 --- a/docs/02_development/hooks-library/network/greg-network-powerlightmaterialset.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.PowerLightMaterialSet -sidebar_label: greg.NETWORK.PowerLightMaterialSet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.SetPowerLightMaterial" ---- - -# `greg.NETWORK.PowerLightMaterialSet` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.SetPowerLightMaterial - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::SetPowerLightMaterial(Material)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.SetPowerLightMaterial | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.PowerLightMaterialSet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.PowerLightMaterialSet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.PowerLightMaterialSet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.PowerLightMaterialSet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.PowerLightMaterialSet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.PowerLightMaterialSet", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.PowerLightMaterialSet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.PowerLightMaterialSet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.PowerLightMaterialSet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.PowerLightMaterialSet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-printnetworkmap.md b/docs/02_development/hooks-library/network/greg-network-printnetworkmap.md deleted file mode 100644 index 0e460698..00000000 --- a/docs/02_development/hooks-library/network/greg-network-printnetworkmap.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.PrintNetworkMap -sidebar_label: greg.NETWORK.PrintNetworkMap -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.PrintNetworkMap" ---- - -# `greg.NETWORK.PrintNetworkMap` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.PrintNetworkMap - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::PrintNetworkMap()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.PrintNetworkMap | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.PrintNetworkMap`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.PrintNetworkMap", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.PrintNetworkMap`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.PrintNetworkMap", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.PrintNetworkMap", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.PrintNetworkMap", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.PrintNetworkMap", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.PrintNetworkMap", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.PrintNetworkMap", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.PrintNetworkMap` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-reconnectcables.md b/docs/02_development/hooks-library/network/greg-network-reconnectcables.md deleted file mode 100644 index 6d874e65..00000000 --- a/docs/02_development/hooks-library/network/greg-network-reconnectcables.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ReconnectCables -sidebar_label: greg.NETWORK.ReconnectCables -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.ReconnectCables" ---- - -# `greg.NETWORK.ReconnectCables` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.ReconnectCables - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::ReconnectCables()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.ReconnectCables | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ReconnectCables`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ReconnectCables", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ReconnectCables`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ReconnectCables", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ReconnectCables", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ReconnectCables", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ReconnectCables", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ReconnectCables", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ReconnectCables", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ReconnectCables` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-redrawcable.md b/docs/02_development/hooks-library/network/greg-network-redrawcable.md deleted file mode 100644 index bdec8379..00000000 --- a/docs/02_development/hooks-library/network/greg-network-redrawcable.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.RedrawCable -sidebar_label: greg.NETWORK.RedrawCable -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CablePositions.RedrawCable" ---- - -# `greg.NETWORK.RedrawCable` - -## Description - -- Auto-generated from Il2Cpp unpack: CablePositions.RedrawCable - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CablePositions::RedrawCable(int)` | Postfix | Auto-generated from Il2Cpp unpack: CablePositions.RedrawCable | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.RedrawCable`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.RedrawCable", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.RedrawCable`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.RedrawCable", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.RedrawCable", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.RedrawCable", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.RedrawCable", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.RedrawCable", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.RedrawCable", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.RedrawCable` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-registercableconnection.md b/docs/02_development/hooks-library/network/greg-network-registercableconnection.md deleted file mode 100644 index 9b37e773..00000000 --- a/docs/02_development/hooks-library/network/greg-network-registercableconnection.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.RegisterCableConnection -sidebar_label: greg.NETWORK.RegisterCableConnection -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RegisterCableConnection" ---- - -# `greg.NETWORK.RegisterCableConnection` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RegisterCableConnection - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RegisterCableConnection(int, Vector3, Vector3, CableLink.TypeOfLink, CableLink.TypeOfLink, string, string, int, int, string, string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RegisterCableConnection | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.RegisterCableConnection`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.RegisterCableConnection", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.RegisterCableConnection`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.RegisterCableConnection", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.RegisterCableConnection", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.RegisterCableConnection", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.RegisterCableConnection", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.RegisterCableConnection", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.RegisterCableConnection", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.RegisterCableConnection` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-registercustomerbase.md b/docs/02_development/hooks-library/network/greg-network-registercustomerbase.md deleted file mode 100644 index 302f6502..00000000 --- a/docs/02_development/hooks-library/network/greg-network-registercustomerbase.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.RegisterCustomerBase -sidebar_label: greg.NETWORK.RegisterCustomerBase -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RegisterCustomerBase" ---- - -# `greg.NETWORK.RegisterCustomerBase` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RegisterCustomerBase - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RegisterCustomerBase(CustomerBase)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RegisterCustomerBase | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.RegisterCustomerBase`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.RegisterCustomerBase", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.RegisterCustomerBase`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.RegisterCustomerBase", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.RegisterCustomerBase", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.RegisterCustomerBase", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.RegisterCustomerBase", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.RegisterCustomerBase", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.RegisterCustomerBase", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.RegisterCustomerBase` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-registerserver.md b/docs/02_development/hooks-library/network/greg-network-registerserver.md deleted file mode 100644 index a2998024..00000000 --- a/docs/02_development/hooks-library/network/greg-network-registerserver.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.RegisterServer -sidebar_label: greg.NETWORK.RegisterServer -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RegisterServer" ---- - -# `greg.NETWORK.RegisterServer` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RegisterServer - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RegisterServer(Server)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RegisterServer | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.RegisterServer`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.RegisterServer", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.RegisterServer`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.RegisterServer", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.RegisterServer", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.RegisterServer", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.RegisterServer", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.RegisterServer", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.RegisterServer", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.RegisterServer` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-registerswitch.md b/docs/02_development/hooks-library/network/greg-network-registerswitch.md deleted file mode 100644 index e9cde6a5..00000000 --- a/docs/02_development/hooks-library/network/greg-network-registerswitch.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.RegisterSwitch -sidebar_label: greg.NETWORK.RegisterSwitch -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.RegisterSwitch" ---- - -# `greg.NETWORK.RegisterSwitch` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.RegisterSwitch - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::RegisterSwitch(NetworkSwitch)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.RegisterSwitch | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.RegisterSwitch`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.RegisterSwitch", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.RegisterSwitch`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.RegisterSwitch", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.RegisterSwitch", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.RegisterSwitch", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.RegisterSwitch", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.RegisterSwitch", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.RegisterSwitch", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.RegisterSwitch` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-resolvethroughpatchpanel.md b/docs/02_development/hooks-library/network/greg-network-resolvethroughpatchpanel.md deleted file mode 100644 index fb80c31b..00000000 --- a/docs/02_development/hooks-library/network/greg-network-resolvethroughpatchpanel.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ResolveThroughPatchPanel -sidebar_label: greg.NETWORK.ResolveThroughPatchPanel -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.ResolveThroughPatchPanel" ---- - -# `greg.NETWORK.ResolveThroughPatchPanel` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.ResolveThroughPatchPanel - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::ResolveThroughPatchPanel(string, string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.ResolveThroughPatchPanel | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ResolveThroughPatchPanel`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ResolveThroughPatchPanel", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ResolveThroughPatchPanel`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ResolveThroughPatchPanel", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ResolveThroughPatchPanel", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ResolveThroughPatchPanel", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ResolveThroughPatchPanel", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ResolveThroughPatchPanel", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ResolveThroughPatchPanel", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ResolveThroughPatchPanel` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-returnsfpdirectly.md b/docs/02_development/hooks-library/network/greg-network-returnsfpdirectly.md deleted file mode 100644 index 3d1b77c6..00000000 --- a/docs/02_development/hooks-library/network/greg-network-returnsfpdirectly.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ReturnSFPDirectly -sidebar_label: greg.NETWORK.ReturnSFPDirectly -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPBox.ReturnSFPDirectly" ---- - -# `greg.NETWORK.ReturnSFPDirectly` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPBox.ReturnSFPDirectly - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPBox::ReturnSFPDirectly(SFPModule)` | Postfix | Auto-generated from Il2Cpp unpack: SFPBox.ReturnSFPDirectly | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ReturnSFPDirectly`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ReturnSFPDirectly", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ReturnSFPDirectly`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ReturnSFPDirectly", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ReturnSFPDirectly", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ReturnSFPDirectly", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ReturnSFPDirectly", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ReturnSFPDirectly", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ReturnSFPDirectly", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ReturnSFPDirectly` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-screenuichanged.md b/docs/02_development/hooks-library/network/greg-network-screenuichanged.md deleted file mode 100644 index c5170d6f..00000000 --- a/docs/02_development/hooks-library/network/greg-network-screenuichanged.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ScreenUIChanged -sidebar_label: greg.NETWORK.ScreenUIChanged -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.UpdateScreenUI" ---- - -# `greg.NETWORK.ScreenUIChanged` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.UpdateScreenUI - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::UpdateScreenUI()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.UpdateScreenUI | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ScreenUIChanged`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ScreenUIChanged", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ScreenUIChanged`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ScreenUIChanged", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ScreenUIChanged", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ScreenUIChanged", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ScreenUIChanged", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ScreenUIChanged", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ScreenUIChanged", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ScreenUIChanged` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-secondactiononclick.md b/docs/02_development/hooks-library/network/greg-network-secondactiononclick.md deleted file mode 100644 index d093b8da..00000000 --- a/docs/02_development/hooks-library/network/greg-network-secondactiononclick.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.SecondActionOnClick -sidebar_label: greg.NETWORK.SecondActionOnClick -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: CableLink.SecondActionOnClick" ---- - -# `greg.NETWORK.SecondActionOnClick` - -## Description - -- Auto-generated from Il2Cpp unpack: CableLink.SecondActionOnClick - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.CableLink::SecondActionOnClick()` | Postfix | Auto-generated from Il2Cpp unpack: CableLink.SecondActionOnClick | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.SecondActionOnClick`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.SecondActionOnClick", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.SecondActionOnClick`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.SecondActionOnClick", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.SecondActionOnClick", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.SecondActionOnClick", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.SecondActionOnClick", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.SecondActionOnClick", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.SecondActionOnClick", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.SecondActionOnClick` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-sfpfromboxremoved.md b/docs/02_development/hooks-library/network/greg-network-sfpfromboxremoved.md deleted file mode 100644 index a85d879b..00000000 --- a/docs/02_development/hooks-library/network/greg-network-sfpfromboxremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.SFPFromBoxRemoved -sidebar_label: greg.NETWORK.SFPFromBoxRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPBox.RemoveSFPFromBox" ---- - -# `greg.NETWORK.SFPFromBoxRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPBox.RemoveSFPFromBox - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPBox::RemoveSFPFromBox(int)` | Postfix | Auto-generated from Il2Cpp unpack: SFPBox.RemoveSFPFromBox | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.SFPFromBoxRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.SFPFromBoxRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.SFPFromBoxRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.SFPFromBoxRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.SFPFromBoxRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.SFPFromBoxRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.SFPFromBoxRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.SFPFromBoxRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.SFPFromBoxRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.SFPFromBoxRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-sfpsfromsaveloaded.md b/docs/02_development/hooks-library/network/greg-network-sfpsfromsaveloaded.md deleted file mode 100644 index d08f319e..00000000 --- a/docs/02_development/hooks-library/network/greg-network-sfpsfromsaveloaded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.SFPsFromSaveLoaded -sidebar_label: greg.NETWORK.SFPsFromSaveLoaded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPBox.LoadSFPsFromSave" ---- - -# `greg.NETWORK.SFPsFromSaveLoaded` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPBox.LoadSFPsFromSave - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPBox::LoadSFPsFromSave()` | Postfix | Auto-generated from Il2Cpp unpack: SFPBox.LoadSFPsFromSave | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.SFPsFromSaveLoaded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.SFPsFromSaveLoaded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.SFPsFromSaveLoaded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.SFPsFromSaveLoaded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.SFPsFromSaveLoaded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.SFPsFromSaveLoaded", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.SFPsFromSaveLoaded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.SFPsFromSaveLoaded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.SFPsFromSaveLoaded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.SFPsFromSaveLoaded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-switchconnectionadded.md b/docs/02_development/hooks-library/network/greg-network-switchconnectionadded.md deleted file mode 100644 index 3fc42ad5..00000000 --- a/docs/02_development/hooks-library/network/greg-network-switchconnectionadded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.SwitchConnectionAdded -sidebar_label: greg.NETWORK.SwitchConnectionAdded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkMap.AddSwitchConnection" ---- - -# `greg.NETWORK.SwitchConnectionAdded` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkMap.AddSwitchConnection - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkMap::AddSwitchConnection(string, string)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkMap.AddSwitchConnection | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.SwitchConnectionAdded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.SwitchConnectionAdded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.SwitchConnectionAdded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.SwitchConnectionAdded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.SwitchConnectionAdded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.SwitchConnectionAdded", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.SwitchConnectionAdded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.SwitchConnectionAdded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.SwitchConnectionAdded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.SwitchConnectionAdded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-switchinsertedinrack.md b/docs/02_development/hooks-library/network/greg-network-switchinsertedinrack.md deleted file mode 100644 index cd5cc769..00000000 --- a/docs/02_development/hooks-library/network/greg-network-switchinsertedinrack.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.SwitchInsertedInRack -sidebar_label: greg.NETWORK.SwitchInsertedInRack -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.SwitchInsertedInRack" ---- - -# `greg.NETWORK.SwitchInsertedInRack` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.SwitchInsertedInRack - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::SwitchInsertedInRack(SwitchSaveData)` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.SwitchInsertedInRack | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.SwitchInsertedInRack`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.SwitchInsertedInRack", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.SwitchInsertedInRack`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.SwitchInsertedInRack", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.SwitchInsertedInRack", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.SwitchInsertedInRack", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.SwitchInsertedInRack", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.SwitchInsertedInRack", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.SwitchInsertedInRack", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.SwitchInsertedInRack` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-takesfpfrombox.md b/docs/02_development/hooks-library/network/greg-network-takesfpfrombox.md deleted file mode 100644 index 235b655a..00000000 --- a/docs/02_development/hooks-library/network/greg-network-takesfpfrombox.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.TakeSFPFromBox -sidebar_label: greg.NETWORK.TakeSFPFromBox -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: SFPBox.TakeSFPFromBox" ---- - -# `greg.NETWORK.TakeSFPFromBox` - -## Description - -- Auto-generated from Il2Cpp unpack: SFPBox.TakeSFPFromBox - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.SFPBox::TakeSFPFromBox()` | Postfix | Auto-generated from Il2Cpp unpack: SFPBox.TakeSFPFromBox | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.TakeSFPFromBox`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.TakeSFPFromBox", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.TakeSFPFromBox`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.TakeSFPFromBox", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.TakeSFPFromBox", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.TakeSFPFromBox", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.TakeSFPFromBox", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.TakeSFPFromBox", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.TakeSFPFromBox", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.TakeSFPFromBox` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-turnoffcommonfunctions.md b/docs/02_development/hooks-library/network/greg-network-turnoffcommonfunctions.md deleted file mode 100644 index 5772e94a..00000000 --- a/docs/02_development/hooks-library/network/greg-network-turnoffcommonfunctions.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.TurnOffCommonFunctions -sidebar_label: greg.NETWORK.TurnOffCommonFunctions -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.TurnOffCommonFunctions" ---- - -# `greg.NETWORK.TurnOffCommonFunctions` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.TurnOffCommonFunctions - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::TurnOffCommonFunctions()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.TurnOffCommonFunctions | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.TurnOffCommonFunctions`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.TurnOffCommonFunctions", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.TurnOffCommonFunctions`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.TurnOffCommonFunctions", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.TurnOffCommonFunctions", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.TurnOffCommonFunctions", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.TurnOffCommonFunctions", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.TurnOffCommonFunctions", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.TurnOffCommonFunctions", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.TurnOffCommonFunctions` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-turnoncommonfunction.md b/docs/02_development/hooks-library/network/greg-network-turnoncommonfunction.md deleted file mode 100644 index a2fc8a92..00000000 --- a/docs/02_development/hooks-library/network/greg-network-turnoncommonfunction.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.TurnOnCommonFunction -sidebar_label: greg.NETWORK.TurnOnCommonFunction -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.TurnOnCommonFunction" ---- - -# `greg.NETWORK.TurnOnCommonFunction` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.TurnOnCommonFunction - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::TurnOnCommonFunction()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.TurnOnCommonFunction | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.TurnOnCommonFunction`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.TurnOnCommonFunction", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.TurnOnCommonFunction`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.TurnOnCommonFunction", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.TurnOnCommonFunction", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.TurnOnCommonFunction", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.TurnOnCommonFunction", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.TurnOnCommonFunction", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.TurnOnCommonFunction", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.TurnOnCommonFunction` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/network/greg-network-validaterackposition.md b/docs/02_development/hooks-library/network/greg-network-validaterackposition.md deleted file mode 100644 index 3ffff4f9..00000000 --- a/docs/02_development/hooks-library/network/greg-network-validaterackposition.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.NETWORK.ValidateRackPosition -sidebar_label: greg.NETWORK.ValidateRackPosition -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: NetworkSwitch.ValidateRackPosition" ---- - -# `greg.NETWORK.ValidateRackPosition` - -## Description - -- Auto-generated from Il2Cpp unpack: NetworkSwitch.ValidateRackPosition - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.NetworkSwitch::ValidateRackPosition()` | Postfix | Auto-generated from Il2Cpp unpack: NetworkSwitch.ValidateRackPosition | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.NETWORK.ValidateRackPosition`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.NETWORK.ValidateRackPosition", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.NETWORK.ValidateRackPosition`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.NETWORK.ValidateRackPosition", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.NETWORK.ValidateRackPosition", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.NETWORK.ValidateRackPosition", |payload| { - if let Some(method) = payload.get("method") { - println!("[NETWORK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.NETWORK.ValidateRackPosition", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[NETWORK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.NETWORK.ValidateRackPosition", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.NETWORK.ValidateRackPosition", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[NETWORK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.NETWORK.ValidateRackPosition` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/_category_.json b/docs/02_development/hooks-library/player/_category_.json deleted file mode 100644 index 3aa548d9..00000000 --- a/docs/02_development/hooks-library/player/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "PLAYER hooks", - "position": 1, - "collapsible": true, - "collapsed": true -} - diff --git a/docs/02_development/hooks-library/player/greg-player-checkfallsthroughmap.md b/docs/02_development/hooks-library/player/greg-player-checkfallsthroughmap.md deleted file mode 100644 index 38286977..00000000 --- a/docs/02_development/hooks-library/player/greg-player-checkfallsthroughmap.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.PLAYER.CheckFallsThroughMap -sidebar_label: greg.PLAYER.CheckFallsThroughMap -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Player.CheckFallsThroughMap" ---- - -# `greg.PLAYER.CheckFallsThroughMap` - -## Description - -- Auto-generated from Il2Cpp unpack: Player.CheckFallsThroughMap - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Player::CheckFallsThroughMap()` | Postfix | Auto-generated from Il2Cpp unpack: Player.CheckFallsThroughMap | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.CheckFallsThroughMap`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.CheckFallsThroughMap", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.CheckFallsThroughMap`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.CheckFallsThroughMap", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.CheckFallsThroughMap", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.CheckFallsThroughMap", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.CheckFallsThroughMap", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.CheckFallsThroughMap", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.CheckFallsThroughMap", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.CheckFallsThroughMap` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/greg-player-componentinitialized.md b/docs/02_development/hooks-library/player/greg-player-componentinitialized.md deleted file mode 100644 index 096cb60f..00000000 --- a/docs/02_development/hooks-library/player/greg-player-componentinitialized.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: greg.PLAYER.ComponentInitialized -sidebar_label: greg.PLAYER.ComponentInitialized -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Player.Start" ---- - -# `greg.PLAYER.ComponentInitialized` - -## Description - -- Auto-generated from Il2Cpp unpack: Player.Start -- Auto-generated from Il2Cpp unpack: PlayerHit.OnEnable -- Auto-generated from Il2Cpp unpack: PlayerManager.Awake -- Auto-generated from Il2Cpp unpack: PlayerManager.Start - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **4** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Player::Start()` | Postfix | Auto-generated from Il2Cpp unpack: Player.Start | -| `Il2Cpp.PlayerHit::OnEnable()` | Postfix | Auto-generated from Il2Cpp unpack: PlayerHit.OnEnable | -| `Il2Cpp.PlayerManager::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: PlayerManager.Awake | -| `Il2Cpp.PlayerManager::Start()` | Postfix | Auto-generated from Il2Cpp unpack: PlayerManager.Start | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `money` | `float` | -| `reputation` | `float` | -| `xp` | `float` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.ComponentInitialized`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.ComponentInitialized", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.ComponentInitialized`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.ComponentInitialized", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.ComponentInitialized", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.ComponentInitialized", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.ComponentInitialized", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.ComponentInitialized", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.ComponentInitialized", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.ComponentInitialized` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/greg-player-confinedcursorforui.md b/docs/02_development/hooks-library/player/greg-player-confinedcursorforui.md deleted file mode 100644 index 46f10c48..00000000 --- a/docs/02_development/hooks-library/player/greg-player-confinedcursorforui.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.PLAYER.ConfinedCursorforUI -sidebar_label: greg.PLAYER.ConfinedCursorforUI -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PlayerManager.ConfinedCursorforUI" ---- - -# `greg.PLAYER.ConfinedCursorforUI` - -## Description - -- Auto-generated from Il2Cpp unpack: PlayerManager.ConfinedCursorforUI - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PlayerManager::ConfinedCursorforUI()` | Postfix | Auto-generated from Il2Cpp unpack: PlayerManager.ConfinedCursorforUI | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.ConfinedCursorforUI`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.ConfinedCursorforUI", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.ConfinedCursorforUI`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.ConfinedCursorforUI", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.ConfinedCursorforUI", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.ConfinedCursorforUI", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.ConfinedCursorforUI", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.ConfinedCursorforUI", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.ConfinedCursorforUI", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.ConfinedCursorforUI` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/greg-player-defaultactioneffect.md b/docs/02_development/hooks-library/player/greg-player-defaultactioneffect.md deleted file mode 100644 index db637319..00000000 --- a/docs/02_development/hooks-library/player/greg-player-defaultactioneffect.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.PLAYER.DefaultActionEffect -sidebar_label: greg.PLAYER.DefaultActionEffect -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PlayerManager.DefaultActionEffect" ---- - -# `greg.PLAYER.DefaultActionEffect` - -## Description - -- Auto-generated from Il2Cpp unpack: PlayerManager.DefaultActionEffect - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PlayerManager::DefaultActionEffect(Vector3, float)` | Postfix | Auto-generated from Il2Cpp unpack: PlayerManager.DefaultActionEffect | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.DefaultActionEffect`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.DefaultActionEffect", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.DefaultActionEffect`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.DefaultActionEffect", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.DefaultActionEffect", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.DefaultActionEffect", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.DefaultActionEffect", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.DefaultActionEffect", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.DefaultActionEffect", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.DefaultActionEffect` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/greg-player-droppedallitems.md b/docs/02_development/hooks-library/player/greg-player-droppedallitems.md deleted file mode 100644 index e145cc85..00000000 --- a/docs/02_development/hooks-library/player/greg-player-droppedallitems.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.PLAYER.DroppedAllItems -sidebar_label: greg.PLAYER.DroppedAllItems -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Player.DropAllItems" ---- - -# `greg.PLAYER.DroppedAllItems` - -## Description - -- Auto-generated from Il2Cpp unpack: Player.DropAllItems - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Player::DropAllItems()` | Postfix | Auto-generated from Il2Cpp unpack: Player.DropAllItems | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `money` | `float` | -| `reputation` | `float` | -| `xp` | `float` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.DroppedAllItems`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.DroppedAllItems", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.DroppedAllItems`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.DroppedAllItems", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.DroppedAllItems", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.DroppedAllItems", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.DroppedAllItems", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.DroppedAllItems", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.DroppedAllItems", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.DroppedAllItems` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/greg-player-gainiopseffect.md b/docs/02_development/hooks-library/player/greg-player-gainiopseffect.md deleted file mode 100644 index 717516f0..00000000 --- a/docs/02_development/hooks-library/player/greg-player-gainiopseffect.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.PLAYER.GainIOPSEffect -sidebar_label: greg.PLAYER.GainIOPSEffect -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PlayerManager.GainIOPSEffect" ---- - -# `greg.PLAYER.GainIOPSEffect` - -## Description - -- Auto-generated from Il2Cpp unpack: PlayerManager.GainIOPSEffect - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PlayerManager::GainIOPSEffect()` | Postfix | Auto-generated from Il2Cpp unpack: PlayerManager.GainIOPSEffect | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.GainIOPSEffect`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.GainIOPSEffect", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.GainIOPSEffect`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.GainIOPSEffect", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.GainIOPSEffect", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.GainIOPSEffect", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.GainIOPSEffect", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.GainIOPSEffect", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.GainIOPSEffect", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.GainIOPSEffect` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/greg-player-loaded.md b/docs/02_development/hooks-library/player/greg-player-loaded.md deleted file mode 100644 index 56b7f76f..00000000 --- a/docs/02_development/hooks-library/player/greg-player-loaded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.PLAYER.Loaded -sidebar_label: greg.PLAYER.Loaded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Player.LoadPlayer" ---- - -# `greg.PLAYER.Loaded` - -## Description - -- Auto-generated from Il2Cpp unpack: Player.LoadPlayer - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Player::LoadPlayer(PlayerData)` | Postfix | Auto-generated from Il2Cpp unpack: Player.LoadPlayer | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `data` | `PlayerData` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.Loaded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.Loaded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.Loaded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.Loaded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.Loaded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.Loaded", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.Loaded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.Loaded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.Loaded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.Loaded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/greg-player-lockedcursorforplayermovement.md b/docs/02_development/hooks-library/player/greg-player-lockedcursorforplayermovement.md deleted file mode 100644 index 2ac15129..00000000 --- a/docs/02_development/hooks-library/player/greg-player-lockedcursorforplayermovement.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.PLAYER.LockedCursorForPlayerMovement -sidebar_label: greg.PLAYER.LockedCursorForPlayerMovement -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PlayerManager.LockedCursorForPlayerMovement" ---- - -# `greg.PLAYER.LockedCursorForPlayerMovement` - -## Description - -- Auto-generated from Il2Cpp unpack: PlayerManager.LockedCursorForPlayerMovement - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PlayerManager::LockedCursorForPlayerMovement()` | Postfix | Auto-generated from Il2Cpp unpack: PlayerManager.LockedCursorForPlayerMovement | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.LockedCursorForPlayerMovement`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.LockedCursorForPlayerMovement", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.LockedCursorForPlayerMovement`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.LockedCursorForPlayerMovement", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.LockedCursorForPlayerMovement", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.LockedCursorForPlayerMovement", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.LockedCursorForPlayerMovement", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.LockedCursorForPlayerMovement", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.LockedCursorForPlayerMovement", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.LockedCursorForPlayerMovement` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/greg-player-playerstopmovement.md b/docs/02_development/hooks-library/player/greg-player-playerstopmovement.md deleted file mode 100644 index 2f7b410e..00000000 --- a/docs/02_development/hooks-library/player/greg-player-playerstopmovement.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.PLAYER.PlayerStopMovement -sidebar_label: greg.PLAYER.PlayerStopMovement -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PlayerManager.PlayerStopMovement" ---- - -# `greg.PLAYER.PlayerStopMovement` - -## Description - -- Auto-generated from Il2Cpp unpack: PlayerManager.PlayerStopMovement - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PlayerManager::PlayerStopMovement()` | Postfix | Auto-generated from Il2Cpp unpack: PlayerManager.PlayerStopMovement | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.PlayerStopMovement`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.PlayerStopMovement", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.PlayerStopMovement`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.PlayerStopMovement", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.PlayerStopMovement", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.PlayerStopMovement", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.PlayerStopMovement", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.PlayerStopMovement", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.PlayerStopMovement", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.PlayerStopMovement` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/player/greg-player-warped.md b/docs/02_development/hooks-library/player/greg-player-warped.md deleted file mode 100644 index 654ed1a1..00000000 --- a/docs/02_development/hooks-library/player/greg-player-warped.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: greg.PLAYER.Warped -sidebar_label: greg.PLAYER.Warped -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Player.WarpPlayer" ---- - -# `greg.PLAYER.Warped` - -## Description - -- Auto-generated from Il2Cpp unpack: Player.WarpPlayer - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Player::WarpPlayer(Vector3, Quaternion)` | Postfix | Auto-generated from Il2Cpp unpack: Player.WarpPlayer | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `position` | `Vector3` | -| `rotation` | `Quaternion` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.PLAYER.Warped`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.PLAYER.Warped", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.PLAYER.Warped`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form ``greg..`` are additionally fired from the core via `GregHookIntegration` / `GregEventDispatcher.Emit` (numeric `EventIds` → String). If your hook is only defined in `greg_hooks.json` as an Il2Cpp patch, **HookBinder** is the correct entry point; use `GregEventDispatcher` if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.PLAYER.Warped", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.PLAYER.Warped", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.PLAYER.Warped", |payload| { - if let Some(method) = payload.get("method") { - println!("[PLAYER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.PLAYER.Warped", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[PLAYER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.PLAYER.Warped", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.PLAYER.Warped", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[PLAYER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.PLAYER.Warped` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/rack/_category_.json b/docs/02_development/hooks-library/rack/_category_.json deleted file mode 100644 index d55bd884..00000000 --- a/docs/02_development/hooks-library/rack/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "RACK hooks", - "position": 1, - "collapsible": true, - "collapsed": true -} - diff --git a/docs/02_development/hooks-library/rack/greg-rack-audiovolumechanged.md b/docs/02_development/hooks-library/rack/greg-rack-audiovolumechanged.md deleted file mode 100644 index 1b82b88b..00000000 --- a/docs/02_development/hooks-library/rack/greg-rack-audiovolumechanged.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.RACK.AudioVolumeChanged -sidebar_label: greg.RACK.AudioVolumeChanged -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Rack.UpdateAudioVolume" ---- - -# `greg.RACK.AudioVolumeChanged` - -## Description - -- Auto-generated from Il2Cpp unpack: Rack.UpdateAudioVolume - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Rack::UpdateAudioVolume()` | Postfix | Auto-generated from Il2Cpp unpack: Rack.UpdateAudioVolume | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.RACK.AudioVolumeChanged`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.RACK.AudioVolumeChanged", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.RACK.AudioVolumeChanged`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.RACK.AudioVolumeChanged", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.RACK.AudioVolumeChanged", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.RACK.AudioVolumeChanged", |payload| { - if let Some(method) = payload.get("method") { - println!("[RACK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.RACK.AudioVolumeChanged", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[RACK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.RACK.AudioVolumeChanged", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.RACK.AudioVolumeChanged", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[RACK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.RACK.AudioVolumeChanged` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/rack/greg-rack-buttondisablepositionsinrack.md b/docs/02_development/hooks-library/rack/greg-rack-buttondisablepositionsinrack.md deleted file mode 100644 index f336497e..00000000 --- a/docs/02_development/hooks-library/rack/greg-rack-buttondisablepositionsinrack.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.RACK.ButtonDisablePositionsInRack -sidebar_label: greg.RACK.ButtonDisablePositionsInRack -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Rack.ButtonDisablePositionsInRack" ---- - -# `greg.RACK.ButtonDisablePositionsInRack` - -## Description - -- Auto-generated from Il2Cpp unpack: Rack.ButtonDisablePositionsInRack - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Rack::ButtonDisablePositionsInRack()` | Postfix | Auto-generated from Il2Cpp unpack: Rack.ButtonDisablePositionsInRack | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.RACK.ButtonDisablePositionsInRack`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.RACK.ButtonDisablePositionsInRack", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.RACK.ButtonDisablePositionsInRack`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.RACK.ButtonDisablePositionsInRack", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.RACK.ButtonDisablePositionsInRack", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.RACK.ButtonDisablePositionsInRack", |payload| { - if let Some(method) = payload.get("method") { - println!("[RACK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.RACK.ButtonDisablePositionsInRack", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[RACK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.RACK.ButtonDisablePositionsInRack", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.RACK.ButtonDisablePositionsInRack", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[RACK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.RACK.ButtonDisablePositionsInRack` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/rack/greg-rack-componentinitialized.md b/docs/02_development/hooks-library/rack/greg-rack-componentinitialized.md deleted file mode 100644 index d8905843..00000000 --- a/docs/02_development/hooks-library/rack/greg-rack-componentinitialized.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.RACK.ComponentInitialized -sidebar_label: greg.RACK.ComponentInitialized -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Rack.Awake" ---- - -# `greg.RACK.ComponentInitialized` - -## Description - -- Auto-generated from Il2Cpp unpack: Rack.Awake -- Auto-generated from Il2Cpp unpack: Rack.Start - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **2** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Rack::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: Rack.Awake | -| `Il2Cpp.Rack::Start()` | Postfix | Auto-generated from Il2Cpp unpack: Rack.Start | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.RACK.ComponentInitialized`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.RACK.ComponentInitialized", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.RACK.ComponentInitialized`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.RACK.ComponentInitialized", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.RACK.ComponentInitialized", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.RACK.ComponentInitialized", |payload| { - if let Some(method) = payload.get("method") { - println!("[RACK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.RACK.ComponentInitialized", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[RACK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.RACK.ComponentInitialized", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.RACK.ComponentInitialized", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[RACK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.RACK.ComponentInitialized` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/rack/greg-rack-disablepositionsbuttonmaterialset.md b/docs/02_development/hooks-library/rack/greg-rack-disablepositionsbuttonmaterialset.md deleted file mode 100644 index 69c59d42..00000000 --- a/docs/02_development/hooks-library/rack/greg-rack-disablepositionsbuttonmaterialset.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.RACK.DisablePositionsButtonMaterialSet -sidebar_label: greg.RACK.DisablePositionsButtonMaterialSet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Rack.SetDisablePositionsButtonMaterial" ---- - -# `greg.RACK.DisablePositionsButtonMaterialSet` - -## Description - -- Auto-generated from Il2Cpp unpack: Rack.SetDisablePositionsButtonMaterial - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Rack::SetDisablePositionsButtonMaterial(Material)` | Postfix | Auto-generated from Il2Cpp unpack: Rack.SetDisablePositionsButtonMaterial | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.RACK.DisablePositionsButtonMaterialSet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.RACK.DisablePositionsButtonMaterialSet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.RACK.DisablePositionsButtonMaterialSet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.RACK.DisablePositionsButtonMaterialSet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.RACK.DisablePositionsButtonMaterialSet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.RACK.DisablePositionsButtonMaterialSet", |payload| { - if let Some(method) = payload.get("method") { - println!("[RACK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.RACK.DisablePositionsButtonMaterialSet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[RACK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.RACK.DisablePositionsButtonMaterialSet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.RACK.DisablePositionsButtonMaterialSet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[RACK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.RACK.DisablePositionsButtonMaterialSet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/rack/greg-rack-ispositionavailable.md b/docs/02_development/hooks-library/rack/greg-rack-ispositionavailable.md deleted file mode 100644 index b4aa5098..00000000 --- a/docs/02_development/hooks-library/rack/greg-rack-ispositionavailable.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.RACK.IsPositionAvailable -sidebar_label: greg.RACK.IsPositionAvailable -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Rack.IsPositionAvailable" ---- - -# `greg.RACK.IsPositionAvailable` - -## Description - -- Auto-generated from Il2Cpp unpack: Rack.IsPositionAvailable - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Rack::IsPositionAvailable(int, int)` | Postfix | Auto-generated from Il2Cpp unpack: Rack.IsPositionAvailable | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.RACK.IsPositionAvailable`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.RACK.IsPositionAvailable", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.RACK.IsPositionAvailable`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.RACK.IsPositionAvailable", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.RACK.IsPositionAvailable", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.RACK.IsPositionAvailable", |payload| { - if let Some(method) = payload.get("method") { - println!("[RACK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.RACK.IsPositionAvailable", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[RACK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.RACK.IsPositionAvailable", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.RACK.IsPositionAvailable", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[RACK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.RACK.IsPositionAvailable` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/rack/greg-rack-markpositionasunused.md b/docs/02_development/hooks-library/rack/greg-rack-markpositionasunused.md deleted file mode 100644 index ef0aa340..00000000 --- a/docs/02_development/hooks-library/rack/greg-rack-markpositionasunused.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.RACK.MarkPositionAsUnused -sidebar_label: greg.RACK.MarkPositionAsUnused -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Rack.MarkPositionAsUnused" ---- - -# `greg.RACK.MarkPositionAsUnused` - -## Description - -- Auto-generated from Il2Cpp unpack: Rack.MarkPositionAsUnused - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Rack::MarkPositionAsUnused(int, int)` | Postfix | Auto-generated from Il2Cpp unpack: Rack.MarkPositionAsUnused | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.RACK.MarkPositionAsUnused`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.RACK.MarkPositionAsUnused", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.RACK.MarkPositionAsUnused`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.RACK.MarkPositionAsUnused", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.RACK.MarkPositionAsUnused", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.RACK.MarkPositionAsUnused", |payload| { - if let Some(method) = payload.get("method") { - println!("[RACK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.RACK.MarkPositionAsUnused", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[RACK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.RACK.MarkPositionAsUnused", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.RACK.MarkPositionAsUnused", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[RACK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.RACK.MarkPositionAsUnused` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/rack/greg-rack-markpositionasused.md b/docs/02_development/hooks-library/rack/greg-rack-markpositionasused.md deleted file mode 100644 index ff78ea63..00000000 --- a/docs/02_development/hooks-library/rack/greg-rack-markpositionasused.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.RACK.MarkPositionAsUsed -sidebar_label: greg.RACK.MarkPositionAsUsed -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Rack.MarkPositionAsUsed" ---- - -# `greg.RACK.MarkPositionAsUsed` - -## Description - -- Auto-generated from Il2Cpp unpack: Rack.MarkPositionAsUsed - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Rack::MarkPositionAsUsed(int, int)` | Postfix | Auto-generated from Il2Cpp unpack: Rack.MarkPositionAsUsed | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.RACK.MarkPositionAsUsed`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.RACK.MarkPositionAsUsed", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.RACK.MarkPositionAsUsed`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.RACK.MarkPositionAsUsed", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.RACK.MarkPositionAsUsed", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.RACK.MarkPositionAsUsed", |payload| { - if let Some(method) = payload.get("method") { - println!("[RACK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.RACK.MarkPositionAsUsed", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[RACK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.RACK.MarkPositionAsUsed", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.RACK.MarkPositionAsUsed", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[RACK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.RACK.MarkPositionAsUsed` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/rack/greg-rack-ondestroy.md b/docs/02_development/hooks-library/rack/greg-rack-ondestroy.md deleted file mode 100644 index 409121cb..00000000 --- a/docs/02_development/hooks-library/rack/greg-rack-ondestroy.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.RACK.OnDestroy -sidebar_label: greg.RACK.OnDestroy -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Rack.OnDestroy" ---- - -# `greg.RACK.OnDestroy` - -## Description - -- Auto-generated from Il2Cpp unpack: Rack.OnDestroy - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Rack::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: Rack.OnDestroy | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.RACK.OnDestroy`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.RACK.OnDestroy", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.RACK.OnDestroy`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.RACK.OnDestroy", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.RACK.OnDestroy", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.RACK.OnDestroy", |payload| { - if let Some(method) = payload.get("method") { - println!("[RACK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.RACK.OnDestroy", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[RACK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.RACK.OnDestroy", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.RACK.OnDestroy", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[RACK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.RACK.OnDestroy` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/rack/greg-rack-onload.md b/docs/02_development/hooks-library/rack/greg-rack-onload.md deleted file mode 100644 index 0f100158..00000000 --- a/docs/02_development/hooks-library/rack/greg-rack-onload.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.RACK.OnLoad -sidebar_label: greg.RACK.OnLoad -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Rack.OnLoad" ---- - -# `greg.RACK.OnLoad` - -## Description - -- Auto-generated from Il2Cpp unpack: Rack.OnLoad - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Rack::OnLoad()` | Postfix | Auto-generated from Il2Cpp unpack: Rack.OnLoad | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.RACK.OnLoad`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.RACK.OnLoad", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.RACK.OnLoad`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.RACK.OnLoad", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.RACK.OnLoad", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.RACK.OnLoad", |payload| { - if let Some(method) = payload.get("method") { - println!("[RACK] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.RACK.OnLoad", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[RACK] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.RACK.OnLoad", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.RACK.OnLoad", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[RACK] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.RACK.OnLoad` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/_category_.json b/docs/02_development/hooks-library/server/_category_.json deleted file mode 100644 index 835c8269..00000000 --- a/docs/02_development/hooks-library/server/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "SERVER hooks", - "position": 1, - "collapsible": true, - "collapsed": true -} - diff --git a/docs/02_development/hooks-library/server/greg-server-buttonclickchangecustomer.md b/docs/02_development/hooks-library/server/greg-server-buttonclickchangecustomer.md deleted file mode 100644 index 4052d3bc..00000000 --- a/docs/02_development/hooks-library/server/greg-server-buttonclickchangecustomer.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.ButtonClickChangeCustomer -sidebar_label: greg.SERVER.ButtonClickChangeCustomer -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.ButtonClickChangeCustomer" ---- - -# `greg.SERVER.ButtonClickChangeCustomer` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.ButtonClickChangeCustomer - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::ButtonClickChangeCustomer(bool)` | Postfix | Auto-generated from Il2Cpp unpack: Server.ButtonClickChangeCustomer | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.ButtonClickChangeCustomer`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.ButtonClickChangeCustomer", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.ButtonClickChangeCustomer`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.ButtonClickChangeCustomer", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.ButtonClickChangeCustomer", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.ButtonClickChangeCustomer", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.ButtonClickChangeCustomer", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.ButtonClickChangeCustomer", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.ButtonClickChangeCustomer", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.ButtonClickChangeCustomer` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-buttonclickchangeip.md b/docs/02_development/hooks-library/server/greg-server-buttonclickchangeip.md deleted file mode 100644 index 534c0514..00000000 --- a/docs/02_development/hooks-library/server/greg-server-buttonclickchangeip.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.ButtonClickChangeIP -sidebar_label: greg.SERVER.ButtonClickChangeIP -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.ButtonClickChangeIP" ---- - -# `greg.SERVER.ButtonClickChangeIP` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.ButtonClickChangeIP - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::ButtonClickChangeIP()` | Postfix | Auto-generated from Il2Cpp unpack: Server.ButtonClickChangeIP | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.ButtonClickChangeIP`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.ButtonClickChangeIP", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.ButtonClickChangeIP`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.ButtonClickChangeIP", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.ButtonClickChangeIP", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.ButtonClickChangeIP", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.ButtonClickChangeIP", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.ButtonClickChangeIP", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.ButtonClickChangeIP", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.ButtonClickChangeIP` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-clearerrorsign.md b/docs/02_development/hooks-library/server/greg-server-clearerrorsign.md deleted file mode 100644 index f99adfb0..00000000 --- a/docs/02_development/hooks-library/server/greg-server-clearerrorsign.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.ClearErrorSign -sidebar_label: greg.SERVER.ClearErrorSign -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.ClearErrorSign" ---- - -# `greg.SERVER.ClearErrorSign` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.ClearErrorSign - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::ClearErrorSign()` | Postfix | Auto-generated from Il2Cpp unpack: Server.ClearErrorSign | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.ClearErrorSign`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.ClearErrorSign", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.ClearErrorSign`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.ClearErrorSign", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.ClearErrorSign", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.ClearErrorSign", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.ClearErrorSign", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.ClearErrorSign", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.ClearErrorSign", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.ClearErrorSign` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-clearwarningsign.md b/docs/02_development/hooks-library/server/greg-server-clearwarningsign.md deleted file mode 100644 index 540e7187..00000000 --- a/docs/02_development/hooks-library/server/greg-server-clearwarningsign.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.ClearWarningSign -sidebar_label: greg.SERVER.ClearWarningSign -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.ClearWarningSign" ---- - -# `greg.SERVER.ClearWarningSign` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.ClearWarningSign - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::ClearWarningSign(bool)` | Postfix | Auto-generated from Il2Cpp unpack: Server.ClearWarningSign | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.ClearWarningSign`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.ClearWarningSign", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.ClearWarningSign`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.ClearWarningSign", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.ClearWarningSign", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.ClearWarningSign", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.ClearWarningSign", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.ClearWarningSign", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.ClearWarningSign", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.ClearWarningSign` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-componentinitialized.md b/docs/02_development/hooks-library/server/greg-server-componentinitialized.md deleted file mode 100644 index 2dc2c0ea..00000000 --- a/docs/02_development/hooks-library/server/greg-server-componentinitialized.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.SERVER.ComponentInitialized -sidebar_label: greg.SERVER.ComponentInitialized -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.Awake" ---- - -# `greg.SERVER.ComponentInitialized` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.Awake -- Auto-generated from Il2Cpp unpack: Server.Start - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **2** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: Server.Awake | -| `Il2Cpp.Server::Start()` | Postfix | Auto-generated from Il2Cpp unpack: Server.Start | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.ComponentInitialized`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.ComponentInitialized", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.ComponentInitialized`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.ComponentInitialized", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.ComponentInitialized", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.ComponentInitialized", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.ComponentInitialized", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.ComponentInitialized", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.ComponentInitialized", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.ComponentInitialized` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-getcustomerid.md b/docs/02_development/hooks-library/server/greg-server-getcustomerid.md deleted file mode 100644 index 2d70f325..00000000 --- a/docs/02_development/hooks-library/server/greg-server-getcustomerid.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.GetCustomerID -sidebar_label: greg.SERVER.GetCustomerID -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.GetCustomerID" ---- - -# `greg.SERVER.GetCustomerID` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.GetCustomerID - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::GetCustomerID()` | Postfix | Auto-generated from Il2Cpp unpack: Server.GetCustomerID | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.GetCustomerID`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.GetCustomerID", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.GetCustomerID`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.GetCustomerID", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.GetCustomerID", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.GetCustomerID", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.GetCustomerID", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.GetCustomerID", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.GetCustomerID", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.GetCustomerID` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-getnextcustomerid.md b/docs/02_development/hooks-library/server/greg-server-getnextcustomerid.md deleted file mode 100644 index 46a8a646..00000000 --- a/docs/02_development/hooks-library/server/greg-server-getnextcustomerid.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.GetNextCustomerID -sidebar_label: greg.SERVER.GetNextCustomerID -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.GetNextCustomerID" ---- - -# `greg.SERVER.GetNextCustomerID` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.GetNextCustomerID - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::GetNextCustomerID(int, bool)` | Postfix | Auto-generated from Il2Cpp unpack: Server.GetNextCustomerID | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.GetNextCustomerID`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.GetNextCustomerID", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.GetNextCustomerID`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.GetNextCustomerID", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.GetNextCustomerID", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.GetNextCustomerID", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.GetNextCustomerID", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.GetNextCustomerID", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.GetNextCustomerID", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.GetNextCustomerID` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-interactonclick.md b/docs/02_development/hooks-library/server/greg-server-interactonclick.md deleted file mode 100644 index 12095bd9..00000000 --- a/docs/02_development/hooks-library/server/greg-server-interactonclick.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.InteractOnClick -sidebar_label: greg.SERVER.InteractOnClick -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.InteractOnClick" ---- - -# `greg.SERVER.InteractOnClick` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.InteractOnClick - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::InteractOnClick()` | Postfix | Auto-generated from Il2Cpp unpack: Server.InteractOnClick | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.InteractOnClick`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.InteractOnClick", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.InteractOnClick`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.InteractOnClick", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.InteractOnClick", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.InteractOnClick", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.InteractOnClick", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.InteractOnClick", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.InteractOnClick", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.InteractOnClick` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-ipset.md b/docs/02_development/hooks-library/server/greg-server-ipset.md deleted file mode 100644 index 0a8c66f4..00000000 --- a/docs/02_development/hooks-library/server/greg-server-ipset.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.IPSet -sidebar_label: greg.SERVER.IPSet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.SetIP" ---- - -# `greg.SERVER.IPSet` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.SetIP - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::SetIP(string)` | Postfix | Auto-generated from Il2Cpp unpack: Server.SetIP | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.IPSet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.IPSet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.IPSet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.IPSet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.IPSet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.IPSet", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.IPSet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.IPSet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.IPSet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.IPSet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-isanycableconnected.md b/docs/02_development/hooks-library/server/greg-server-isanycableconnected.md deleted file mode 100644 index 810f5027..00000000 --- a/docs/02_development/hooks-library/server/greg-server-isanycableconnected.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.IsAnyCableConnected -sidebar_label: greg.SERVER.IsAnyCableConnected -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.IsAnyCableConnected" ---- - -# `greg.SERVER.IsAnyCableConnected` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.IsAnyCableConnected - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::IsAnyCableConnected()` | Postfix | Auto-generated from Il2Cpp unpack: Server.IsAnyCableConnected | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.IsAnyCableConnected`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.IsAnyCableConnected", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.IsAnyCableConnected`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.IsAnyCableConnected", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.IsAnyCableConnected", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.IsAnyCableConnected", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.IsAnyCableConnected", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.IsAnyCableConnected", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.IsAnyCableConnected", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.IsAnyCableConnected` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-ondestroy.md b/docs/02_development/hooks-library/server/greg-server-ondestroy.md deleted file mode 100644 index a68f2595..00000000 --- a/docs/02_development/hooks-library/server/greg-server-ondestroy.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.OnDestroy -sidebar_label: greg.SERVER.OnDestroy -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.OnDestroy" ---- - -# `greg.SERVER.OnDestroy` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.OnDestroy - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: Server.OnDestroy | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.OnDestroy`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.OnDestroy", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.OnDestroy`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.OnDestroy", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.OnDestroy", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.OnDestroy", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.OnDestroy", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.OnDestroy", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.OnDestroy", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.OnDestroy` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-onloadingcomplete.md b/docs/02_development/hooks-library/server/greg-server-onloadingcomplete.md deleted file mode 100644 index 2f90d01f..00000000 --- a/docs/02_development/hooks-library/server/greg-server-onloadingcomplete.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.OnLoadingComplete -sidebar_label: greg.SERVER.OnLoadingComplete -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.OnLoadingComplete" ---- - -# `greg.SERVER.OnLoadingComplete` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.OnLoadingComplete - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::OnLoadingComplete()` | Postfix | Auto-generated from Il2Cpp unpack: Server.OnLoadingComplete | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.OnLoadingComplete`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.OnLoadingComplete", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.OnLoadingComplete`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.OnLoadingComplete", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.OnLoadingComplete", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.OnLoadingComplete", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.OnLoadingComplete", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.OnLoadingComplete", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.OnLoadingComplete", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.OnLoadingComplete` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-onloadingstarted.md b/docs/02_development/hooks-library/server/greg-server-onloadingstarted.md deleted file mode 100644 index 280dbae4..00000000 --- a/docs/02_development/hooks-library/server/greg-server-onloadingstarted.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.OnLoadingStarted -sidebar_label: greg.SERVER.OnLoadingStarted -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.OnLoadingStarted" ---- - -# `greg.SERVER.OnLoadingStarted` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.OnLoadingStarted - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::OnLoadingStarted()` | Postfix | Auto-generated from Il2Cpp unpack: Server.OnLoadingStarted | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.OnLoadingStarted`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.OnLoadingStarted", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.OnLoadingStarted`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.OnLoadingStarted", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.OnLoadingStarted", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.OnLoadingStarted", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.OnLoadingStarted", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.OnLoadingStarted", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.OnLoadingStarted", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.OnLoadingStarted` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-powerlightmaterialset.md b/docs/02_development/hooks-library/server/greg-server-powerlightmaterialset.md deleted file mode 100644 index 4e91ae59..00000000 --- a/docs/02_development/hooks-library/server/greg-server-powerlightmaterialset.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.PowerLightMaterialSet -sidebar_label: greg.SERVER.PowerLightMaterialSet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.SetPowerLightMaterial" ---- - -# `greg.SERVER.PowerLightMaterialSet` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.SetPowerLightMaterial - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::SetPowerLightMaterial(Material)` | Postfix | Auto-generated from Il2Cpp unpack: Server.SetPowerLightMaterial | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.PowerLightMaterialSet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.PowerLightMaterialSet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.PowerLightMaterialSet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.PowerLightMaterialSet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.PowerLightMaterialSet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.PowerLightMaterialSet", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.PowerLightMaterialSet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.PowerLightMaterialSet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.PowerLightMaterialSet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.PowerLightMaterialSet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-serverscreenuichanged.md b/docs/02_development/hooks-library/server/greg-server-serverscreenuichanged.md deleted file mode 100644 index 2e7b8aef..00000000 --- a/docs/02_development/hooks-library/server/greg-server-serverscreenuichanged.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.ServerScreenUIChanged -sidebar_label: greg.SERVER.ServerScreenUIChanged -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.UpdateServerScreenUI" ---- - -# `greg.SERVER.ServerScreenUIChanged` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.UpdateServerScreenUI - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::UpdateServerScreenUI()` | Postfix | Auto-generated from Il2Cpp unpack: Server.UpdateServerScreenUI | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.ServerScreenUIChanged`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.ServerScreenUIChanged", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.ServerScreenUIChanged`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.ServerScreenUIChanged", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.ServerScreenUIChanged", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.ServerScreenUIChanged", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.ServerScreenUIChanged", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.ServerScreenUIChanged", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.ServerScreenUIChanged", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.ServerScreenUIChanged` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-turnoffcommonfunctions.md b/docs/02_development/hooks-library/server/greg-server-turnoffcommonfunctions.md deleted file mode 100644 index c71984aa..00000000 --- a/docs/02_development/hooks-library/server/greg-server-turnoffcommonfunctions.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.TurnOffCommonFunctions -sidebar_label: greg.SERVER.TurnOffCommonFunctions -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.TurnOffCommonFunctions" ---- - -# `greg.SERVER.TurnOffCommonFunctions` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.TurnOffCommonFunctions - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::TurnOffCommonFunctions()` | Postfix | Auto-generated from Il2Cpp unpack: Server.TurnOffCommonFunctions | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.TurnOffCommonFunctions`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.TurnOffCommonFunctions", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.TurnOffCommonFunctions`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.TurnOffCommonFunctions", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.TurnOffCommonFunctions", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.TurnOffCommonFunctions", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.TurnOffCommonFunctions", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.TurnOffCommonFunctions", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.TurnOffCommonFunctions", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.TurnOffCommonFunctions` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-turnoncommonfunction.md b/docs/02_development/hooks-library/server/greg-server-turnoncommonfunction.md deleted file mode 100644 index 00bed559..00000000 --- a/docs/02_development/hooks-library/server/greg-server-turnoncommonfunction.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.TurnOnCommonFunction -sidebar_label: greg.SERVER.TurnOnCommonFunction -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.TurnOnCommonFunction" ---- - -# `greg.SERVER.TurnOnCommonFunction` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.TurnOnCommonFunction - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::TurnOnCommonFunction()` | Postfix | Auto-generated from Il2Cpp unpack: Server.TurnOnCommonFunction | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.TurnOnCommonFunction`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.TurnOnCommonFunction", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.TurnOnCommonFunction`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.TurnOnCommonFunction", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.TurnOnCommonFunction", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.TurnOnCommonFunction", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.TurnOnCommonFunction", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.TurnOnCommonFunction", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.TurnOnCommonFunction", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.TurnOnCommonFunction` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/server/greg-server-validaterackposition.md b/docs/02_development/hooks-library/server/greg-server-validaterackposition.md deleted file mode 100644 index 62a27e01..00000000 --- a/docs/02_development/hooks-library/server/greg-server-validaterackposition.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SERVER.ValidateRackPosition -sidebar_label: greg.SERVER.ValidateRackPosition -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: Server.ValidateRackPosition" ---- - -# `greg.SERVER.ValidateRackPosition` - -## Description - -- Auto-generated from Il2Cpp unpack: Server.ValidateRackPosition - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.Server::ValidateRackPosition()` | Postfix | Auto-generated from Il2Cpp unpack: Server.ValidateRackPosition | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SERVER.ValidateRackPosition`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SERVER.ValidateRackPosition", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SERVER.ValidateRackPosition`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SERVER.ValidateRackPosition", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SERVER.ValidateRackPosition", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SERVER.ValidateRackPosition", |payload| { - if let Some(method) = payload.get("method") { - println!("[SERVER] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SERVER.ValidateRackPosition", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SERVER] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SERVER.ValidateRackPosition", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SERVER.ValidateRackPosition", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SERVER] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SERVER.ValidateRackPosition` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/_category_.json b/docs/02_development/hooks-library/system/_category_.json deleted file mode 100644 index 08402939..00000000 --- a/docs/02_development/hooks-library/system/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "SYSTEM hooks", - "position": 1, - "collapsible": true, - "collapsed": true -} - diff --git a/docs/02_development/hooks-library/system/greg-system-anotheritempurchased.md b/docs/02_development/hooks-library/system/greg-system-anotheritempurchased.md deleted file mode 100644 index 3baa8528..00000000 --- a/docs/02_development/hooks-library/system/greg-system-anotheritempurchased.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.AnotherItemPurchased -sidebar_label: greg.SYSTEM.AnotherItemPurchased -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.BuyAnotherItem" ---- - -# `greg.SYSTEM.AnotherItemPurchased` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.BuyAnotherItem - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::BuyAnotherItem(int, int, PlayerManager.ObjectInHand, ShopCartItem)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.BuyAnotherItem | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.AnotherItemPurchased`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.AnotherItemPurchased", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.AnotherItemPurchased`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.AnotherItemPurchased", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.AnotherItemPurchased", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.AnotherItemPurchased", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.AnotherItemPurchased", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.AnotherItemPurchased", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.AnotherItemPurchased", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.AnotherItemPurchased` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-applycolortospawneditem.md b/docs/02_development/hooks-library/system/greg-system-applycolortospawneditem.md deleted file mode 100644 index d2c716b7..00000000 --- a/docs/02_development/hooks-library/system/greg-system-applycolortospawneditem.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ApplyColorToSpawnedItem -sidebar_label: greg.SYSTEM.ApplyColorToSpawnedItem -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ApplyColorToSpawnedItem" ---- - -# `greg.SYSTEM.ApplyColorToSpawnedItem` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ApplyColorToSpawnedItem - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ApplyColorToSpawnedItem(int, Color, PlayerManager.ObjectInHand)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ApplyColorToSpawnedItem | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ApplyColorToSpawnedItem`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ApplyColorToSpawnedItem", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ApplyColorToSpawnedItem`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ApplyColorToSpawnedItem", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ApplyColorToSpawnedItem", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ApplyColorToSpawnedItem", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ApplyColorToSpawnedItem", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ApplyColorToSpawnedItem", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ApplyColorToSpawnedItem", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ApplyColorToSpawnedItem` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-autosaveenabledset.md b/docs/02_development/hooks-library/system/greg-system-autosaveenabledset.md deleted file mode 100644 index 986e40ed..00000000 --- a/docs/02_development/hooks-library/system/greg-system-autosaveenabledset.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.AutoSaveEnabledSet -sidebar_label: greg.SYSTEM.AutoSaveEnabledSet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.SetAutoSaveEnabled" ---- - -# `greg.SYSTEM.AutoSaveEnabledSet` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.SetAutoSaveEnabled - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::SetAutoSaveEnabled(bool)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.SetAutoSaveEnabled | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.AutoSaveEnabledSet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.AutoSaveEnabledSet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.AutoSaveEnabledSet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.AutoSaveEnabledSet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.AutoSaveEnabledSet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.AutoSaveEnabledSet", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.AutoSaveEnabledSet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.AutoSaveEnabledSet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.AutoSaveEnabledSet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.AutoSaveEnabledSet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-autosaveintervalset.md b/docs/02_development/hooks-library/system/greg-system-autosaveintervalset.md deleted file mode 100644 index fcef0299..00000000 --- a/docs/02_development/hooks-library/system/greg-system-autosaveintervalset.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.AutoSaveIntervalSet -sidebar_label: greg.SYSTEM.AutoSaveIntervalSet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.SetAutoSaveInterval" ---- - -# `greg.SYSTEM.AutoSaveIntervalSet` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.SetAutoSaveInterval - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::SetAutoSaveInterval(float)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.SetAutoSaveInterval | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.AutoSaveIntervalSet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.AutoSaveIntervalSet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.AutoSaveIntervalSet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.AutoSaveIntervalSet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.AutoSaveIntervalSet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.AutoSaveIntervalSet", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.AutoSaveIntervalSet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.AutoSaveIntervalSet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.AutoSaveIntervalSet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.AutoSaveIntervalSet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttonassetmanagementscreen.md b/docs/02_development/hooks-library/system/greg-system-buttonassetmanagementscreen.md deleted file mode 100644 index 85d2b3ab..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttonassetmanagementscreen.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonAssetManagementScreen -sidebar_label: greg.SYSTEM.ButtonAssetManagementScreen -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ButtonAssetManagementScreen" ---- - -# `greg.SYSTEM.ButtonAssetManagementScreen` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ButtonAssetManagementScreen - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ButtonAssetManagementScreen()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ButtonAssetManagementScreen | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonAssetManagementScreen`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonAssetManagementScreen", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonAssetManagementScreen`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonAssetManagementScreen", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonAssetManagementScreen", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonAssetManagementScreen", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonAssetManagementScreen", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonAssetManagementScreen", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonAssetManagementScreen", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonAssetManagementScreen` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttonbalancesheetscreen.md b/docs/02_development/hooks-library/system/greg-system-buttonbalancesheetscreen.md deleted file mode 100644 index d5728bb7..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttonbalancesheetscreen.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonBalanceSheetScreen -sidebar_label: greg.SYSTEM.ButtonBalanceSheetScreen -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ButtonBalanceSheetScreen" ---- - -# `greg.SYSTEM.ButtonBalanceSheetScreen` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ButtonBalanceSheetScreen - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ButtonBalanceSheetScreen()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ButtonBalanceSheetScreen | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonBalanceSheetScreen`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonBalanceSheetScreen", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonBalanceSheetScreen`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonBalanceSheetScreen", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonBalanceSheetScreen", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonBalanceSheetScreen", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonBalanceSheetScreen", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonBalanceSheetScreen", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonBalanceSheetScreen", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonBalanceSheetScreen` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttoncancel.md b/docs/02_development/hooks-library/system/greg-system-buttoncancel.md deleted file mode 100644 index 03fa44e2..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttoncancel.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonCancel -sidebar_label: greg.SYSTEM.ButtonCancel -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ButtonCancel" ---- - -# `greg.SYSTEM.ButtonCancel` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ButtonCancel - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ButtonCancel()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ButtonCancel | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonCancel`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonCancel", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonCancel`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonCancel", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonCancel", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonCancel", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonCancel", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonCancel", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonCancel", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonCancel` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttoncancelbuywall.md b/docs/02_development/hooks-library/system/greg-system-buttoncancelbuywall.md deleted file mode 100644 index 6ede0dd5..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttoncancelbuywall.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonCancelBuyWall -sidebar_label: greg.SYSTEM.ButtonCancelBuyWall -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ButtonCancelBuyWall" ---- - -# `greg.SYSTEM.ButtonCancelBuyWall` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ButtonCancelBuyWall - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ButtonCancelBuyWall()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ButtonCancelBuyWall | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonCancelBuyWall`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonCancelBuyWall", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonCancelBuyWall`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonCancelBuyWall", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonCancelBuyWall", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonCancelBuyWall", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonCancelBuyWall", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonCancelBuyWall", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonCancelBuyWall", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonCancelBuyWall` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttoncancelcolorpicker.md b/docs/02_development/hooks-library/system/greg-system-buttoncancelcolorpicker.md deleted file mode 100644 index c45c4ac0..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttoncancelcolorpicker.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonCancelColorPicker -sidebar_label: greg.SYSTEM.ButtonCancelColorPicker -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ButtonCancelColorPicker" ---- - -# `greg.SYSTEM.ButtonCancelColorPicker` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ButtonCancelColorPicker - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ButtonCancelColorPicker()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ButtonCancelColorPicker | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonCancelColorPicker`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonCancelColorPicker", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonCancelColorPicker`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonCancelColorPicker", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonCancelColorPicker", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonCancelColorPicker", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonCancelColorPicker", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonCancelColorPicker", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonCancelColorPicker", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonCancelColorPicker` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttoncancelcustomerchoice.md b/docs/02_development/hooks-library/system/greg-system-buttoncancelcustomerchoice.md deleted file mode 100644 index 1deff670..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttoncancelcustomerchoice.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonCancelCustomerChoice -sidebar_label: greg.SYSTEM.ButtonCancelCustomerChoice -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ButtonCancelCustomerChoice" ---- - -# `greg.SYSTEM.ButtonCancelCustomerChoice` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ButtonCancelCustomerChoice - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ButtonCancelCustomerChoice()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ButtonCancelCustomerChoice | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonCancelCustomerChoice`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonCancelCustomerChoice", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonCancelCustomerChoice`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonCancelCustomerChoice", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonCancelCustomerChoice", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonCancelCustomerChoice", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonCancelCustomerChoice", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonCancelCustomerChoice", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonCancelCustomerChoice", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonCancelCustomerChoice` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttonchosencolor.md b/docs/02_development/hooks-library/system/greg-system-buttonchosencolor.md deleted file mode 100644 index 383224b9..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttonchosencolor.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonChosenColor -sidebar_label: greg.SYSTEM.ButtonChosenColor -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ButtonChosenColor" ---- - -# `greg.SYSTEM.ButtonChosenColor` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ButtonChosenColor - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ButtonChosenColor()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ButtonChosenColor | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonChosenColor`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonChosenColor", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonChosenColor`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonChosenColor", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonChosenColor", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonChosenColor", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonChosenColor", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonChosenColor", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonChosenColor", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonChosenColor` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttonhirescreen.md b/docs/02_development/hooks-library/system/greg-system-buttonhirescreen.md deleted file mode 100644 index 621c89b4..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttonhirescreen.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonHireScreen -sidebar_label: greg.SYSTEM.ButtonHireScreen -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ButtonHireScreen" ---- - -# `greg.SYSTEM.ButtonHireScreen` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ButtonHireScreen - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ButtonHireScreen()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ButtonHireScreen | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonHireScreen`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonHireScreen", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonHireScreen`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonHireScreen", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonHireScreen", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonHireScreen", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonHireScreen", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonHireScreen", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonHireScreen", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonHireScreen` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttonnetworkmap.md b/docs/02_development/hooks-library/system/greg-system-buttonnetworkmap.md deleted file mode 100644 index c1a331f3..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttonnetworkmap.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonNetworkMap -sidebar_label: greg.SYSTEM.ButtonNetworkMap -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ButtonNetworkMap" ---- - -# `greg.SYSTEM.ButtonNetworkMap` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ButtonNetworkMap - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ButtonNetworkMap()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ButtonNetworkMap | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonNetworkMap`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonNetworkMap", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonNetworkMap`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonNetworkMap", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonNetworkMap", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonNetworkMap", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonNetworkMap", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonNetworkMap", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonNetworkMap", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonNetworkMap` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttonreturnmainscreen.md b/docs/02_development/hooks-library/system/greg-system-buttonreturnmainscreen.md deleted file mode 100644 index 5c7f2dc9..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttonreturnmainscreen.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonReturnMainScreen -sidebar_label: greg.SYSTEM.ButtonReturnMainScreen -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ButtonReturnMainScreen" ---- - -# `greg.SYSTEM.ButtonReturnMainScreen` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ButtonReturnMainScreen - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ButtonReturnMainScreen()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ButtonReturnMainScreen | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonReturnMainScreen`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonReturnMainScreen", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonReturnMainScreen`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonReturnMainScreen", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonReturnMainScreen", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonReturnMainScreen", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonReturnMainScreen", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonReturnMainScreen", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonReturnMainScreen", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonReturnMainScreen` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-buttonshopscreen.md b/docs/02_development/hooks-library/system/greg-system-buttonshopscreen.md deleted file mode 100644 index b6847ac1..00000000 --- a/docs/02_development/hooks-library/system/greg-system-buttonshopscreen.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ButtonShopScreen -sidebar_label: greg.SYSTEM.ButtonShopScreen -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ButtonShopScreen" ---- - -# `greg.SYSTEM.ButtonShopScreen` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ButtonShopScreen - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ButtonShopScreen()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ButtonShopScreen | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ButtonShopScreen`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ButtonShopScreen", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ButtonShopScreen`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ButtonShopScreen", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ButtonShopScreen", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ButtonShopScreen", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ButtonShopScreen", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ButtonShopScreen", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ButtonShopScreen", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ButtonShopScreen` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-carttotalchanged.md b/docs/02_development/hooks-library/system/greg-system-carttotalchanged.md deleted file mode 100644 index 1ff9af7d..00000000 --- a/docs/02_development/hooks-library/system/greg-system-carttotalchanged.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.CartTotalChanged -sidebar_label: greg.SYSTEM.CartTotalChanged -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.UpdateCartTotal" ---- - -# `greg.SYSTEM.CartTotalChanged` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.UpdateCartTotal - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::UpdateCartTotal()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.UpdateCartTotal | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.CartTotalChanged`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.CartTotalChanged", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.CartTotalChanged`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.CartTotalChanged", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.CartTotalChanged", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.CartTotalChanged", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.CartTotalChanged", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.CartTotalChanged", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.CartTotalChanged", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.CartTotalChanged` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-cartuiitemremoved.md b/docs/02_development/hooks-library/system/greg-system-cartuiitemremoved.md deleted file mode 100644 index 210b474c..00000000 --- a/docs/02_development/hooks-library/system/greg-system-cartuiitemremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.CartUIItemRemoved -sidebar_label: greg.SYSTEM.CartUIItemRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.RemoveCartUIItem" ---- - -# `greg.SYSTEM.CartUIItemRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.RemoveCartUIItem - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::RemoveCartUIItem(ShopCartItem)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.RemoveCartUIItem | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.CartUIItemRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.CartUIItemRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.CartUIItemRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.CartUIItemRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.CartUIItemRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.CartUIItemRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.CartUIItemRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.CartUIItemRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.CartUIItemRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.CartUIItemRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-cleanupshop.md b/docs/02_development/hooks-library/system/greg-system-cleanupshop.md deleted file mode 100644 index 3b7e99ff..00000000 --- a/docs/02_development/hooks-library/system/greg-system-cleanupshop.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.CleanUpShop -sidebar_label: greg.SYSTEM.CleanUpShop -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.CleanUpShop" ---- - -# `greg.SYSTEM.CleanUpShop` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.CleanUpShop - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::CleanUpShop()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.CleanUpShop | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.CleanUpShop`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.CleanUpShop", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.CleanUpShop`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.CleanUpShop", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.CleanUpShop", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.CleanUpShop", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.CleanUpShop", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.CleanUpShop", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.CleanUpShop", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.CleanUpShop` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-cleartrackingwithoutdestroying.md b/docs/02_development/hooks-library/system/greg-system-cleartrackingwithoutdestroying.md deleted file mode 100644 index 62354ab8..00000000 --- a/docs/02_development/hooks-library/system/greg-system-cleartrackingwithoutdestroying.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ClearTrackingWithoutDestroying -sidebar_label: greg.SYSTEM.ClearTrackingWithoutDestroying -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.ClearTrackingWithoutDestroying" ---- - -# `greg.SYSTEM.ClearTrackingWithoutDestroying` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.ClearTrackingWithoutDestroying - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::ClearTrackingWithoutDestroying()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.ClearTrackingWithoutDestroying | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ClearTrackingWithoutDestroying`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ClearTrackingWithoutDestroying", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ClearTrackingWithoutDestroying`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ClearTrackingWithoutDestroying", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ClearTrackingWithoutDestroying", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ClearTrackingWithoutDestroying", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ClearTrackingWithoutDestroying", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ClearTrackingWithoutDestroying", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ClearTrackingWithoutDestroying", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ClearTrackingWithoutDestroying` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-closeanycanvas.md b/docs/02_development/hooks-library/system/greg-system-closeanycanvas.md deleted file mode 100644 index bfa5a10d..00000000 --- a/docs/02_development/hooks-library/system/greg-system-closeanycanvas.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.CloseAnyCanvas -sidebar_label: greg.SYSTEM.CloseAnyCanvas -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.CloseAnyCanvas" ---- - -# `greg.SYSTEM.CloseAnyCanvas` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.CloseAnyCanvas - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::CloseAnyCanvas(bool)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.CloseAnyCanvas | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.CloseAnyCanvas`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.CloseAnyCanvas", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.CloseAnyCanvas`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.CloseAnyCanvas", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.CloseAnyCanvas", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.CloseAnyCanvas", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.CloseAnyCanvas", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.CloseAnyCanvas", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.CloseAnyCanvas", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.CloseAnyCanvas` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-closenetworkconfigcanvas.md b/docs/02_development/hooks-library/system/greg-system-closenetworkconfigcanvas.md deleted file mode 100644 index 1818e676..00000000 --- a/docs/02_development/hooks-library/system/greg-system-closenetworkconfigcanvas.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.CloseNetworkConfigCanvas -sidebar_label: greg.SYSTEM.CloseNetworkConfigCanvas -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.CloseNetworkConfigCanvas" ---- - -# `greg.SYSTEM.CloseNetworkConfigCanvas` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.CloseNetworkConfigCanvas - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::CloseNetworkConfigCanvas()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.CloseNetworkConfigCanvas | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.CloseNetworkConfigCanvas`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.CloseNetworkConfigCanvas", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.CloseNetworkConfigCanvas`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.CloseNetworkConfigCanvas", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.CloseNetworkConfigCanvas", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.CloseNetworkConfigCanvas", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.CloseNetworkConfigCanvas", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.CloseNetworkConfigCanvas", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.CloseNetworkConfigCanvas", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.CloseNetworkConfigCanvas` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-closeshop.md b/docs/02_development/hooks-library/system/greg-system-closeshop.md deleted file mode 100644 index ec689158..00000000 --- a/docs/02_development/hooks-library/system/greg-system-closeshop.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.CloseShop -sidebar_label: greg.SYSTEM.CloseShop -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.CloseShop" ---- - -# `greg.SYSTEM.CloseShop` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.CloseShop - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::CloseShop()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.CloseShop | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.CloseShop`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.CloseShop", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.CloseShop`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.CloseShop", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.CloseShop", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.CloseShop", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.CloseShop", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.CloseShop", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.CloseShop", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.CloseShop` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-componentdisabled.md b/docs/02_development/hooks-library/system/greg-system-componentdisabled.md deleted file mode 100644 index 1050427e..00000000 --- a/docs/02_development/hooks-library/system/greg-system-componentdisabled.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ComponentDisabled -sidebar_label: greg.SYSTEM.ComponentDisabled -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TimeController.OnDisable" ---- - -# `greg.SYSTEM.ComponentDisabled` - -## Description - -- Auto-generated from Il2Cpp unpack: TimeController.OnDisable - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TimeController::OnDisable()` | Postfix | Auto-generated from Il2Cpp unpack: TimeController.OnDisable | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ComponentDisabled`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ComponentDisabled", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ComponentDisabled`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ComponentDisabled", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ComponentDisabled", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ComponentDisabled", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ComponentDisabled", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ComponentDisabled", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ComponentDisabled", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ComponentDisabled` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-componentinitialized.md b/docs/02_development/hooks-library/system/greg-system-componentinitialized.md deleted file mode 100644 index 0279c42e..00000000 --- a/docs/02_development/hooks-library/system/greg-system-componentinitialized.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -title: greg.SYSTEM.ComponentInitialized -sidebar_label: greg.SYSTEM.ComponentInitialized -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.Awake" ---- - -# `greg.SYSTEM.ComponentInitialized` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.Awake -- Auto-generated from Il2Cpp unpack: MainGameManager.Awake -- Auto-generated from Il2Cpp unpack: MainGameManager.Start -- Auto-generated from Il2Cpp unpack: PatchPanel.Awake -- Auto-generated from Il2Cpp unpack: TimeController.Awake -- Auto-generated from Il2Cpp unpack: TimeController.Start - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **6** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.Awake | -| `Il2Cpp.MainGameManager::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.Awake | -| `Il2Cpp.MainGameManager::Start()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.Start | -| `Il2Cpp.PatchPanel::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: PatchPanel.Awake | -| `Il2Cpp.TimeController::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: TimeController.Awake | -| `Il2Cpp.TimeController::Start()` | Postfix | Auto-generated from Il2Cpp unpack: TimeController.Start | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ComponentInitialized`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ComponentInitialized", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ComponentInitialized`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ComponentInitialized", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ComponentInitialized", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ComponentInitialized", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ComponentInitialized", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ComponentInitialized", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ComponentInitialized", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ComponentInitialized` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-currenttimeinhours.md b/docs/02_development/hooks-library/system/greg-system-currenttimeinhours.md deleted file mode 100644 index ad15d837..00000000 --- a/docs/02_development/hooks-library/system/greg-system-currenttimeinhours.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.CurrentTimeInHours -sidebar_label: greg.SYSTEM.CurrentTimeInHours -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TimeController.CurrentTimeInHours" ---- - -# `greg.SYSTEM.CurrentTimeInHours` - -## Description - -- Auto-generated from Il2Cpp unpack: TimeController.CurrentTimeInHours - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TimeController::CurrentTimeInHours()` | Postfix | Auto-generated from Il2Cpp unpack: TimeController.CurrentTimeInHours | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.CurrentTimeInHours`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.CurrentTimeInHours", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.CurrentTimeInHours`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.CurrentTimeInHours", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.CurrentTimeInHours", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.CurrentTimeInHours", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.CurrentTimeInHours", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.CurrentTimeInHours", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.CurrentTimeInHours", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.CurrentTimeInHours` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-destroyallspawneditems.md b/docs/02_development/hooks-library/system/greg-system-destroyallspawneditems.md deleted file mode 100644 index 5d6653cb..00000000 --- a/docs/02_development/hooks-library/system/greg-system-destroyallspawneditems.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.DestroyAllSpawnedItems -sidebar_label: greg.SYSTEM.DestroyAllSpawnedItems -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.DestroyAllSpawnedItems" ---- - -# `greg.SYSTEM.DestroyAllSpawnedItems` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.DestroyAllSpawnedItems - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::DestroyAllSpawnedItems()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.DestroyAllSpawnedItems | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.DestroyAllSpawnedItems`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.DestroyAllSpawnedItems", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.DestroyAllSpawnedItems`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.DestroyAllSpawnedItems", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.DestroyAllSpawnedItems", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.DestroyAllSpawnedItems", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.DestroyAllSpawnedItems", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.DestroyAllSpawnedItems", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.DestroyAllSpawnedItems", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.DestroyAllSpawnedItems` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-freeupspawnpoint.md b/docs/02_development/hooks-library/system/greg-system-freeupspawnpoint.md deleted file mode 100644 index 062be14d..00000000 --- a/docs/02_development/hooks-library/system/greg-system-freeupspawnpoint.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.FreeUpSpawnPoint -sidebar_label: greg.SYSTEM.FreeUpSpawnPoint -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.FreeUpSpawnPoint" ---- - -# `greg.SYSTEM.FreeUpSpawnPoint` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.FreeUpSpawnPoint - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::FreeUpSpawnPoint(int)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.FreeUpSpawnPoint | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.FreeUpSpawnPoint`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.FreeUpSpawnPoint", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.FreeUpSpawnPoint`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.FreeUpSpawnPoint", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.FreeUpSpawnPoint", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.FreeUpSpawnPoint", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.FreeUpSpawnPoint", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.FreeUpSpawnPoint", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.FreeUpSpawnPoint", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.FreeUpSpawnPoint` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getapplogo.md b/docs/02_development/hooks-library/system/greg-system-getapplogo.md deleted file mode 100644 index a050194b..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getapplogo.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetAppLogo -sidebar_label: greg.SYSTEM.GetAppLogo -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetAppLogo" ---- - -# `greg.SYSTEM.GetAppLogo` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetAppLogo - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetAppLogo(int, int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetAppLogo | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetAppLogo`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetAppLogo", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetAppLogo`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetAppLogo", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetAppLogo", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetAppLogo", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetAppLogo", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetAppLogo", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetAppLogo", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetAppLogo` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getcablespinnerprefab.md b/docs/02_development/hooks-library/system/greg-system-getcablespinnerprefab.md deleted file mode 100644 index 9666f636..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getcablespinnerprefab.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetCableSpinnerPrefab -sidebar_label: greg.SYSTEM.GetCableSpinnerPrefab -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetCableSpinnerPrefab" ---- - -# `greg.SYSTEM.GetCableSpinnerPrefab` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetCableSpinnerPrefab - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetCableSpinnerPrefab(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetCableSpinnerPrefab | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetCableSpinnerPrefab`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetCableSpinnerPrefab", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetCableSpinnerPrefab`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetCableSpinnerPrefab", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetCableSpinnerPrefab", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetCableSpinnerPrefab", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetCableSpinnerPrefab", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetCableSpinnerPrefab", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetCableSpinnerPrefab", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetCableSpinnerPrefab` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getcustomeritembyid.md b/docs/02_development/hooks-library/system/greg-system-getcustomeritembyid.md deleted file mode 100644 index 6af83f91..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getcustomeritembyid.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetCustomerItemByID -sidebar_label: greg.SYSTEM.GetCustomerItemByID -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetCustomerItemByID" ---- - -# `greg.SYSTEM.GetCustomerItemByID` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetCustomerItemByID - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetCustomerItemByID(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetCustomerItemByID | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetCustomerItemByID`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetCustomerItemByID", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetCustomerItemByID`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetCustomerItemByID", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetCustomerItemByID", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetCustomerItemByID", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetCustomerItemByID", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetCustomerItemByID", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetCustomerItemByID", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetCustomerItemByID` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getcustomerlogo.md b/docs/02_development/hooks-library/system/greg-system-getcustomerlogo.md deleted file mode 100644 index e3323cb9..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getcustomerlogo.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetCustomerLogo -sidebar_label: greg.SYSTEM.GetCustomerLogo -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetCustomerLogo" ---- - -# `greg.SYSTEM.GetCustomerLogo` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetCustomerLogo - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetCustomerLogo(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetCustomerLogo | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetCustomerLogo`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetCustomerLogo", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetCustomerLogo`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetCustomerLogo", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetCustomerLogo", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetCustomerLogo", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetCustomerLogo", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetCustomerLogo", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetCustomerLogo", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetCustomerLogo` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getcustomertotalrequirement.md b/docs/02_development/hooks-library/system/greg-system-getcustomertotalrequirement.md deleted file mode 100644 index 2a6acca7..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getcustomertotalrequirement.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetCustomerTotalRequirement -sidebar_label: greg.SYSTEM.GetCustomerTotalRequirement -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetCustomerTotalRequirement" ---- - -# `greg.SYSTEM.GetCustomerTotalRequirement` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetCustomerTotalRequirement - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetCustomerTotalRequirement(CustomerItem)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetCustomerTotalRequirement | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetCustomerTotalRequirement`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetCustomerTotalRequirement", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetCustomerTotalRequirement`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetCustomerTotalRequirement", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetCustomerTotalRequirement", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetCustomerTotalRequirement", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetCustomerTotalRequirement", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetCustomerTotalRequirement", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetCustomerTotalRequirement", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetCustomerTotalRequirement` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getfreesubnet.md b/docs/02_development/hooks-library/system/greg-system-getfreesubnet.md deleted file mode 100644 index 8f8f6a7e..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getfreesubnet.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetFreeSubnet -sidebar_label: greg.SYSTEM.GetFreeSubnet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetFreeSubnet" ---- - -# `greg.SYSTEM.GetFreeSubnet` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetFreeSubnet - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetFreeSubnet(float)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetFreeSubnet | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetFreeSubnet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetFreeSubnet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetFreeSubnet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetFreeSubnet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetFreeSubnet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetFreeSubnet", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetFreeSubnet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetFreeSubnet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetFreeSubnet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetFreeSubnet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getnextavailablespawnpoint.md b/docs/02_development/hooks-library/system/greg-system-getnextavailablespawnpoint.md deleted file mode 100644 index 362734a4..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getnextavailablespawnpoint.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetNextAvailableSpawnPoint -sidebar_label: greg.SYSTEM.GetNextAvailableSpawnPoint -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.GetNextAvailableSpawnPoint" ---- - -# `greg.SYSTEM.GetNextAvailableSpawnPoint` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.GetNextAvailableSpawnPoint - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::GetNextAvailableSpawnPoint()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.GetNextAvailableSpawnPoint | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetNextAvailableSpawnPoint`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetNextAvailableSpawnPoint", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetNextAvailableSpawnPoint`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetNextAvailableSpawnPoint", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetNextAvailableSpawnPoint", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetNextAvailableSpawnPoint", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetNextAvailableSpawnPoint", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetNextAvailableSpawnPoint", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetNextAvailableSpawnPoint", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetNextAvailableSpawnPoint` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getpairedlink.md b/docs/02_development/hooks-library/system/greg-system-getpairedlink.md deleted file mode 100644 index 2d9acd51..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getpairedlink.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetPairedLink -sidebar_label: greg.SYSTEM.GetPairedLink -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PatchPanel.GetPairedLink" ---- - -# `greg.SYSTEM.GetPairedLink` - -## Description - -- Auto-generated from Il2Cpp unpack: PatchPanel.GetPairedLink - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PatchPanel::GetPairedLink(CableLink)` | Postfix | Auto-generated from Il2Cpp unpack: PatchPanel.GetPairedLink | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetPairedLink`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetPairedLink", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetPairedLink`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetPairedLink", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetPairedLink", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetPairedLink", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetPairedLink", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetPairedLink", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetPairedLink", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetPairedLink` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getpatchpanelprefab.md b/docs/02_development/hooks-library/system/greg-system-getpatchpanelprefab.md deleted file mode 100644 index 5bfa5612..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getpatchpanelprefab.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetPatchPanelPrefab -sidebar_label: greg.SYSTEM.GetPatchPanelPrefab -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetPatchPanelPrefab" ---- - -# `greg.SYSTEM.GetPatchPanelPrefab` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetPatchPanelPrefab - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetPatchPanelPrefab(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetPatchPanelPrefab | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetPatchPanelPrefab`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetPatchPanelPrefab", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetPatchPanelPrefab`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetPatchPanelPrefab", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetPatchPanelPrefab", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetPatchPanelPrefab", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetPatchPanelPrefab", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetPatchPanelPrefab", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetPatchPanelPrefab", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetPatchPanelPrefab` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getprefabforitem.md b/docs/02_development/hooks-library/system/greg-system-getprefabforitem.md deleted file mode 100644 index 792b42fb..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getprefabforitem.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetPrefabForItem -sidebar_label: greg.SYSTEM.GetPrefabForItem -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.GetPrefabForItem" ---- - -# `greg.SYSTEM.GetPrefabForItem` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.GetPrefabForItem - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::GetPrefabForItem(int, PlayerManager.ObjectInHand)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.GetPrefabForItem | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetPrefabForItem`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetPrefabForItem", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetPrefabForItem`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetPrefabForItem", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetPrefabForItem", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetPrefabForItem", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetPrefabForItem", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetPrefabForItem", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetPrefabForItem", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetPrefabForItem` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getserverprefab.md b/docs/02_development/hooks-library/system/greg-system-getserverprefab.md deleted file mode 100644 index c9d996fa..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getserverprefab.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetServerPrefab -sidebar_label: greg.SYSTEM.GetServerPrefab -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetServerPrefab" ---- - -# `greg.SYSTEM.GetServerPrefab` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetServerPrefab - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetServerPrefab(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetServerPrefab | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetServerPrefab`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetServerPrefab", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetServerPrefab`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetServerPrefab", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetServerPrefab", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetServerPrefab", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetServerPrefab", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetServerPrefab", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetServerPrefab", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetServerPrefab` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getsfpboxprefab.md b/docs/02_development/hooks-library/system/greg-system-getsfpboxprefab.md deleted file mode 100644 index 884f5e07..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getsfpboxprefab.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetSfpBoxPrefab -sidebar_label: greg.SYSTEM.GetSfpBoxPrefab -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetSfpBoxPrefab" ---- - -# `greg.SYSTEM.GetSfpBoxPrefab` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetSfpBoxPrefab - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetSfpBoxPrefab(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetSfpBoxPrefab | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetSfpBoxPrefab`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetSfpBoxPrefab", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetSfpBoxPrefab`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetSfpBoxPrefab", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetSfpBoxPrefab", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetSfpBoxPrefab", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetSfpBoxPrefab", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetSfpBoxPrefab", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetSfpBoxPrefab", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetSfpBoxPrefab` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getsfpprefab.md b/docs/02_development/hooks-library/system/greg-system-getsfpprefab.md deleted file mode 100644 index ca284ea7..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getsfpprefab.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetSfpPrefab -sidebar_label: greg.SYSTEM.GetSfpPrefab -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetSfpPrefab" ---- - -# `greg.SYSTEM.GetSfpPrefab` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetSfpPrefab - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetSfpPrefab(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetSfpPrefab | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetSfpPrefab`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetSfpPrefab", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetSfpPrefab`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetSfpPrefab", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetSfpPrefab", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetSfpPrefab", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetSfpPrefab", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetSfpPrefab", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetSfpPrefab", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetSfpPrefab` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-getswitchprefab.md b/docs/02_development/hooks-library/system/greg-system-getswitchprefab.md deleted file mode 100644 index 18dd824e..00000000 --- a/docs/02_development/hooks-library/system/greg-system-getswitchprefab.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.GetSwitchPrefab -sidebar_label: greg.SYSTEM.GetSwitchPrefab -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.GetSwitchPrefab" ---- - -# `greg.SYSTEM.GetSwitchPrefab` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.GetSwitchPrefab - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::GetSwitchPrefab(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.GetSwitchPrefab | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.GetSwitchPrefab`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.GetSwitchPrefab", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.GetSwitchPrefab`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.GetSwitchPrefab", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.GetSwitchPrefab", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.GetSwitchPrefab", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.GetSwitchPrefab", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.GetSwitchPrefab", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.GetSwitchPrefab", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.GetSwitchPrefab` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-handleobjectives.md b/docs/02_development/hooks-library/system/greg-system-handleobjectives.md deleted file mode 100644 index 635f6493..00000000 --- a/docs/02_development/hooks-library/system/greg-system-handleobjectives.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.HandleObjectives -sidebar_label: greg.SYSTEM.HandleObjectives -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.HandleObjectives" ---- - -# `greg.SYSTEM.HandleObjectives` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.HandleObjectives - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::HandleObjectives(PlayerManager.ObjectInHand)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.HandleObjectives | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.HandleObjectives`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.HandleObjectives", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.HandleObjectives`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.HandleObjectives", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.HandleObjectives", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.HandleObjectives", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.HandleObjectives", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.HandleObjectives", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.HandleObjectives", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.HandleObjectives` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-hoursfromdate.md b/docs/02_development/hooks-library/system/greg-system-hoursfromdate.md deleted file mode 100644 index 99e0c73a..00000000 --- a/docs/02_development/hooks-library/system/greg-system-hoursfromdate.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.HoursFromDate -sidebar_label: greg.SYSTEM.HoursFromDate -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TimeController.HoursFromDate" ---- - -# `greg.SYSTEM.HoursFromDate` - -## Description - -- Auto-generated from Il2Cpp unpack: TimeController.HoursFromDate - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TimeController::HoursFromDate(float, int)` | Postfix | Auto-generated from Il2Cpp unpack: TimeController.HoursFromDate | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.HoursFromDate`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.HoursFromDate", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.HoursFromDate`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.HoursFromDate", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.HoursFromDate", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.HoursFromDate", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.HoursFromDate", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.HoursFromDate", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.HoursFromDate", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.HoursFromDate` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-insertedinrack.md b/docs/02_development/hooks-library/system/greg-system-insertedinrack.md deleted file mode 100644 index dee3b8f4..00000000 --- a/docs/02_development/hooks-library/system/greg-system-insertedinrack.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.InsertedInRack -sidebar_label: greg.SYSTEM.InsertedInRack -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PatchPanel.InsertedInRack" ---- - -# `greg.SYSTEM.InsertedInRack` - -## Description - -- Auto-generated from Il2Cpp unpack: PatchPanel.InsertedInRack - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PatchPanel::InsertedInRack(PatchPanelSaveData)` | Postfix | Auto-generated from Il2Cpp unpack: PatchPanel.InsertedInRack | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.InsertedInRack`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.InsertedInRack", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.InsertedInRack`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.InsertedInRack", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.InsertedInRack", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.InsertedInRack", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.InsertedInRack", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.InsertedInRack", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.InsertedInRack", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.InsertedInRack` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-interactonclick.md b/docs/02_development/hooks-library/system/greg-system-interactonclick.md deleted file mode 100644 index cd7f4162..00000000 --- a/docs/02_development/hooks-library/system/greg-system-interactonclick.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.InteractOnClick -sidebar_label: greg.SYSTEM.InteractOnClick -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PatchPanel.InteractOnClick" ---- - -# `greg.SYSTEM.InteractOnClick` - -## Description - -- Auto-generated from Il2Cpp unpack: PatchPanel.InteractOnClick - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PatchPanel::InteractOnClick()` | Postfix | Auto-generated from Il2Cpp unpack: PatchPanel.InteractOnClick | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.InteractOnClick`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.InteractOnClick", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.InteractOnClick`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.InteractOnClick", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.InteractOnClick", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.InteractOnClick", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.InteractOnClick", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.InteractOnClick", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.InteractOnClick", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.InteractOnClick` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-isanycableconnected.md b/docs/02_development/hooks-library/system/greg-system-isanycableconnected.md deleted file mode 100644 index 1d81544d..00000000 --- a/docs/02_development/hooks-library/system/greg-system-isanycableconnected.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.IsAnyCableConnected -sidebar_label: greg.SYSTEM.IsAnyCableConnected -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PatchPanel.IsAnyCableConnected" ---- - -# `greg.SYSTEM.IsAnyCableConnected` - -## Description - -- Auto-generated from Il2Cpp unpack: PatchPanel.IsAnyCableConnected - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PatchPanel::IsAnyCableConnected()` | Postfix | Auto-generated from Il2Cpp unpack: PatchPanel.IsAnyCableConnected | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.IsAnyCableConnected`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.IsAnyCableConnected", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.IsAnyCableConnected`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.IsAnyCableConnected", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.IsAnyCableConnected", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.IsAnyCableConnected", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.IsAnyCableConnected", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.IsAnyCableConnected", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.IsAnyCableConnected", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.IsAnyCableConnected` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-iscustomersuitableforbase.md b/docs/02_development/hooks-library/system/greg-system-iscustomersuitableforbase.md deleted file mode 100644 index 6cb4751f..00000000 --- a/docs/02_development/hooks-library/system/greg-system-iscustomersuitableforbase.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.IsCustomerSuitableForBase -sidebar_label: greg.SYSTEM.IsCustomerSuitableForBase -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.IsCustomerSuitableForBase" ---- - -# `greg.SYSTEM.IsCustomerSuitableForBase` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.IsCustomerSuitableForBase - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::IsCustomerSuitableForBase(CustomerItem, int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.IsCustomerSuitableForBase | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.IsCustomerSuitableForBase`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.IsCustomerSuitableForBase", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.IsCustomerSuitableForBase`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.IsCustomerSuitableForBase", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.IsCustomerSuitableForBase", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.IsCustomerSuitableForBase", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.IsCustomerSuitableForBase", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.IsCustomerSuitableForBase", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.IsCustomerSuitableForBase", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.IsCustomerSuitableForBase` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-issubnetvalid.md b/docs/02_development/hooks-library/system/greg-system-issubnetvalid.md deleted file mode 100644 index 5d450bb4..00000000 --- a/docs/02_development/hooks-library/system/greg-system-issubnetvalid.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.IsSubnetValid -sidebar_label: greg.SYSTEM.IsSubnetValid -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.IsSubnetValid" ---- - -# `greg.SYSTEM.IsSubnetValid` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.IsSubnetValid - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::IsSubnetValid(string)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.IsSubnetValid | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.IsSubnetValid`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.IsSubnetValid", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.IsSubnetValid`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.IsSubnetValid", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.IsSubnetValid", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.IsSubnetValid", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.IsSubnetValid", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.IsSubnetValid", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.IsSubnetValid", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.IsSubnetValid` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-newcartitemspawned.md b/docs/02_development/hooks-library/system/greg-system-newcartitemspawned.md deleted file mode 100644 index 1e6d6721..00000000 --- a/docs/02_development/hooks-library/system/greg-system-newcartitemspawned.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.NewCartItemSpawned -sidebar_label: greg.SYSTEM.NewCartItemSpawned -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.SpawnNewCartItem" ---- - -# `greg.SYSTEM.NewCartItemSpawned` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.SpawnNewCartItem - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::SpawnNewCartItem(int, int, PlayerManager.ObjectInHand, string, Nullable)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.SpawnNewCartItem | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.NewCartItemSpawned`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.NewCartItemSpawned", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.NewCartItemSpawned`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.NewCartItemSpawned", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.NewCartItemSpawned", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.NewCartItemSpawned", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.NewCartItemSpawned", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.NewCartItemSpawned", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.NewCartItemSpawned", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.NewCartItemSpawned` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-newitempurchased.md b/docs/02_development/hooks-library/system/greg-system-newitempurchased.md deleted file mode 100644 index ea5a9d79..00000000 --- a/docs/02_development/hooks-library/system/greg-system-newitempurchased.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.NewItemPurchased -sidebar_label: greg.SYSTEM.NewItemPurchased -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.BuyNewItem" ---- - -# `greg.SYSTEM.NewItemPurchased` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.BuyNewItem - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::BuyNewItem(int, int, PlayerManager.ObjectInHand, string)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.BuyNewItem | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.NewItemPurchased`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.NewItemPurchased", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.NewItemPurchased`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.NewItemPurchased", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.NewItemPurchased", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.NewItemPurchased", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.NewItemPurchased", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.NewItemPurchased", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.NewItemPurchased", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.NewItemPurchased` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-onapplicationquit.md b/docs/02_development/hooks-library/system/greg-system-onapplicationquit.md deleted file mode 100644 index af65d469..00000000 --- a/docs/02_development/hooks-library/system/greg-system-onapplicationquit.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.OnApplicationQuit -sidebar_label: greg.SYSTEM.OnApplicationQuit -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.OnApplicationQuit" ---- - -# `greg.SYSTEM.OnApplicationQuit` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.OnApplicationQuit - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::OnApplicationQuit()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.OnApplicationQuit | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.OnApplicationQuit`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.OnApplicationQuit", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.OnApplicationQuit`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.OnApplicationQuit", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.OnApplicationQuit", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.OnApplicationQuit", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.OnApplicationQuit", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.OnApplicationQuit", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.OnApplicationQuit", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.OnApplicationQuit` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-ondestroy.md b/docs/02_development/hooks-library/system/greg-system-ondestroy.md deleted file mode 100644 index 41d06c62..00000000 --- a/docs/02_development/hooks-library/system/greg-system-ondestroy.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: greg.SYSTEM.OnDestroy -sidebar_label: greg.SYSTEM.OnDestroy -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.OnDestroy" ---- - -# `greg.SYSTEM.OnDestroy` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.OnDestroy -- Auto-generated from Il2Cpp unpack: MainGameManager.OnDestroy -- Auto-generated from Il2Cpp unpack: PatchPanel.OnDestroy - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **3** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.OnDestroy | -| `Il2Cpp.MainGameManager::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.OnDestroy | -| `Il2Cpp.PatchPanel::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: PatchPanel.OnDestroy | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.OnDestroy`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.OnDestroy", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.OnDestroy`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.OnDestroy", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.OnDestroy", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.OnDestroy", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.OnDestroy", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.OnDestroy", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.OnDestroy", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.OnDestroy` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-onhoverover.md b/docs/02_development/hooks-library/system/greg-system-onhoverover.md deleted file mode 100644 index 7eb2a830..00000000 --- a/docs/02_development/hooks-library/system/greg-system-onhoverover.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.OnHoverOver -sidebar_label: greg.SYSTEM.OnHoverOver -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.OnHoverOver" ---- - -# `greg.SYSTEM.OnHoverOver` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.OnHoverOver - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::OnHoverOver()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.OnHoverOver | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.OnHoverOver`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.OnHoverOver", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.OnHoverOver`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.OnHoverOver", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.OnHoverOver", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.OnHoverOver", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.OnHoverOver", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.OnHoverOver", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.OnHoverOver", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.OnHoverOver` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-onload.md b/docs/02_development/hooks-library/system/greg-system-onload.md deleted file mode 100644 index 3894b8c5..00000000 --- a/docs/02_development/hooks-library/system/greg-system-onload.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.SYSTEM.OnLoad -sidebar_label: greg.SYSTEM.OnLoad -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.OnLoad" ---- - -# `greg.SYSTEM.OnLoad` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.OnLoad -- Auto-generated from Il2Cpp unpack: MainGameManager.OnLoad - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **2** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::OnLoad()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.OnLoad | -| `Il2Cpp.MainGameManager::OnLoad()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.OnLoad | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.OnLoad`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.OnLoad", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.OnLoad`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.OnLoad", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.OnLoad", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.OnLoad", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.OnLoad", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.OnLoad", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.OnLoad", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.OnLoad` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-openanycanvas.md b/docs/02_development/hooks-library/system/greg-system-openanycanvas.md deleted file mode 100644 index 039a5804..00000000 --- a/docs/02_development/hooks-library/system/greg-system-openanycanvas.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.OpenAnyCanvas -sidebar_label: greg.SYSTEM.OpenAnyCanvas -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.OpenAnyCanvas" ---- - -# `greg.SYSTEM.OpenAnyCanvas` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.OpenAnyCanvas - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::OpenAnyCanvas()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.OpenAnyCanvas | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.OpenAnyCanvas`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.OpenAnyCanvas", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.OpenAnyCanvas`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.OpenAnyCanvas", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.OpenAnyCanvas", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.OpenAnyCanvas", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.OpenAnyCanvas", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.OpenAnyCanvas", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.OpenAnyCanvas", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.OpenAnyCanvas` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-opencolorpicker.md b/docs/02_development/hooks-library/system/greg-system-opencolorpicker.md deleted file mode 100644 index 9e218551..00000000 --- a/docs/02_development/hooks-library/system/greg-system-opencolorpicker.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.OpenColorPicker -sidebar_label: greg.SYSTEM.OpenColorPicker -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.OpenColorPicker" ---- - -# `greg.SYSTEM.OpenColorPicker` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.OpenColorPicker - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::OpenColorPicker()` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.OpenColorPicker | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.OpenColorPicker`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.OpenColorPicker", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.OpenColorPicker`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.OpenColorPicker", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.OpenColorPicker", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.OpenColorPicker", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.OpenColorPicker", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.OpenColorPicker", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.OpenColorPicker", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.OpenColorPicker` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-physicalitemspawned.md b/docs/02_development/hooks-library/system/greg-system-physicalitemspawned.md deleted file mode 100644 index 14877a93..00000000 --- a/docs/02_development/hooks-library/system/greg-system-physicalitemspawned.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.PhysicalItemSpawned -sidebar_label: greg.SYSTEM.PhysicalItemSpawned -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.SpawnPhysicalItem" ---- - -# `greg.SYSTEM.PhysicalItemSpawned` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.SpawnPhysicalItem - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::SpawnPhysicalItem(GameObject, int, PlayerManager.ObjectInHand)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.SpawnPhysicalItem | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.PhysicalItemSpawned`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.PhysicalItemSpawned", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.PhysicalItemSpawned`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.PhysicalItemSpawned", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.PhysicalItemSpawned", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.PhysicalItemSpawned", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.PhysicalItemSpawned", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.PhysicalItemSpawned", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.PhysicalItemSpawned", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.PhysicalItemSpawned` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-resettrolleyposition.md b/docs/02_development/hooks-library/system/greg-system-resettrolleyposition.md deleted file mode 100644 index f5a72f56..00000000 --- a/docs/02_development/hooks-library/system/greg-system-resettrolleyposition.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ResetTrolleyPosition -sidebar_label: greg.SYSTEM.ResetTrolleyPosition -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ResetTrolleyPosition" ---- - -# `greg.SYSTEM.ResetTrolleyPosition` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ResetTrolleyPosition - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ResetTrolleyPosition()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ResetTrolleyPosition | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ResetTrolleyPosition`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ResetTrolleyPosition", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ResetTrolleyPosition`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ResetTrolleyPosition", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ResetTrolleyPosition", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ResetTrolleyPosition", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ResetTrolleyPosition", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ResetTrolleyPosition", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ResetTrolleyPosition", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ResetTrolleyPosition` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-restartautosave.md b/docs/02_development/hooks-library/system/greg-system-restartautosave.md deleted file mode 100644 index 06a755b3..00000000 --- a/docs/02_development/hooks-library/system/greg-system-restartautosave.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.RestartAutoSave -sidebar_label: greg.SYSTEM.RestartAutoSave -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.RestartAutoSave" ---- - -# `greg.SYSTEM.RestartAutoSave` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.RestartAutoSave - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::RestartAutoSave()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.RestartAutoSave | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.RestartAutoSave`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.RestartAutoSave", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.RestartAutoSave`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.RestartAutoSave", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.RestartAutoSave", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.RestartAutoSave", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.RestartAutoSave", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.RestartAutoSave", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.RestartAutoSave", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.RestartAutoSave` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-returnservernamefromtype.md b/docs/02_development/hooks-library/system/greg-system-returnservernamefromtype.md deleted file mode 100644 index ebccc908..00000000 --- a/docs/02_development/hooks-library/system/greg-system-returnservernamefromtype.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ReturnServerNameFromType -sidebar_label: greg.SYSTEM.ReturnServerNameFromType -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ReturnServerNameFromType" ---- - -# `greg.SYSTEM.ReturnServerNameFromType` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ReturnServerNameFromType - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ReturnServerNameFromType(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ReturnServerNameFromType | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ReturnServerNameFromType`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ReturnServerNameFromType", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ReturnServerNameFromType`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ReturnServerNameFromType", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ReturnServerNameFromType", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ReturnServerNameFromType", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ReturnServerNameFromType", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ReturnServerNameFromType", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ReturnServerNameFromType", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ReturnServerNameFromType` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-returnsubnet.md b/docs/02_development/hooks-library/system/greg-system-returnsubnet.md deleted file mode 100644 index 3ef81c10..00000000 --- a/docs/02_development/hooks-library/system/greg-system-returnsubnet.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ReturnSubnet -sidebar_label: greg.SYSTEM.ReturnSubnet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ReturnSubnet" ---- - -# `greg.SYSTEM.ReturnSubnet` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ReturnSubnet - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ReturnSubnet(string)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ReturnSubnet | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ReturnSubnet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ReturnSubnet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ReturnSubnet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ReturnSubnet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ReturnSubnet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ReturnSubnet", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ReturnSubnet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ReturnSubnet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ReturnSubnet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ReturnSubnet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-returnswitchnamefromtype.md b/docs/02_development/hooks-library/system/greg-system-returnswitchnamefromtype.md deleted file mode 100644 index dfa1ed3d..00000000 --- a/docs/02_development/hooks-library/system/greg-system-returnswitchnamefromtype.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ReturnSwitchNameFromType -sidebar_label: greg.SYSTEM.ReturnSwitchNameFromType -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ReturnSwitchNameFromType" ---- - -# `greg.SYSTEM.ReturnSwitchNameFromType` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ReturnSwitchNameFromType - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ReturnSwitchNameFromType(int)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ReturnSwitchNameFromType | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ReturnSwitchNameFromType`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ReturnSwitchNameFromType", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ReturnSwitchNameFromType`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ReturnSwitchNameFromType", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ReturnSwitchNameFromType", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ReturnSwitchNameFromType", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ReturnSwitchNameFromType", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ReturnSwitchNameFromType", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ReturnSwitchNameFromType", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ReturnSwitchNameFromType` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-selectnextavailable.md b/docs/02_development/hooks-library/system/greg-system-selectnextavailable.md deleted file mode 100644 index b958cc9b..00000000 --- a/docs/02_development/hooks-library/system/greg-system-selectnextavailable.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.SelectNextAvailable -sidebar_label: greg.SYSTEM.SelectNextAvailable -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.SelectNextAvailable" ---- - -# `greg.SYSTEM.SelectNextAvailable` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.SelectNextAvailable - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::SelectNextAvailable(int)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.SelectNextAvailable | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.SelectNextAvailable`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.SelectNextAvailable", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.SelectNextAvailable`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.SelectNextAvailable", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.SelectNextAvailable", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.SelectNextAvailable", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.SelectNextAvailable", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.SelectNextAvailable", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.SelectNextAvailable", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.SelectNextAvailable` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-showbuywallcanvas.md b/docs/02_development/hooks-library/system/greg-system-showbuywallcanvas.md deleted file mode 100644 index 7eb54c4a..00000000 --- a/docs/02_development/hooks-library/system/greg-system-showbuywallcanvas.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ShowBuyWallCanvas -sidebar_label: greg.SYSTEM.ShowBuyWallCanvas -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ShowBuyWallCanvas" ---- - -# `greg.SYSTEM.ShowBuyWallCanvas` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ShowBuyWallCanvas - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ShowBuyWallCanvas(Wall)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ShowBuyWallCanvas | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ShowBuyWallCanvas`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ShowBuyWallCanvas", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ShowBuyWallCanvas`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ShowBuyWallCanvas", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ShowBuyWallCanvas", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ShowBuyWallCanvas", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ShowBuyWallCanvas", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ShowBuyWallCanvas", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ShowBuyWallCanvas", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ShowBuyWallCanvas` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-showcustomercardscanvas.md b/docs/02_development/hooks-library/system/greg-system-showcustomercardscanvas.md deleted file mode 100644 index f1267126..00000000 --- a/docs/02_development/hooks-library/system/greg-system-showcustomercardscanvas.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ShowCustomerCardsCanvas -sidebar_label: greg.SYSTEM.ShowCustomerCardsCanvas -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ShowCustomerCardsCanvas" ---- - -# `greg.SYSTEM.ShowCustomerCardsCanvas` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ShowCustomerCardsCanvas - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ShowCustomerCardsCanvas(CustomerBaseDoor)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ShowCustomerCardsCanvas | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ShowCustomerCardsCanvas`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ShowCustomerCardsCanvas", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ShowCustomerCardsCanvas`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ShowCustomerCardsCanvas", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ShowCustomerCardsCanvas", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ShowCustomerCardsCanvas", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ShowCustomerCardsCanvas", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ShowCustomerCardsCanvas", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ShowCustomerCardsCanvas", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ShowCustomerCardsCanvas` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-shownetworkconfigcanvas.md b/docs/02_development/hooks-library/system/greg-system-shownetworkconfigcanvas.md deleted file mode 100644 index 51457b64..00000000 --- a/docs/02_development/hooks-library/system/greg-system-shownetworkconfigcanvas.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ShowNetworkConfigCanvas -sidebar_label: greg.SYSTEM.ShowNetworkConfigCanvas -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ShowNetworkConfigCanvas" ---- - -# `greg.SYSTEM.ShowNetworkConfigCanvas` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ShowNetworkConfigCanvas - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ShowNetworkConfigCanvas(NetworkSwitch)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ShowNetworkConfigCanvas | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ShowNetworkConfigCanvas`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ShowNetworkConfigCanvas", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ShowNetworkConfigCanvas`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ShowNetworkConfigCanvas", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ShowNetworkConfigCanvas", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ShowNetworkConfigCanvas", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ShowNetworkConfigCanvas", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ShowNetworkConfigCanvas", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ShowNetworkConfigCanvas", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ShowNetworkConfigCanvas` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-shuffleavailablecustomers.md b/docs/02_development/hooks-library/system/greg-system-shuffleavailablecustomers.md deleted file mode 100644 index 057dff3c..00000000 --- a/docs/02_development/hooks-library/system/greg-system-shuffleavailablecustomers.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ShuffleAvailableCustomers -sidebar_label: greg.SYSTEM.ShuffleAvailableCustomers -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ShuffleAvailableCustomers" ---- - -# `greg.SYSTEM.ShuffleAvailableCustomers` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ShuffleAvailableCustomers - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ShuffleAvailableCustomers()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ShuffleAvailableCustomers | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ShuffleAvailableCustomers`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ShuffleAvailableCustomers", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ShuffleAvailableCustomers`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ShuffleAvailableCustomers", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ShuffleAvailableCustomers", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ShuffleAvailableCustomers", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ShuffleAvailableCustomers", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ShuffleAvailableCustomers", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ShuffleAvailableCustomers", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ShuffleAvailableCustomers` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-shuffleavailablesubnets.md b/docs/02_development/hooks-library/system/greg-system-shuffleavailablesubnets.md deleted file mode 100644 index 49e60932..00000000 --- a/docs/02_development/hooks-library/system/greg-system-shuffleavailablesubnets.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ShuffleAvailableSubnets -sidebar_label: greg.SYSTEM.ShuffleAvailableSubnets -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.ShuffleAvailableSubnets" ---- - -# `greg.SYSTEM.ShuffleAvailableSubnets` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.ShuffleAvailableSubnets - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::ShuffleAvailableSubnets()` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.ShuffleAvailableSubnets | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ShuffleAvailableSubnets`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ShuffleAvailableSubnets", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ShuffleAvailableSubnets`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ShuffleAvailableSubnets", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ShuffleAvailableSubnets", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ShuffleAvailableSubnets", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ShuffleAvailableSubnets", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ShuffleAvailableSubnets", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ShuffleAvailableSubnets", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ShuffleAvailableSubnets` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-timeisbetween.md b/docs/02_development/hooks-library/system/greg-system-timeisbetween.md deleted file mode 100644 index 5f7b56e1..00000000 --- a/docs/02_development/hooks-library/system/greg-system-timeisbetween.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.TimeIsBetween -sidebar_label: greg.SYSTEM.TimeIsBetween -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: TimeController.TimeIsBetween" ---- - -# `greg.SYSTEM.TimeIsBetween` - -## Description - -- Auto-generated from Il2Cpp unpack: TimeController.TimeIsBetween - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.TimeController::TimeIsBetween(float, float)` | Postfix | Auto-generated from Il2Cpp unpack: TimeController.TimeIsBetween | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.TimeIsBetween`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.TimeIsBetween", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.TimeIsBetween`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.TimeIsBetween", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.TimeIsBetween", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.TimeIsBetween", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.TimeIsBetween", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.TimeIsBetween", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.TimeIsBetween", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.TimeIsBetween` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-trolleypositionloaded.md b/docs/02_development/hooks-library/system/greg-system-trolleypositionloaded.md deleted file mode 100644 index 84a9db79..00000000 --- a/docs/02_development/hooks-library/system/greg-system-trolleypositionloaded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.TrolleyPositionLoaded -sidebar_label: greg.SYSTEM.TrolleyPositionLoaded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.LoadTrolleyPosition" ---- - -# `greg.SYSTEM.TrolleyPositionLoaded` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.LoadTrolleyPosition - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::LoadTrolleyPosition(Vector3, Quaternion)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.LoadTrolleyPosition | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.TrolleyPositionLoaded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.TrolleyPositionLoaded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.TrolleyPositionLoaded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.TrolleyPositionLoaded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.TrolleyPositionLoaded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.TrolleyPositionLoaded", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.TrolleyPositionLoaded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.TrolleyPositionLoaded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.TrolleyPositionLoaded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.TrolleyPositionLoaded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-unlockfromsave.md b/docs/02_development/hooks-library/system/greg-system-unlockfromsave.md deleted file mode 100644 index 41abc7b3..00000000 --- a/docs/02_development/hooks-library/system/greg-system-unlockfromsave.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.UnlockFromSave -sidebar_label: greg.SYSTEM.UnlockFromSave -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: ComputerShop.UnlockFromSave" ---- - -# `greg.SYSTEM.UnlockFromSave` - -## Description - -- Auto-generated from Il2Cpp unpack: ComputerShop.UnlockFromSave - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.ComputerShop::UnlockFromSave(Dictionary)` | Postfix | Auto-generated from Il2Cpp unpack: ComputerShop.UnlockFromSave | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.UnlockFromSave`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.UnlockFromSave", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.UnlockFromSave`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.UnlockFromSave", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.UnlockFromSave", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.UnlockFromSave", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.UnlockFromSave", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.UnlockFromSave", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.UnlockFromSave", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.UnlockFromSave` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-usedsubnetremoved.md b/docs/02_development/hooks-library/system/greg-system-usedsubnetremoved.md deleted file mode 100644 index 95e0eb86..00000000 --- a/docs/02_development/hooks-library/system/greg-system-usedsubnetremoved.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.UsedSubnetRemoved -sidebar_label: greg.SYSTEM.UsedSubnetRemoved -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainGameManager.RemoveUsedSubnet" ---- - -# `greg.SYSTEM.UsedSubnetRemoved` - -## Description - -- Auto-generated from Il2Cpp unpack: MainGameManager.RemoveUsedSubnet - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainGameManager::RemoveUsedSubnet(string)` | Postfix | Auto-generated from Il2Cpp unpack: MainGameManager.RemoveUsedSubnet | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.UsedSubnetRemoved`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.UsedSubnetRemoved", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.UsedSubnetRemoved`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.UsedSubnetRemoved", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.UsedSubnetRemoved", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.UsedSubnetRemoved", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.UsedSubnetRemoved", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.UsedSubnetRemoved", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.UsedSubnetRemoved", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.UsedSubnetRemoved` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/system/greg-system-validaterackposition.md b/docs/02_development/hooks-library/system/greg-system-validaterackposition.md deleted file mode 100644 index 95bfe2c3..00000000 --- a/docs/02_development/hooks-library/system/greg-system-validaterackposition.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.SYSTEM.ValidateRackPosition -sidebar_label: greg.SYSTEM.ValidateRackPosition -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: PatchPanel.ValidateRackPosition" ---- - -# `greg.SYSTEM.ValidateRackPosition` - -## Description - -- Auto-generated from Il2Cpp unpack: PatchPanel.ValidateRackPosition - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.PatchPanel::ValidateRackPosition()` | Postfix | Auto-generated from Il2Cpp unpack: PatchPanel.ValidateRackPosition | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.SYSTEM.ValidateRackPosition`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.SYSTEM.ValidateRackPosition", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.SYSTEM.ValidateRackPosition`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.SYSTEM.ValidateRackPosition", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.SYSTEM.ValidateRackPosition", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.SYSTEM.ValidateRackPosition", |payload| { - if let Some(method) = payload.get("method") { - println!("[SYSTEM] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.SYSTEM.ValidateRackPosition", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[SYSTEM] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.SYSTEM.ValidateRackPosition", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.SYSTEM.ValidateRackPosition", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[SYSTEM] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.SYSTEM.ValidateRackPosition` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/_category_.json b/docs/02_development/hooks-library/ui/_category_.json deleted file mode 100644 index dc47a16e..00000000 --- a/docs/02_development/hooks-library/ui/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "UI hooks", - "position": 1, - "collapsible": true, - "collapsed": true -} - diff --git a/docs/02_development/hooks-library/ui/greg-ui-clearrows.md b/docs/02_development/hooks-library/ui/greg-ui-clearrows.md deleted file mode 100644 index 45339b11..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-clearrows.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.ClearRows -sidebar_label: greg.UI.ClearRows -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.ClearRows" ---- - -# `greg.UI.ClearRows` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.ClearRows - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::ClearRows()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.ClearRows | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.ClearRows`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.ClearRows", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.ClearRows`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.ClearRows", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.ClearRows", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.ClearRows", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.ClearRows", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.ClearRows", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.ClearRows", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.ClearRows` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-componentinitialized.md b/docs/02_development/hooks-library/ui/greg-ui-componentinitialized.md deleted file mode 100644 index 28f0e8f1..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-componentinitialized.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: greg.UI.ComponentInitialized -sidebar_label: greg.UI.ComponentInitialized -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.Awake" ---- - -# `greg.UI.ComponentInitialized` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.Awake -- Auto-generated from Il2Cpp unpack: BalanceSheet.Start - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **2** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::Awake()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.Awake | -| `Il2Cpp.BalanceSheet::Start()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.Start | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.ComponentInitialized`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.ComponentInitialized", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.ComponentInitialized`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.ComponentInitialized", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.ComponentInitialized", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.ComponentInitialized", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.ComponentInitialized", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.ComponentInitialized", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.ComponentInitialized", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.ComponentInitialized` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-continue.md b/docs/02_development/hooks-library/ui/greg-ui-continue.md deleted file mode 100644 index a5237971..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-continue.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.Continue -sidebar_label: greg.UI.Continue -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainMenu.Continue" ---- - -# `greg.UI.Continue` - -## Description - -- Auto-generated from Il2Cpp unpack: MainMenu.Continue - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainMenu::Continue()` | Postfix | Auto-generated from Il2Cpp unpack: MainMenu.Continue | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.Continue`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.Continue", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.Continue`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.Continue", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.Continue", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.Continue", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.Continue", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.Continue", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.Continue", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.Continue` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-countfailingapps.md b/docs/02_development/hooks-library/ui/greg-ui-countfailingapps.md deleted file mode 100644 index b6758d91..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-countfailingapps.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.CountFailingApps -sidebar_label: greg.UI.CountFailingApps -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.CountFailingApps" ---- - -# `greg.UI.CountFailingApps` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.CountFailingApps - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::CountFailingApps(CustomerBase)` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.CountFailingApps | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.CountFailingApps`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.CountFailingApps", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.CountFailingApps`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.CountFailingApps", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.CountFailingApps", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.CountFailingApps", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.CountFailingApps", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.CountFailingApps", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.CountFailingApps", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.CountFailingApps` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-fillinbalancesheet.md b/docs/02_development/hooks-library/ui/greg-ui-fillinbalancesheet.md deleted file mode 100644 index 0b3abd5d..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-fillinbalancesheet.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.FillInBalanceSheet -sidebar_label: greg.UI.FillInBalanceSheet -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.FillInBalanceSheet" ---- - -# `greg.UI.FillInBalanceSheet` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.FillInBalanceSheet - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::FillInBalanceSheet()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.FillInBalanceSheet | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.FillInBalanceSheet`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.FillInBalanceSheet", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.FillInBalanceSheet`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.FillInBalanceSheet", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.FillInBalanceSheet", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.FillInBalanceSheet", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.FillInBalanceSheet", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.FillInBalanceSheet", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.FillInBalanceSheet", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.FillInBalanceSheet` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-fromsaveloaded.md b/docs/02_development/hooks-library/ui/greg-ui-fromsaveloaded.md deleted file mode 100644 index e40f24d8..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-fromsaveloaded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.FromSaveLoaded -sidebar_label: greg.UI.FromSaveLoaded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.LoadFromSave" ---- - -# `greg.UI.FromSaveLoaded` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.LoadFromSave - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::LoadFromSave()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.LoadFromSave | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.FromSaveLoaded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.FromSaveLoaded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.FromSaveLoaded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.FromSaveLoaded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.FromSaveLoaded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.FromSaveLoaded", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.FromSaveLoaded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.FromSaveLoaded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.FromSaveLoaded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.FromSaveLoaded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-gameloaded.md b/docs/02_development/hooks-library/ui/greg-ui-gameloaded.md deleted file mode 100644 index 0edcad3a..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-gameloaded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.GameLoaded -sidebar_label: greg.UI.GameLoaded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainMenu.LoadGame" ---- - -# `greg.UI.GameLoaded` - -## Description - -- Auto-generated from Il2Cpp unpack: MainMenu.LoadGame - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainMenu::LoadGame()` | Postfix | Auto-generated from Il2Cpp unpack: MainMenu.LoadGame | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.GameLoaded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.GameLoaded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.GameLoaded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.GameLoaded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.GameLoaded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.GameLoaded", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.GameLoaded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.GameLoaded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.GameLoaded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.GameLoaded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-getlatestsnapshot.md b/docs/02_development/hooks-library/ui/greg-ui-getlatestsnapshot.md deleted file mode 100644 index 8f00b856..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-getlatestsnapshot.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.GetLatestSnapshot -sidebar_label: greg.UI.GetLatestSnapshot -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.GetLatestSnapshot" ---- - -# `greg.UI.GetLatestSnapshot` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.GetLatestSnapshot - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::GetLatestSnapshot()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.GetLatestSnapshot | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.GetLatestSnapshot`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.GetLatestSnapshot", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.GetLatestSnapshot`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.GetLatestSnapshot", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.GetLatestSnapshot", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.GetLatestSnapshot", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.GetLatestSnapshot", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.GetLatestSnapshot", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.GetLatestSnapshot", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.GetLatestSnapshot` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-getorcreaterecord.md b/docs/02_development/hooks-library/ui/greg-ui-getorcreaterecord.md deleted file mode 100644 index a26fdae6..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-getorcreaterecord.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.GetOrCreateRecord -sidebar_label: greg.UI.GetOrCreateRecord -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.GetOrCreateRecord" ---- - -# `greg.UI.GetOrCreateRecord` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.GetOrCreateRecord - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::GetOrCreateRecord(CustomerItem)` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.GetOrCreateRecord | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.GetOrCreateRecord`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.GetOrCreateRecord", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.GetOrCreateRecord`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.GetOrCreateRecord", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.GetOrCreateRecord", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.GetOrCreateRecord", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.GetOrCreateRecord", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.GetOrCreateRecord", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.GetOrCreateRecord", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.GetOrCreateRecord` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-getsavedata.md b/docs/02_development/hooks-library/ui/greg-ui-getsavedata.md deleted file mode 100644 index 2b2fc98f..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-getsavedata.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.GetSaveData -sidebar_label: greg.UI.GetSaveData -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.GetSaveData" ---- - -# `greg.UI.GetSaveData` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.GetSaveData - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::GetSaveData()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.GetSaveData | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.GetSaveData`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.GetSaveData", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.GetSaveData`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.GetSaveData", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.GetSaveData", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.GetSaveData", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.GetSaveData", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.GetSaveData", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.GetSaveData", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.GetSaveData` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-headerrowadded.md b/docs/02_development/hooks-library/ui/greg-ui-headerrowadded.md deleted file mode 100644 index 410332c5..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-headerrowadded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.HeaderRowAdded -sidebar_label: greg.UI.HeaderRowAdded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.AddHeaderRow" ---- - -# `greg.UI.HeaderRowAdded` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.AddHeaderRow - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::AddHeaderRow()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.AddHeaderRow | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.HeaderRowAdded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.HeaderRowAdded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.HeaderRowAdded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.HeaderRowAdded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.HeaderRowAdded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.HeaderRowAdded", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.HeaderRowAdded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.HeaderRowAdded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.HeaderRowAdded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.HeaderRowAdded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-hidemiddlemenu.md b/docs/02_development/hooks-library/ui/greg-ui-hidemiddlemenu.md deleted file mode 100644 index 5f7e2d01..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-hidemiddlemenu.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.HideMiddleMenu -sidebar_label: greg.UI.HideMiddleMenu -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainMenu.HideMiddleMenu" ---- - -# `greg.UI.HideMiddleMenu` - -## Description - -- Auto-generated from Il2Cpp unpack: MainMenu.HideMiddleMenu - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainMenu::HideMiddleMenu()` | Postfix | Auto-generated from Il2Cpp unpack: MainMenu.HideMiddleMenu | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.HideMiddleMenu`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.HideMiddleMenu", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.HideMiddleMenu`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.HideMiddleMenu", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.HideMiddleMenu", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.HideMiddleMenu", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.HideMiddleMenu", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.HideMiddleMenu", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.HideMiddleMenu", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.HideMiddleMenu` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-instantiaterow.md b/docs/02_development/hooks-library/ui/greg-ui-instantiaterow.md deleted file mode 100644 index f84910e0..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-instantiaterow.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.InstantiateRow -sidebar_label: greg.UI.InstantiateRow -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.InstantiateRow" ---- - -# `greg.UI.InstantiateRow` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.InstantiateRow - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::InstantiateRow()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.InstantiateRow | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.InstantiateRow`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.InstantiateRow", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.InstantiateRow`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.InstantiateRow", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.InstantiateRow", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.InstantiateRow", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.InstantiateRow", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.InstantiateRow", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.InstantiateRow", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.InstantiateRow` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-newgame.md b/docs/02_development/hooks-library/ui/greg-ui-newgame.md deleted file mode 100644 index 95f6e724..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-newgame.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.NewGame -sidebar_label: greg.UI.NewGame -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainMenu.NewGame" ---- - -# `greg.UI.NewGame` - -## Description - -- Auto-generated from Il2Cpp unpack: MainMenu.NewGame - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainMenu::NewGame()` | Postfix | Auto-generated from Il2Cpp unpack: MainMenu.NewGame | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.NewGame`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.NewGame", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.NewGame`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.NewGame", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.NewGame", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.NewGame", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.NewGame", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.NewGame", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.NewGame", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.NewGame` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-ondestroy.md b/docs/02_development/hooks-library/ui/greg-ui-ondestroy.md deleted file mode 100644 index 8f2d23f3..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-ondestroy.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.OnDestroy -sidebar_label: greg.UI.OnDestroy -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.OnDestroy" ---- - -# `greg.UI.OnDestroy` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.OnDestroy - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::OnDestroy()` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.OnDestroy | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.OnDestroy`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.OnDestroy", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.OnDestroy`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.OnDestroy", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.OnDestroy", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.OnDestroy", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.OnDestroy", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.OnDestroy", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.OnDestroy", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.OnDestroy` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-quitgame.md b/docs/02_development/hooks-library/ui/greg-ui-quitgame.md deleted file mode 100644 index 6431db39..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-quitgame.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.QuitGame -sidebar_label: greg.UI.QuitGame -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: MainMenu.QuitGame" ---- - -# `greg.UI.QuitGame` - -## Description - -- Auto-generated from Il2Cpp unpack: MainMenu.QuitGame - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.MainMenu::QuitGame()` | Postfix | Auto-generated from Il2Cpp unpack: MainMenu.QuitGame | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.QuitGame`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.QuitGame", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.QuitGame`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.QuitGame", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.QuitGame", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.QuitGame", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.QuitGame", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.QuitGame", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.QuitGame", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.QuitGame` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-registersalary.md b/docs/02_development/hooks-library/ui/greg-ui-registersalary.md deleted file mode 100644 index f074759a..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-registersalary.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.RegisterSalary -sidebar_label: greg.UI.RegisterSalary -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.RegisterSalary" ---- - -# `greg.UI.RegisterSalary` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.RegisterSalary - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::RegisterSalary(int)` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.RegisterSalary | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.RegisterSalary`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.RegisterSalary", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.RegisterSalary`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.RegisterSalary", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.RegisterSalary", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.RegisterSalary", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.RegisterSalary", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.RegisterSalary", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.RegisterSalary", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.RegisterSalary` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-restorerecord.md b/docs/02_development/hooks-library/ui/greg-ui-restorerecord.md deleted file mode 100644 index d34136c2..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-restorerecord.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.RestoreRecord -sidebar_label: greg.UI.RestoreRecord -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.RestoreRecord" ---- - -# `greg.UI.RestoreRecord` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.RestoreRecord - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::RestoreRecord(CustomerRecordSaveData)` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.RestoreRecord | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.RestoreRecord`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.RestoreRecord", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.RestoreRecord`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.RestoreRecord", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.RestoreRecord", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.RestoreRecord", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.RestoreRecord", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.RestoreRecord", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.RestoreRecord", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.RestoreRecord` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-rowadded.md b/docs/02_development/hooks-library/ui/greg-ui-rowadded.md deleted file mode 100644 index b8cc5cae..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-rowadded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.RowAdded -sidebar_label: greg.UI.RowAdded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.AddRow" ---- - -# `greg.UI.RowAdded` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.AddRow - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::AddRow(string, float, float, float, Sprite)` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.AddRow | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.RowAdded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.RowAdded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.RowAdded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.RowAdded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.RowAdded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.RowAdded", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.RowAdded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.RowAdded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.RowAdded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.RowAdded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-salaryrowadded.md b/docs/02_development/hooks-library/ui/greg-ui-salaryrowadded.md deleted file mode 100644 index 1330989a..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-salaryrowadded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.SalaryRowAdded -sidebar_label: greg.UI.SalaryRowAdded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.AddSalaryRow" ---- - -# `greg.UI.SalaryRowAdded` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.AddSalaryRow - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::AddSalaryRow(float)` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.AddSalaryRow | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.SalaryRowAdded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.SalaryRowAdded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.SalaryRowAdded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.SalaryRowAdded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.SalaryRowAdded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.SalaryRowAdded", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.SalaryRowAdded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.SalaryRowAdded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.SalaryRowAdded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.SalaryRowAdded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-sectiontitleadded.md b/docs/02_development/hooks-library/ui/greg-ui-sectiontitleadded.md deleted file mode 100644 index 681fad05..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-sectiontitleadded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.SectionTitleAdded -sidebar_label: greg.UI.SectionTitleAdded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.AddSectionTitle" ---- - -# `greg.UI.SectionTitleAdded` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.AddSectionTitle - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::AddSectionTitle(string)` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.AddSectionTitle | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.SectionTitleAdded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.SectionTitleAdded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.SectionTitleAdded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.SectionTitleAdded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.SectionTitleAdded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.SectionTitleAdded", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.SectionTitleAdded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.SectionTitleAdded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.SectionTitleAdded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.SectionTitleAdded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/hooks-library/ui/greg-ui-totalrowadded.md b/docs/02_development/hooks-library/ui/greg-ui-totalrowadded.md deleted file mode 100644 index 0324b598..00000000 --- a/docs/02_development/hooks-library/ui/greg-ui-totalrowadded.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: greg.UI.TotalRowAdded -sidebar_label: greg.UI.TotalRowAdded -description: "gregCore Hook — Auto-generated from Il2Cpp unpack: BalanceSheet.AddTotalRow" ---- - -# `greg.UI.TotalRowAdded` - -## Description - -- Auto-generated from Il2Cpp unpack: BalanceSheet.AddTotalRow - -## Patch Targets (Il2Cpp) - -This hook name can be mapped to **1** Harmony target(s): - -| Patch Target | Strategy | Description | -|------------|-----------|--------------| -| `Il2Cpp.BalanceSheet::AddTotalRow(float, float, float)` | Postfix | Auto-generated from Il2Cpp unpack: BalanceSheet.AddTotalRow | - -**Strategy:** Postfix — The catalog says **Postfix** → typically use `HookBinder.OnAfter(...)`. - -## Payload Schema (from Registry) - -| Field | Type / Note | -|------|----------------| -| `method` | `string` | - -## How to use this hook - -### 1. Harmony Pipeline: `HookBinder` (Main path for `greg_hooks.json`) - -The framework code patches Il2Cpp methods and calls `HookBinder.DispatchBefore` / `DispatchAfter`. You register handlers with the **exact** string `greg.UI.TotalRowAdded`: - -```csharp -using GregFramework.Hooks; - -// For Postfix strategy (common): -HookBinder.OnAfter("greg.UI.TotalRowAdded", ctx => -{ - // ctx.HookName, ctx.Method, ctx.Instance, ctx.Arguments, ctx.ReturnValue -}); -``` - -Prerequisites: - -- A hook **catalog** / alias file has been loaded (e.g., `HookBinder.LoadAliases(path)` or `Hooker.InstallFromCatalog(...)`), so the Il2Cpp signature is mapped to the canonical string `greg.UI.TotalRowAdded`. -- Namespace `GregFramework.Hooks`, type `HookContext` (includes `Arguments`, `Instance`, `ReturnValue`, etc.). - -### 2. Object Bus: `GregEventDispatcher` (Rust / FFI / manual emits) - -Some names in the form `greg..` are additionally fired from the core via GregHookIntegration / GregEventDispatcher.Emit (numeric EventIds → String). If your hook is only defined in greg_hooks.json as an Il2Cpp patch, **HookBinder** is the correct entry point; use GregEventDispatcher if you want to explicitly listen to the payload bus: - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On("greg.UI.TotalRowAdded", payload => -{ - // depending on the payload type; helpers: GregPayload.Get(payload, "field", fallback) -}); -``` - -Unregister: `GregEventDispatcher.Off("greg.UI.TotalRowAdded", handler)` (same delegate reference as for `On`). - -## See also - -- [Overview of all greg hooks](/wiki/_internal/README) -- Source: `gregCore/gregFramework/greg_hooks.json` -## Usage in Rust - -If your Rust bridge exposes the event bus, subscribe to the exact hook name: - -~~~rust -use greg_framework::events::EventBus; - -fn register_hooks(bus: &mut EventBus) { - bus.on("greg.UI.TotalRowAdded", |payload| { - if let Some(method) = payload.get("method") { - println!("[UI] method={}", method); - } - }); -} -~~~ - -> If your current Rust runtime only exposes numeric EventIds, map those IDs to canonical `greg.*` names in your bridge layer before dispatching to mod code. - -## Usage in Lua - -Use the Lua bridge and register against the same canonical hook string: - -~~~lua -greg.on("greg.UI.TotalRowAdded", function(payload) - local method = payload and payload.method or "unknown" - greg.log("[UI] method=" .. tostring(method)) -end) -~~~ - -For Harmony-level interception use: - -~~~lua -greg.hook.after("greg.UI.TotalRowAdded", function(ctx) - greg.log("after hook: " .. tostring(ctx.method_name)) -end) -~~~ - -## Usage in TypeScript - -In a TS/JS bridge, subscribe via your event client using the same hook key: - -~~~ts -import { gregBus } from './gregBus'; - -gregBus.on("greg.UI.TotalRowAdded", (payload) => { - const method = payload?.method ?? 'unknown'; - console.log("[UI] method=" + method); -}); -~~~ - -When using RPC/WebSocket transport, keep `greg.UI.TotalRowAdded` as the canonical routing key end-to-end. - - diff --git a/docs/02_development/tutorials/_category_.json b/docs/02_development/tutorials/_category_.json deleted file mode 100644 index e520e21a..00000000 --- a/docs/02_development/tutorials/_category_.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "label": "Tutorials", - "position": 3, - "collapsible": true, - "collapsed": false -} - diff --git a/docs/02_development/tutorials/hexviewer-csharp.md b/docs/02_development/tutorials/hexviewer-csharp.md deleted file mode 100644 index e11ae6ea..00000000 --- a/docs/02_development/tutorials/hexviewer-csharp.md +++ /dev/null @@ -1,339 +0,0 @@ ---- -id: hexviewer-csharp -title: HexViewer Mod Tutorial (C#) -sidebar_label: HexViewer in C# -slug: /development/tutorials/hexviewer-csharp -description: Technical writing tutorial for the HexViewer C# logic layer in gregCore, including structure, build pipeline, and in-game validation. ---- - -HexViewer is a hybrid gregCore mod that renders a JADE-like top-center HUD with target information for racks, cables, and cable spinners. - -This page implements the **C# Core Logic layer** in the architecture: - -- **C# (Core Logic):** raycast + entity identity resolution -- **Rust (Data Layer):** fast metadata query (color, owner, type) -- **TypeScript (UI Layer):** HUD rendering (`Anchor.TopCenter`) -- **Lua (Config Layer):** filter profile and thresholds - -> Layer ownership: this page belongs to **GregFramework Core SDK layer** and communicates with bridges/mod layers through canonical `greg.*` events. - -## Introduction - -HexViewer continuously resolves the currently targeted object and emits a normalized payload event: - -- Event name: `greg.HEXVIEWER.TargetUpdated` -- Event payload: `{ entityId, entityType, colorHex, ownerName, distanceMeters }` - -UI and scripting layers must never call Unity internals directly; they subscribe to this event. - -## Project structure (hybrid mod) - -Use one repository folder for the mod package, with explicit language boundaries: - -```text -gregMod.HexViewer/ -├─ csharp/ -│ ├─ gregMod.HexViewer.csproj -│ └─ HexViewerMod.cs -├─ rust/ -│ ├─ Cargo.toml -│ └─ src/lib.rs -├─ ts/ -│ ├─ package.json -│ ├─ tsconfig.json -│ └─ src/hud.ts -├─ lua/ -│ └─ hexviewer_config.lua -├─ dist/ -│ ├─ gregMod.HexViewer.dll -│ ├─ hexviewer_rust.dll -│ └─ hexviewer_hud.js -└─ manifest/ - └─ hexviewer.mod.json -``` - -## Build pipeline in gregCore ecosystem - -1. Build C# logic against `gregCore.dll`. -2. Build Rust `cdylib` for metadata adapter. -3. Build TypeScript HUD bundle. -4. Copy artifacts to game mod folders. -5. Start game, verify runtime registration and event flow. - -Recommended command sequence: - -```powershell -dotnet build .\csharp\gregMod.HexViewer.csproj -c Release -cargo build --manifest-path .\rust\Cargo.toml --release -pnpm --dir .\ts install -pnpm --dir .\ts run build -``` - -## C# implementation (logic layer) - -Create `csharp/gregMod.HexViewer.csproj`: - -```xml - - - net6.0 - enable - latest - - - - - ..\..\gregCore\framework\bin\Release\net6.0\gregCore.dll - - - ..\..\gregCore\lib\references\MelonLoader\MelonLoader.dll - - - -``` - -Create `csharp/HexViewerMod.cs`: - -```csharp -using System; -using MelonLoader; -using GregFramework.Hooks; -using gregFramework.Core; - -namespace GregMod.HexViewer; - -public sealed class HexViewerMod : MelonMod -{ - private const string HudEventName = "greg.HEXVIEWER.TargetUpdated"; - - public override void OnInitializeMelon() - { - MelonLogger.Msg("[HexViewer] Init"); - - HookBinder.OnAfter("greg.PLAYER.InteractOnClick", OnTargetProbe); - HookBinder.OnAfter("greg.UI.OnHoverOver", OnTargetProbe); - } - - private static void OnTargetProbe(HookContext ctx) - { - try - { - // gregCore-specific: physics target acquisition (placeholder if absent in current branch) - var hit = GregSystems.Physics.TryRaycastFromCrosshair(); - if (!hit.HasValue) - { - return; - } - - // gregCore-specific: entity id extraction via gregCore EntityManager - var entityId = GregSystems.EntityManager.GetEntityId(hit.Value.GameObject); - if (entityId == 0) - { - return; - } - - var entityType = GregSystems.EntityManager.GetEntityType(entityId); - var distanceMeters = hit.Value.DistanceMeters; - - var payload = new - { - entityId, - entityType, - distanceMeters, - colorHex = "#000000", - ownerName = "unknown" - }; - - // gregCore-specific: central event bus emission to bridges (TS/Lua/Rust consumers) - GregEventDispatcher.Emit(HudEventName, payload); - } - catch (Exception ex) - { - MelonLogger.Warning($"[HexViewer] Probe failed: {ex.Message}"); - } - } - - public override void OnDeinitializeMelon() - { - HookBinder.Unregister("greg.PLAYER.InteractOnClick"); - HookBinder.Unregister("greg.UI.OnHoverOver"); - } -} -``` - -### Placeholder policy (mandatory) - -If `GregSystems.Physics` or `GregSystems.EntityManager` are not present in your current gregCore branch, do **not** replace them with direct Unity APIs. Instead add gregCore-compatible adapters: - -- `gregFramework.Core.Systems.GregPhysics` -- `gregFramework.Core.Systems.GregEntityManager` - -## Integration contract - -C# publishes the canonical payload; other language layers consume it: - -```text -C# target probe -> greg.HEXVIEWER.TargetUpdated -> Rust enrich -> TS render -> Lua filter profile -``` - -See companion pages: - -- `HexViewer in Rust` -- `HexViewer in TypeScript` -- `HexViewer in LUA` - -## Deploy and test in game - -Copy C# output: - -```powershell -Copy-Item .\csharp\bin\Release\net6.0\gregMod.HexViewer.dll "C:\Program Files (x86)\Steam\steamapps\common\Data Center\Mods\" -Force -``` - -Validation checklist: - -1. Game starts without loader exceptions. -2. `MelonLoader\Latest.log` contains `[HexViewer] Init`. -3. Hovering rack/cable/cablespinner triggers `greg.HEXVIEWER.TargetUpdated` events. -4. TS HUD updates top-center line accordingly. - -## Troubleshooting - -- No events: confirm hook names in your `greg_hooks.json`. -- No entity id: ensure object class is mapped in gregCore entity registry. -- No HUD update: verify TS listener subscribes to exact event name. - -## Build quality gates - -- Keep logic non-blocking and exception-safe. -- Use `HookBinder` and `GregEventDispatcher` only (no direct Unity API in mods). -- Ensure unload unregisters all hooks. - -- Data Center + MelonLoader installed -- `gregCore.dll` working in game `Mods/` -- .NET SDK 6.x installed -- Existing workspace with `gregCore/` checkout - -## 2) Create project - -Create `gregMod.HexViewer/gregMod.HexViewer.csproj`: - -```xml - - - net6.0 - latest - enable - - - - - ..\gregCore\framework\bin\Release\net6.0\gregCore.dll - - - ..\gregCore\lib\references\MelonLoader\MelonLoader.dll - - - -``` - -## 3) Implement the mod - -Create `HexViewerMod.cs`: - -```csharp -using System; -using MelonLoader; -using GregFramework.Hooks; - -namespace GregMod.HexViewer; - -public sealed class HexViewerMod : MelonMod -{ - private static readonly string[] HookCandidates = - { - "greg.UI.OnHoverOver", - "greg.SYSTEM.OnHoverOver", - "greg.PLAYER.InteractOnClick" - }; - - public override void OnInitializeMelon() - { - MelonLogger.Msg("[HexViewer] Initializing..."); - - foreach (var hook in HookCandidates) - { - HookBinder.OnAfter(hook, OnAfterHook); - } - - MelonLogger.Msg("[HexViewer] Hooks registered."); - } - - private static void OnAfterHook(HookContext ctx) - { - try - { - var instanceName = ctx.Instance?.GetType().Name ?? ""; - var instanceHash = ctx.Instance?.GetHashCode() ?? 0; - var hexId = $"0x{instanceHash:X8}"; - MelonLogger.Msg($"[HexViewer] Hook={ctx.HookName} Type={instanceName} Hex={hexId}"); - } - catch (Exception ex) - { - MelonLogger.Warning($"[HexViewer] Hook processing failed: {ex.Message}"); - } - } - - public override void OnDeinitializeMelon() - { - foreach (var hook in HookCandidates) - { - HookBinder.Unregister(hook); - } - - MelonLogger.Msg("[HexViewer] Hooks unregistered."); - } -} -``` - -## 4) Build - -```powershell -dotnet build .\gregMod.HexViewer\gregMod.HexViewer.csproj -c Release -``` - -Expected output DLL: - -- `gregMod.HexViewer\bin\Release\net6.0\gregMod.HexViewer.dll` - -## 5) Deploy to game - -Copy DLL to Data Center mods folder: - -```powershell -Copy-Item .\gregMod.HexViewer\bin\Release\net6.0\gregMod.HexViewer.dll "C:\Program Files (x86)\Steam\steamapps\common\Data Center\Mods\" -Force -``` - -## 6) Test in game - -1. Start game. -2. Open `MelonLoader\Latest.log`. -3. Hover/click rack/server/world objects. -4. Verify entries like: - -```text -[HexViewer] Hook=greg.UI.OnHoverOver Type=RackController Hex=0x01AF3B22 -``` - -## 7) Troubleshooting - -- No logs: ensure hook alias exists in hook catalog loaded by gregCore. -- Type missing: fallback to `ctx.Method.Name` and inspect `ctx.Arguments`. -- Crashes: keep all hook handlers wrapped in `try/catch`. - -## 8) Next improvements - -- Render on-screen UI instead of log-only output. -- Add config file to enable/disable selected hook groups. -- Map hex ID to domain labels (Rack/Server/Customer). - diff --git a/docs/02_development/tutorials/hexviewer-lua.md b/docs/02_development/tutorials/hexviewer-lua.md deleted file mode 100644 index 79906135..00000000 --- a/docs/02_development/tutorials/hexviewer-lua.md +++ /dev/null @@ -1,217 +0,0 @@ ---- -id: hexviewer-lua -title: HexViewer Mod Tutorial (Lua) -sidebar_label: HexViewer in LUA -slug: /development/tutorials/hexviewer-lua -description: Technical writing tutorial for the HexViewer Lua config and hook layer in gregCore. ---- - -This page implements the **Lua Config + Hook layer** for HexViewer. - -Role in architecture: - -- Register mod profile in gregCore registry -- Define target filters and thresholds -- Consume enriched events and apply display policy - -> Layer ownership: Lua runs in **Language Bridge layer** and only uses gregCore runtime APIs. - -## Introduction - -Lua determines whether a detected object should be shown in HUD output. - -Filtering criteria in this tutorial: - -- accepted object types: `Rack`, `Cable`, `CableSpinner` -- max distance threshold -- owner blacklist - -## Project structure (Lua segment) - -```text -gregMod.HexViewer/lua/ -├─ init.lua -├─ hexviewer_config.lua -└─ filters.lua -``` - -Deploy location: - -- `Data Center/Mods/ScriptMods/lua/hexviewer/` - -## Lua implementation - -`lua/hexviewer_config.lua`: - -```lua -local config = { - max_distance_m = 14.0, - allowed_types = { - Rack = true, - Cable = true, - CableSpinner = true - }, - owner_blacklist = { - ["Unknown"] = true - } -} - -return config -``` - -`lua/filters.lua`: - -```lua -local cfg = require("hexviewer.hexviewer_config") - -local M = {} - -function M.should_display(payload) - if not payload then return false end - - if not cfg.allowed_types[payload.entityType] then - return false - end - - if (payload.distanceMeters or 9999) > cfg.max_distance_m then - return false - end - - if cfg.owner_blacklist[payload.ownerName or ""] then - return false - end - - return true -end - -return M -``` - -`lua/init.lua`: - -```lua -local filters = require("hexviewer.filters") - --- gregCore-specific: mod registration in greg runtime registry -greg.registry.register_mod({ - id = "hexviewer.lua", - name = "HexViewer Lua Profile", - version = "1.0.0" -}) - --- gregCore-specific: subscribe to enriched cross-language payload event -greg.on("greg.HEXVIEWER.TargetEnriched", function(payload) - if not filters.should_display(payload) then - return - end - - greg.emit("greg.HEXVIEWER.TargetFiltered", payload) -end) - -greg.log("[HexViewer/Lua] Filter profile active") -``` - -## Placeholder policy - -If `greg.registry.register_mod` is not available in your current branch, do not replace it with custom global state. Keep a placeholder following greg naming conventions, for example: - -- `greg.Registry.RegisterMod` -- `greg.registry.register_mod` - -## Integration with C#/Rust/TS - -Event chain: - -1. C# emits `greg.HEXVIEWER.TargetUpdated` -2. Rust enriches and emits `greg.HEXVIEWER.TargetEnriched` -3. Lua filters and emits `greg.HEXVIEWER.TargetFiltered` -4. TypeScript HUD renders filtered payload - -## Deploy and test in game - -Copy Lua folder: - -```powershell -Copy-Item .\lua\* "C:\Program Files (x86)\Steam\steamapps\common\Data Center\Mods\ScriptMods\lua\hexviewer\" -Recurse -Force -``` - -Validation checklist: - -- Registry log confirms module registration -- Blacklisted owners are hidden -- Distance threshold limits output as configured - -## Troubleshooting - -- `require` fails: check folder/module naming (`hexviewer/...`). -- No filtering effect: ensure UI consumes `greg.HEXVIEWER.TargetFiltered` event. -- Nil payload fields: verify Rust enrichment event schema. - -## 1) Prerequisites - -- Data Center + MelonLoader + `gregCore.dll` -- Lua bridge enabled by your gregCore runtime -- Access to `Data Center/Mods/ScriptMods/lua/` - -## 2) Create mod folder - -Create: - -- `Data Center/Mods/ScriptMods/lua/hexviewer/init.lua` - -## 3) Implement HexViewer script - -```lua -local hooks = { - "greg.UI.OnHoverOver", - "greg.SYSTEM.OnHoverOver", - "greg.PLAYER.InteractOnClick" -} - -local function to_hex(num) - if num == nil then return "0x00000000" end - return string.format("0x%08X", tonumber(num) or 0) -end - -local function on_event(payload) - local method = payload and payload.method or "unknown" - local instance_handle = payload and payload.instance_handle or 0 - local hex = to_hex(instance_handle) - greg.log("[HexViewer/Lua] method=" .. tostring(method) .. " hex=" .. hex) -end - -for _, hook in ipairs(hooks) do - greg.on(hook, on_event) -end - -greg.log("[HexViewer/Lua] Registered " .. tostring(#hooks) .. " hooks") -``` - -## 4) Deploy - -No compile step required. Save file under Lua mods folder and start the game. - -## 5) Test in game - -1. Launch game. -2. Trigger hover/click interactions. -3. Check runtime log output for HexViewer lines. - -Expected line: - -```text -[HexViewer/Lua] method=OnHoverOver hex=0x00F1A22B -``` - -## 6) Troubleshooting - -- `greg` is nil: Lua bridge not loaded or wrong folder. -- No events: hook names differ in your catalog; test one known hook first. -- Performance issues: throttle logs (e.g. every 100ms). - -## 7) Next improvements - -- Add on-screen label via UI bridge API. -- Persist latest hovered hex in a Lua table for quick recall. -- Add command toggle (`/hexviewer on|off`) if your command bridge is enabled. - diff --git a/docs/02_development/tutorials/hexviewer-rust.md b/docs/02_development/tutorials/hexviewer-rust.md deleted file mode 100644 index 2638567a..00000000 --- a/docs/02_development/tutorials/hexviewer-rust.md +++ /dev/null @@ -1,245 +0,0 @@ ---- -id: hexviewer-rust -title: HexViewer Mod Tutorial (Rust) -sidebar_label: HexViewer in Rust -slug: /development/tutorials/hexviewer-rust -description: Technical writing tutorial for the HexViewer Rust data layer in gregCore, including FFI contract, pipeline, and game validation. ---- - -This page implements the **Rust Low-Level Data layer** for HexViewer. - -Role in architecture: - -- Input event from C#: `greg.HEXVIEWER.TargetUpdated` -- Rust enrichment: resolve color/owner metadata at low overhead -- Output event to UI: `greg.HEXVIEWER.TargetEnriched` - -> Layer ownership: Rust bridge is in **Language Bridge layer**, never direct Unity gameplay logic. - -## Introduction - -Rust is used for hot-path metadata operations where frequent target updates would otherwise allocate heavily on managed paths. - -## Project structure (Rust segment) - -```text -gregMod.HexViewer/rust/ -├─ Cargo.toml -├─ src/ -│ ├─ lib.rs -│ ├─ bridge.rs -│ └─ metadata.rs -└─ target/release/hexviewer_rust.dll -``` - -## FFI contract with gregCore - -Required exported functions: - -- `greg_mod_init` — register module and callbacks -- `greg_mod_shutdown` — release resources -- `greg_on_hexviewer_target_updated` — process event payload from C# - -If your current bridge uses different names, keep semantics and align naming with `greg.*` conventions. - -## Rust implementation - -`rust/Cargo.toml`: - -```toml -[package] -name = "hexviewer_rust" -version = "0.1.0" -edition = "2021" - -[lib] -crate-type = ["cdylib"] -``` - -`rust/src/lib.rs`: - -```rust -mod bridge; -mod metadata; - -use std::ffi::CStr; -use std::os::raw::c_char; - -#[no_mangle] -pub extern "C" fn greg_mod_init() { - // gregCore-specific: register this Rust module with the bridge runtime - bridge::register_module("hexviewer_rust"); -} - -#[no_mangle] -pub extern "C" fn greg_mod_shutdown() { - bridge::unregister_module("hexviewer_rust"); -} - -#[no_mangle] -pub extern "C" fn greg_on_hexviewer_target_updated( - entity_id: u64, - entity_type_ptr: *const c_char, -) { - let entity_type = unsafe { - if entity_type_ptr.is_null() { - "unknown" - } else { - CStr::from_ptr(entity_type_ptr).to_str().unwrap_or("unknown") - } - }; - - let meta = metadata::query_entity_metadata(entity_id, entity_type); - - // gregCore-specific: emit enriched event back to the shared event bus - bridge::emit_target_enriched( - entity_id, - entity_type, - &meta.color_hex, - &meta.owner_name, - ); -} -``` - -`rust/src/metadata.rs`: - -```rust -pub struct EntityMeta { - pub color_hex: String, - pub owner_name: String, -} - -pub fn query_entity_metadata(entity_id: u64, entity_type: &str) -> EntityMeta { - // gregCore-specific placeholder: - // Replace with gregCore::ffi metadata access when available in your branch. - // Do NOT replace with direct engine pointers outside gregCore bridge. - let _ = (entity_id, entity_type); - - EntityMeta { - color_hex: "#55AAFF".to_string(), - owner_name: "Unassigned".to_string(), - } -} -``` - -## Build pipeline - -```powershell -cargo build --manifest-path .\rust\Cargo.toml --release -``` - -Output: - -- `rust\target\release\hexviewer_rust.dll` - -## Integration with other languages - -Data flow: - -1. C# emits `greg.HEXVIEWER.TargetUpdated` -2. Rust callback receives entity id/type -3. Rust queries metadata and emits `greg.HEXVIEWER.TargetEnriched` -4. TypeScript HUD updates panel -5. Lua config filters what is displayed - -## Deploy and test - -```powershell -Copy-Item .\rust\target\release\hexviewer_rust.dll "C:\Program Files (x86)\Steam\steamapps\common\Data Center\Mods\RustMods\" -Force -``` - -Validation checklist: - -- Bridge logs module registration -- No FFI crashes on hover/click -- `TargetEnriched` events contain color/owner fields - -## Troubleshooting - -- DLL not loaded: check `cdylib`, exports, and architecture (x64). -- Invalid strings: always guard pointer conversion. -- Missing metadata API: keep placeholder layer in `metadata.rs` until gregCore binding exists. - -## 1) Prerequisites - -- `rustup` + stable toolchain -- Working gregCore Rust bridge (`RustLanguageBridgeAdapter`/FFI) -- Data Center game setup with `Mods/RustMods/` - -## 2) Create crate - -```powershell -cargo new hexviewer --lib -``` - -`Cargo.toml`: - -```toml -[package] -name = "hexviewer" -version = "0.1.0" -edition = "2021" - -[lib] -crate-type = ["cdylib"] -``` - -## 3) Implement event hook - -`src/lib.rs`: - -```rust -use std::ffi::c_char; - -#[no_mangle] -pub extern "C" fn greg_mod_init() { - // Register callback through your bridge-specific API. - // Example only: actual function names depend on bridge ABI. - println!("[HexViewer/Rust] init"); -} - -#[no_mangle] -pub extern "C" fn greg_on_event(event_name: *const c_char, instance_id: u64) { - // Convert pointers in your real bridge helper, then log a hex id: - let hex = format!("0x{:08X}", instance_id as u32); - let _ = event_name; - println!("[HexViewer/Rust] hex={}", hex); -} -``` - -## 4) Build - -```powershell -cargo build --release -``` - -Artifact example: - -- `target/release/hexviewer.dll` - -## 5) Deploy - -Copy binary to Rust mods folder: - -```powershell -Copy-Item .\target\release\hexviewer.dll "C:\Program Files (x86)\Steam\steamapps\common\Data Center\Mods\RustMods\" -Force -``` - -## 6) Test in game - -1. Start Data Center. -2. Ensure bridge logs module load success. -3. Hover/click objects and verify Rust log lines with hex IDs. - -## 7) Troubleshooting - -- Module not loaded: confirm `cdylib` target and exported symbols. -- No events: validate FFI callback signatures against bridge ABI. -- Invalid strings/panic: guard all FFI boundaries and avoid `unwrap()`. - -## 8) Next improvements - -- Parse payload structs for richer labels. -- Add in-game toggle via shared config file. -- Emit events to C# side for UI rendering. - diff --git a/docs/02_development/tutorials/hexviewer-ts.md b/docs/02_development/tutorials/hexviewer-ts.md deleted file mode 100644 index 1ec4e25e..00000000 --- a/docs/02_development/tutorials/hexviewer-ts.md +++ /dev/null @@ -1,242 +0,0 @@ ---- -id: hexviewer-ts -title: HexViewer Mod Tutorial (TypeScript) -sidebar_label: HexViewer in TypeScript -slug: /development/tutorials/hexviewer-ts -description: Technical writing tutorial for the HexViewer TypeScript HUD layer with gregCore.UI and event-driven binding. ---- - -This page implements the **TypeScript UI layer** of HexViewer. - -Goal: render a JADE-like panel at top center and bind it to enriched target events from gregCore. - -> Layer ownership: this page belongs to **Language Bridge UI layer** and consumes `greg.*` events only. - -## Introduction - -HexViewer HUD receives `greg.HEXVIEWER.TargetEnriched` payload and displays: - -- object type (`Rack`, `Cable`, `CableSpinner`) -- object id (hex) -- color -- owner/customer - -## Project structure (TS segment) - -```text -gregMod.HexViewer/ts/ -├─ package.json -├─ tsconfig.json -├─ src/ -│ ├─ hud.ts -│ ├─ events.ts -│ └─ bootstrap.ts -└─ dist/ - └─ hexviewer_hud.js -``` - -## UI implementation using gregCore.UI - -`ts/src/hud.ts`: - -```ts -type HexViewerPayload = { - entityId: number; - entityType: string; - colorHex: string; - ownerName: string; - distanceMeters?: number; -}; - -export function mountHexViewerHud(gregCore: { - UI: { - createPanel: (options: { - id: string; - anchor: 'TopCenter' | string; - width: number; - height: number; - title: string; - }) => { setText: (value: string) => void }; - }; - Events: { - on: (eventName: string, handler: (payload: HexViewerPayload) => void) => void; - }; -}): void { - // gregCore-specific: create HUD panel anchored to top center - const panel = gregCore.UI.createPanel({ - id: 'hexviewer.panel', - anchor: 'TopCenter', - width: 580, - height: 96, - title: 'HexViewer', - }); - - // gregCore-specific: subscribe to event bus for cross-language payloads - gregCore.Events.on('greg.HEXVIEWER.TargetEnriched', (payload) => { - const hexId = `0x${payload.entityId.toString(16).toUpperCase().padStart(8, '0')}`; - panel.setText( - `${payload.entityType} | ${hexId} | ${payload.colorHex} | ${payload.ownerName}`, - ); - }); -} -``` - -`ts/src/bootstrap.ts`: - -```ts -import { mountHexViewerHud } from './hud'; - -export function registerHexViewerUi(gregCore: unknown): void { - // gregCore-specific: bridge-level registration entrypoint - // If register function name differs in your branch, keep behavior and naming style. - mountHexViewerHud(gregCore as never); -} -``` - -## Build pipeline - -`ts/package.json`: - -```json -{ - "name": "hexviewer-ts", - "private": true, - "scripts": { - "build": "tsup src/bootstrap.ts --format iife --out-dir dist --global-name HexViewerUI" - }, - "devDependencies": { - "tsup": "^8.0.0", - "typescript": "^5.0.0" - } -} -``` - -Build command: - -```powershell -pnpm --dir .\ts install -pnpm --dir .\ts run build -``` - -## Integration contract - -TS does not query game objects directly. It only listens to `greg.HEXVIEWER.TargetEnriched` emitted by C# + Rust pipeline. - -If `gregCore.UI.createPanel` is unavailable in your branch, document a placeholder adapter in the same namespace: - -- `gregCore.UI.createPanel` (preferred) -- `gregCore.UI.renderPanel` (alternate naming convention) - -## Deploy and test - -Copy output bundle to your bridge plugin module folder. - -Validation checklist: - -1. UI layer initializes without errors. -2. Panel is visible at top center. -3. Hovering rack/cable updates text in real time. - -## Troubleshooting - -- Panel missing: verify bridge bootstrap registration. -- No updates: check exact event name `greg.HEXVIEWER.TargetEnriched`. -- Encoding issues: ensure UTF-8 output and no transpile runtime mismatch. - -## 1) Prerequisites - -- Node.js + package manager (`pnpm` or `npm`) -- A JS/TS bridge plugin in your gregCore stack -- Event transport from gregCore to TS (WebSocket, IPC, or bridge API) - -## 2) Initialize project - -```powershell -mkdir hexviewer-ts -cd hexviewer-ts -pnpm init -pnpm add -D typescript tsup -``` - -Create `tsconfig.json`: - -```json -{ - "compilerOptions": { - "target": "ES2020", - "module": "ESNext", - "strict": true, - "moduleResolution": "Bundler", - "outDir": "dist" - }, - "include": ["src"] -} -``` - -## 3) Implement HexViewer logic - -`src/index.ts`: - -```ts -type HookPayload = { - method?: string; - instance_handle?: number; -}; - -const HOOKS = [ - 'greg.UI.OnHoverOver', - 'greg.SYSTEM.OnHoverOver', - 'greg.PLAYER.InteractOnClick', -]; - -function toHex(value: number | undefined): string { - return `0x${(value ?? 0).toString(16).toUpperCase().padStart(8, '0')}`; -} - -function onHook(hookName: string, payload: HookPayload): void { - const method = payload.method ?? 'unknown'; - const hex = toHex(payload.instance_handle); - console.log(`[HexViewer/TS] hook=${hookName} method=${method} hex=${hex}`); -} - -export function registerHexViewer(gregBus: { - on: (hook: string, cb: (payload: HookPayload) => void) => void; -}): void { - for (const hook of HOOKS) { - gregBus.on(hook, (payload) => onHook(hook, payload)); - } -} -``` - -## 4) Build - -```powershell -pnpm tsup src/index.ts --format cjs --out-dir dist -``` - -## 5) Deploy to bridge - -Copy `dist/index.js` to your bridge/plugin module location (depends on plugin setup). Then restart game + bridge. - -## 6) Test in game - -1. Launch game and bridge process/plugin. -2. Trigger hover/click events. -3. Verify TS console/bridge logs: - -```text -[HexViewer/TS] hook=greg.UI.OnHoverOver method=OnHoverOver hex=0x00123FAB -``` - -## 7) Troubleshooting - -- No TS output: bridge did not load bundle path. -- No hooks: event subscription API mismatch between bridge and tutorial sample. -- Wrong payload shape: inspect raw payload and update `HookPayload` typing. - -## 8) Next improvements - -- Display hex value in an in-game HTML overlay. -- Add filter by domain (`UI`, `SYSTEM`, `PLAYER`). -- Add debounce to reduce spam. - diff --git a/docs/02_development/tutorials/hook-api/csharp.md b/docs/02_development/tutorials/hook-api/csharp.md deleted file mode 100644 index dddbc843..00000000 --- a/docs/02_development/tutorials/hook-api/csharp.md +++ /dev/null @@ -1,55 +0,0 @@ -# C# Hook API Tutorial - -In C# mods, you'll use the `gregCore.Sdk.IGregAPI` interface to interact with the Hook API. - -## Subscribing to a Hook - -To listen for an event, you'll use the `On` method in your `MelonMod`. - -```csharp -using gregCore.Sdk; -using gregCore.Sdk.Models; - -namespace MyCsharpMod; - -public class MyMod : MelonMod -{ - private IGregAPI _api; - - public override void OnInitializeMelon() - { - // Get the SDK API instance - _api = GregAPI.GetSdkApi(); - - // Subscribe to a hook - _api.On("greg.PLAYER.CoinChanged", OnCoinChanged); - } - - private void OnCoinChanged(GregPayload payload) - { - var amount = payload.GetValue("Amount"); - var total = payload.GetValue("Total"); - _api.LogInfo($"Money changed! Amount: {amount}, Total: {total}"); - } -} -``` - -## Firing a Hook - -To fire a custom event from your C# mod, use the `Fire` method. - -```csharp -// Fire a custom hook from C# -var payload = new GregPayload("greg.CUSTOM.MyEvent", "MyCsharpMod"); -payload.Data["foo"] = "bar"; -payload.Data["value"] = 42; - -_api.Fire("greg.CUSTOM.MyEvent", payload); -``` - -## Troubleshooting - -- Ensure your C# mod is a `MelonMod`. -- Reference the `gregCore.dll` and `gregCore.Sdk` namespaces. -- Use `GregAPI.GetSdkApi()` to get the API instance. -- Ensure the hook name starts with `greg.`. diff --git a/docs/02_development/tutorials/hook-api/go.md b/docs/02_development/tutorials/hook-api/go.md deleted file mode 100644 index 56d1f804..00000000 --- a/docs/02_development/tutorials/hook-api/go.md +++ /dev/null @@ -1,52 +0,0 @@ -# Go Hook API Tutorial - -In Go mods, you'll use the `greg-go` package (or raw FFI via the `GregCoreAPI` struct) to interact with the Hook API. - -## Subscribing to a Hook - -To listen for an event, you'll use the `greg_mod_init` entry point to register your callbacks. - -```go -// Example of a Go hook subscription -//export onHookCallback -func onHookCallback(hookName, trigger, jsonData *C.char) { - hookNameStr := C.GoString(hookName) - triggerStr := C.GoString(trigger) - jsonDataStr := C.GoString(jsonData) - - fmt.Printf("Hook received: %s (Trigger: %s) - Data: %s\n", hookNameStr, triggerStr, jsonDataStr) -} - -//export greg_mod_init -func greg_mod_init(api *GregCoreAPI) bool { - // Subscribe to a hook - hookName := C.CString("greg.PLAYER.CoinChanged") - defer C.free(unsafe.Pointer(hookName)) - - api.OnHook(hookName, (unsafe.Pointer)(C.onHookCallback)) - - return true -} -``` - -## Firing a Hook - -To fire a custom event from your Go mod, use the `FireHook` function pointer in the `GregCoreAPI` struct. - -```go -// Fire a custom hook from Go -hookName := C.CString("greg.CUSTOM.MyEvent") -defer C.free(unsafe.Pointer(hookName)) - -jsonData := C.CString(`{"foo": "bar", "value": 42}`) -defer C.free(unsafe.Pointer(jsonData)) - -api.FireHook(hookName, jsonData) -``` - -## Troubleshooting - -- Ensure your Go DLL is located in `Plugins/Go/`. -- Your Go mod must export `greg_mod_info` and `greg_mod_init`. -- Use the `greg-go` package for a more ergonomic API. -- Ensure the hook name starts with `greg.`. diff --git a/docs/02_development/tutorials/hook-api/intro.md b/docs/02_development/tutorials/hook-api/intro.md deleted file mode 100644 index b517c026..00000000 --- a/docs/02_development/tutorials/hook-api/intro.md +++ /dev/null @@ -1,29 +0,0 @@ -# gregCore Hook API Tutorial - -The gregCore Hook API is a powerful, event-driven system that allows mods to interact with the game in real-time. It is designed to be cross-language, stable, and easy to use. - -## Core Concepts - -- **Hook Name**: A string that identifies the hook, following the schema `greg.DOMAIN.Class.Method` (e.g., `greg.PLAYER.CoinChanged`). -- **Trigger**: When the hook is fired (e.g., "NativePatch", "LuaMod"). -- **Payload**: A standardized data object containing `hook_name`, `trigger`, and a `data` dictionary. - -## Supported Languages - -Click on a language to view its specific tutorial: - -- [C# Tutorial](./csharp.md) -- [Lua Tutorial](./lua.md) -- [Python Tutorial](./python.md) -- [Rust Tutorial](./rust.md) -- [Go Tutorial](./go.md) -- [JavaScript/TypeScript Tutorial](./javascript.md) - -## Common Hook List - -You can find the full list of 1771 available hooks in the [Hooks Catalog](../../api-reference/hooks-catalog.md). - -### Example Hooks: -- `greg.PLAYER.CoinChanged`: Fired when the player's money changes. -- `greg.SYSTEM.GameSaved`: Fired when the game is saved. -- `greg.UI.PauseMenu.Opened`: Fired when the pause menu is opened. diff --git a/docs/02_development/tutorials/hook-api/javascript.md b/docs/02_development/tutorials/hook-api/javascript.md deleted file mode 100644 index 6ecdbea0..00000000 --- a/docs/02_development/tutorials/hook-api/javascript.md +++ /dev/null @@ -1,38 +0,0 @@ -# JavaScript/TypeScript Hook API Tutorial - -In JS mods, the `greg` global object is automatically provided to interact with the gregCore Hook API. - -## Subscribing to a Hook - -To listen for an event, use `greg.on(hookName, callback)`. - -```javascript -// Register a mod -greg.logInfo("My JS Mod initializing..."); - -// Subscribe to the player's coin changed hook -greg.on("greg.PLAYER.CoinChanged", (payload) => { - const amount = payload.Data.Amount; - const total = payload.Data.Total; - greg.logInfo(`Money changed! Amount: ${amount}, Total: ${total}`); -}); -``` - -## Firing a Hook - -To fire a custom event from your JS mod, use `greg.fire(hookName, dataObject)`. - -```javascript -// Fire a custom hook from JS -greg.fire("greg.CUSTOM.MyEvent", { - foo: "bar", - value: 42 -}); -``` - -## Troubleshooting - -- Ensure your JS file is located in `Plugins/Js/`. -- Check the `MelonLoader` console for any JS errors or log messages from `JsBridge`. -- Ensure the hook name starts with `greg.`. -- Use Jint for a performant JS engine. diff --git a/docs/02_development/tutorials/hook-api/lua.md b/docs/02_development/tutorials/hook-api/lua.md deleted file mode 100644 index cea5458c..00000000 --- a/docs/02_development/tutorials/hook-api/lua.md +++ /dev/null @@ -1,37 +0,0 @@ -# Lua Hook API Tutorial - -In Lua mods, the `greg` global object is automatically provided to interact with the gregCore Hook API. - -## Subscribing to a Hook - -To listen for an event, use `greg.on(hookName, callback)`. - -```lua --- Register a mod -greg.log_info("My Lua Mod initializing...") - --- Subscribe to the player's coin changed hook -greg.on("greg.PLAYER.CoinChanged", function(payload) - local amount = payload.data["Amount"] - local total = payload.data["Total"] - greg.log_info("Money changed! Amount: " .. tostring(amount) .. ", Total: " .. tostring(total)) -end) -``` - -## Firing a Hook - -To fire a custom event from your Lua mod, use `greg.fire(hookName, dataTable)`. - -```lua --- Fire a custom hook -greg.fire("greg.CUSTOM.MyEvent", { - foo = "bar", - value = 42 -}) -``` - -## Troubleshooting - -- Ensure your `main.lua` file is located in `Plugins/Lua//`. -- Check the `MelonLoader` console for any Lua errors or log messages from `LuaFFIBridge`. -- Ensure the hook name starts with `greg.`. diff --git a/docs/02_development/tutorials/hook-api/python.md b/docs/02_development/tutorials/hook-api/python.md deleted file mode 100644 index cfd3a110..00000000 --- a/docs/02_development/tutorials/hook-api/python.md +++ /dev/null @@ -1,40 +0,0 @@ -# Python Hook API Tutorial - -In Python mods, the `greg` global object is automatically provided to interact with the gregCore Hook API. - -## Subscribing to a Hook - -To listen for an event, use `greg.on(hookName, callback)`. - -```python -# My Python Mod initializing... -greg.log_info("My Python Mod initializing...") - -# Define a callback function -def on_coin_changed(payload): - amount = payload["data"]["Amount"] - total = payload["data"]["Total"] - greg.log_info(f"Money changed! Amount: {amount}, Total: {total}") - -# Subscribe to the player's coin changed hook -greg.on("greg.PLAYER.CoinChanged", on_coin_changed) -``` - -## Firing a Hook - -To fire a custom event from your Python mod, use `greg.fire(hookName, dataDict)`. - -```python -# Fire a custom hook -greg.fire("greg.CUSTOM.MyEvent", { - "foo": "bar", - "value": 42 -}) -``` - -## Troubleshooting - -- Ensure your `main.py` file is located in `Plugins/Python//`. -- Check the `MelonLoader` console for any Python errors or log messages from `PythonFFIBridge`. -- Ensure the hook name starts with `greg.`. -- Make sure `python310.dll` is available (configurable in `gregCore` config). diff --git a/docs/02_development/tutorials/hook-api/rust.md b/docs/02_development/tutorials/hook-api/rust.md deleted file mode 100644 index 2ed2c903..00000000 --- a/docs/02_development/tutorials/hook-api/rust.md +++ /dev/null @@ -1,47 +0,0 @@ -# Rust Hook API Tutorial - -In Rust mods, you'll use the `greg-rs` crate (or raw FFI via the `GregCoreAPI` struct) to interact with the Hook API. - -## Subscribing to a Hook - -To listen for an event, you'll use the `greg_mod_init` entry point to register your callbacks. - -```rust -// Example of a Rust hook subscription -extern "C" fn on_hook_callback(hook_name: *const i8, trigger: *const i8, json_data: *const i8) { - let hook_name = unsafe { CStr::from_ptr(hook_name).to_string_lossy() }; - let trigger = unsafe { CStr::from_ptr(trigger).to_string_lossy() }; - let json_data = unsafe { CStr::from_ptr(json_data).to_string_lossy() }; - - println!("Hook received: {} (Trigger: {}) - Data: {}", hook_name, trigger, json_data); -} - -#[no_mangle] -pub extern "C" fn greg_mod_init(api: *const GregCoreAPI) -> bool { - let api = unsafe { &*api }; - - // Subscribe to a hook - let hook_name = CString::new("greg.PLAYER.CoinChanged").unwrap(); - (api.on_hook)(hook_name.as_ptr(), on_hook_callback as *const ()); - - true -} -``` - -## Firing a Hook - -To fire a custom event from your Rust mod, use the `fire_hook` function pointer in the `GregCoreAPI` struct. - -```rust -// Fire a custom hook from Rust -let hook_name = CString::new("greg.CUSTOM.MyEvent").unwrap(); -let json_data = CString::new(r#"{"foo": "bar", "value": 42}"#).unwrap(); -(api.fire_hook)(hook_name.as_ptr(), json_data.as_ptr()); -``` - -## Troubleshooting - -- Ensure your Rust DLL is located in `Plugins/Rust/`. -- Your Rust mod must export `greg_mod_info` and `greg_mod_init`. -- Use the `greg-rs` crate for a more ergonomic API. -- Ensure the hook name starts with `greg.`. diff --git a/docs/03_design-system/_category_.json b/docs/03_design-system/_category_.json deleted file mode 100644 index 17323cd3..00000000 --- a/docs/03_design-system/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 3, - "label": "?? Design System" -} - diff --git a/docs/03_design-system/visual-philosophy.md b/docs/03_design-system/visual-philosophy.md deleted file mode 100644 index 3b7d32ec..00000000 --- a/docs/03_design-system/visual-philosophy.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -sidebar_label: Luminescent design system -description: Visual and interaction guidelines for the docs site (Luminescent Architect). ---- - -The **gregCore Mod Framework** (greg) is the product name for all Docusaurus branding (site title, navbar, page titles). **Luminescent Architect** names this visual design system only. - -# Design System Specification: The Luminescent Architect - -## 1. Overview & Creative North Star - -**The Creative North Star: "The Luminescent Architect"** -This design system moves away from the "flat-and-boxy" utility of standard modding sites. It treats code and community interaction as an architectural feat. We achieve a high-end editorial feel through **Tonal Depth** and **Intentional Asymmetry**. Instead of rigid grids that feel like a spreadsheet, we use overlapping layers and "light-bleed" to guide the users eye. The goal is a digital environment that feels like a high-end laboratory: sterile, precise, yet pulsing with the energy of the teal primary accent. - -## 2. Color & Atmospheric Theory - -We do not use color simply to decorate; we use it to define space. - -### The "No-Line" Rule - -**Explicit Instruction:** Prohibit 1px solid borders for sectioning. -Boundaries are defined solely through background color shifts. For example, a `surface-container-low` section sitting on a `surface` background creates a natural edge. This "Editorial Bleed" makes the interface feel expansive and premium rather than boxed-in. - -### Surface Hierarchy & Nesting - -Treat the UI as physical layers of "Synthetic Glass." - -- **Layer 0 (Base):** `surface` (#001110) - The deep abyss. -- **Layer 1 (Sub-sections):** `surface-container-low` (#001715). -- **Layer 2 (Cards/Containers):** `surface-container` (#001E1C). -- **Layer 3 (Modals/Popovers):** `surface-container-high` (#002422). - -### The Glass & Gradient Rule - -Floating elements (Navigation, Tooltips) must use **Glassmorphism**. - -- **Formula:** `surface-container` at 80% opacity + `backdrop-filter: blur(12px)`. -- **Signature Texture:** Primary CTAs must utilize a subtle linear gradient from `primary` (#61F4D8) to `primary-container` (#08C1A6) at a 135-degree angle. This prevents "flatness" and gives the button a machined, metallic quality. - -Implementation reference: `wiki/src/css/custom.css` (`@theme` tokens, `.btn-primary`, `.glass-card`, `.navbar`). - -## 3. Typography: The Editorial Edge - -The contrast between the technical precision of **Inter** and the geometric authority of **Space Grotesk** defines the brand. - -- **Display & Headlines (Space Grotesk):** Use these for hero sections and documentation titles. High-contrast and slightly wider tracking (+2%) creates an authoritative, "tech-brochure" aesthetic. Tailwind / utility: `font-headline`. -- **Body & Labels (Inter):** Reserved for technical data and long-form wiki content. Inters tall x-height ensures readability against the dark `background`. Default body uses `font-sans`. -- **Code Blocks:** Must use a monospaced font (JetBrains Mono) nested in `surface-container-highest` to differentiate logic from documentation. Utility: `font-mono` / Infima monospace variables. - -## 4. Elevation & Depth - -We abandon the traditional drop-shadow. Depth is achieved via **Tonal Layering**. - -- **The Layering Principle:** To lift a card, place a `surface-container-lowest` card inside a `surface-container-low` section. The "inverse lift" creates a sophisticated, recessed look. -- **Ambient Glows:** For "floating" primary elements, use a shadow with the color `primary` at 10% opacity, a blur of `32px`, and a spread of `-4px`. This mimics the glow of a physical LED. -- **The Ghost Border Fallback:** If a border is required for accessibility, use the `outline-variant` token at **15% opacity**. This creates a "suggestion" of a line that disappears into the background. - -## 5. Component Architecture - -### Buttons: The Kinetic Core - -- **Primary:** Gradient fill (`primary` to `primary-container`), `on-primary` text. Add a 2px outer glow of `primary` on hover. -- **Secondary (Outlined):** No fill. A "Ghost Border" of `outline-variant` at 40%. On hover, the border opacity jumps to 100%. -- **Tertiary:** Pure text in `secondary`. Used for low-priority actions in the Sidebar. - -### Navigation: Structural Fixed Points - -- **Top Bar (Global):** Height: 72px. Background: `surface` (80% opacity) with `backdrop-blur`. No bottom border; use a subtle transition to `surface-container-low` for the content area. -- **Wiki Sidebar (Contextual):** Sticky position. Uses `surface-container-low`. Active links use a left-aligned 4px vertical pill in `primary` and high-contrast `on-surface` text. - -### Cards & Information Architecture - -- **Rule:** Forbid divider lines within cards. -- **Implementation:** Use 24px vertical padding (from the spacing scale) to separate the header from the body. Use `surface-variant` for metadata badges (e.g., "v1.2.0") to provide a "recessed" look. - -### Code Blocks & Documentation - -- **Container:** `surface-container-highest` with a `md` (0.75rem) corner radius. -- **Syntax Highlighting:** Use `tertiary` (#64D0FF) for functions, `secondary` (#1CEDE1) for strings, and `error_dim` (#D7383B) for keywords. - -## 6. Dos and Donts - -### Do: - -- **Do** use `primary_fixed_dim` for icons to ensure they don't overpower the text. -- **Do** allow for generous "negative space." High-end editorial design requires breathing room to feel premium. -- **Do** use `surface_bright` as a very subtle "top-light" gradient on large containers to simulate overhead lighting. - -### Dont: - -- **Dont** use pure white (#FFFFFF) for text. Always use `on_surface` (#C0FCF6) to reduce eye strain in dark mode. -- **Dont** use 1px solid borders to separate sidebar items; use vertical spacing or a subtle background hover state. -- **Dont** use standard "drop shadows" (Black/Grey). Always tint your shadows with the background or accent color to maintain tonal harmony. - -## 7. Token map (implementation) - -Semantic colors are defined as Tailwind v4 `@theme` variables in `wiki/src/css/custom.css` (e.g. `--color-primary`, `--color-on-surface`, `--color-surface-container-low`). Prefer those utilities in React pages (`bg-background`, `text-on-surface`, `border-outline-variant/15`) so the site stays aligned with this spec. - - diff --git a/docs/04_community/_category_.json b/docs/04_community/_category_.json deleted file mode 100644 index 3fb355d0..00000000 --- a/docs/04_community/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 4, - "label": "?? Community" -} - diff --git a/docs/04_community/contributing.md b/docs/04_community/contributing.md deleted file mode 100644 index a1537f31..00000000 --- a/docs/04_community/contributing.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -id: docusaurus-workflow -title: Docusaurus Contributor Workflow -slug: /contributors/docusaurus-workflow ---- - -## Local workflow - -Markdown and MDX live in the repo-root `docs/` folder. The Docusaurus app is in `wiki/`. - -```bash -cd wiki -npm install -npm run start -``` - -## Build workflow - -```bash -cd wiki -npm run build -npm run serve -``` - -## Can we hide Docusaurus build stuff from non-contributors? - -Short answer for a **public repo**: **not fully**. - -What you can do: - -- Keep generated output (`build/`, `.docusaurus/`, `node_modules/`) out of Git using `.gitignore`. -- Put docs tooling under `wiki/` so core runtime contributors can ignore it; content stays in `docs/`. -- Use path-based CODEOWNERS to limit review noise. -- Trigger docs CI on `docs/**` and `wiki/**` changes. - -What you cannot do in a public repo: - -- Fully hide tracked source files from non-contributors. - -If you need true visibility restriction, use a private repo/submodule for docs infra. - - diff --git a/docs/04_community/framework-addons.md b/docs/04_community/framework-addons.md deleted file mode 100644 index ee72851d..00000000 --- a/docs/04_community/framework-addons.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -id: framework-addons -title: Framework Addons -sidebar_label: Framework Addons -slug: /community/framework-addons -description: Extension guide for gregCore framework addons, including install locations, load order, and validation steps. ---- - -Framework Addons are framework-level extensions that extend gregCore behavior without modifying the core runtime directly. - -Typical addon categories: - -- Additional hook providers -- Language bridge extensions -- Diagnostics and tooling modules -- Runtime integration helpers - -## Where to install addons - -Use the addon binary type to choose the correct location. - -### Managed addons (`.dll`, C# / MelonLoader) - -Install path: - -- `Data Center/Mods/` - -Examples: - -- `greg.Plugin.AssetExporter.dll` -- `greg.Plugin.Multiplayer.dll` -- `greg.Plugin.WebUIBridge.dll` - -### Native addons (`.dll` / `.so`, Rust bridge modules) - -Install path: - -- `Data Center/Mods/RustMods/` - -Use this path only for native bridge modules exposed through the gregCore Rust runtime. - -## Installation procedure - -1. Stop the game completely. -2. Copy addon files to the correct folder. -3. Start the game. -4. Open `MelonLoader/Latest.log` and verify addon load events. - -Recommended PowerShell examples: - -```powershell -Copy-Item .\greg.Plugin.AssetExporter.dll "C:\Program Files (x86)\Steam\steamapps\common\Data Center\Mods\" -Force -Copy-Item .\hexviewer_rust.dll "C:\Program Files (x86)\Steam\steamapps\common\Data Center\Mods\RustMods\" -Force -``` - -## Load order and compatibility - -- gregCore must initialize before dependent addons. -- Addons should fail soft (log warning, keep game running). -- Addons must not directly patch unrelated systems outside their declared scope. - -If an addon depends on another addon, verify dependency order in `Latest.log` and document it in the addon README. - -## How to validate a successful install - -Checklist: - -- Addon appears in `MelonLoader/Latest.log` without exception traces. -- Hook subscriptions are registered (if addon is event-driven). -- No repeated startup retries or null-reference loops. -- Addon behavior is visible in-game (feature-specific smoke test). - -## Uninstall / rollback - -1. Exit the game. -2. Remove addon binaries from `Mods/` or `RustMods/`. -3. Restart game and verify logs are clean. - -## Best practices for addon authors - -- Keep addon API surface aligned with `greg.*` naming conventions. -- Use `GregEventDispatcher` rather than direct cross-mod coupling. -- Guard all critical runtime paths with error handling. -- Log clear startup/shutdown messages for support diagnostics. - diff --git a/docs/04_community/mod-index.md b/docs/04_community/mod-index.md deleted file mode 100644 index 9b3f4ee6..00000000 --- a/docs/04_community/mod-index.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Mod Index -sidebar_label: Mod Index ---- -# Mod Index - -| Title | Version | Author | Link | -|---|---|---|---| -| greg HexLabel Mod | 00.01.0009 | mleem97 | [Workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=3701404621) | -| greg Console Input Guard | 00.01.0001 | mleem97 | N/A | -| greg Gregify Employees | 00.01.0009 | mleem97 | N/A | -| greg JoniML Compat Mod | 00.01.0009 | mleem97 | N/A | - - - - diff --git a/docs/05_legal/_category_.json b/docs/05_legal/_category_.json deleted file mode 100644 index 36b0a919..00000000 --- a/docs/05_legal/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 5, - "label": "?? Legal" -} - diff --git a/docs/05_legal/sponsors.md b/docs/05_legal/sponsors.md deleted file mode 100644 index 432f64a3..00000000 --- a/docs/05_legal/sponsors.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: Sponsors -sidebar_label: Sponsors ---- -# Sponsors - -Thank you for supporting the GregFramework ecosystem. - -## Top Sponsor (VIP) - -- **?? The Ecosystem Architect ($50/month):** [@tobiasreichel](https://github.com/tobiasreichel) - -Premium benefits currently assigned: - -- Top sponsor placement on ecosystem-facing surfaces (Wiki front page + Mod Store footer) -- Private 1-on-1 Discord lounge -- Featured mod spotlight option - -## Sponsorship Tiers - -### ? $1 / month The Coffee Supporter - -- GitHub sponsor badge -- Discord `Supporter` role -- Eternal gratitude - -### ?? $5 / month Bronze Backer (Active Player) - -Includes all previous perks, plus: - -- Credits entry in GregTools Mod Manager (`Special Thanks / Sponsors`) -- Access to sponsor-only Discord chat for spoilers/WIP/dev updates - -### ?? $15 / month Silver Tester (Early Access) - -Includes all previous perks, plus: - -- Early access to pre-release and beta builds -- Roadmap voting access for Silver+ backers - -### ?? $25 / month Gold Developer (Pro Modder) - -Includes all previous perks, plus: - -- Priority handling for framework bug reports -- Official Gold sponsor mention in repository `README.md` - -### ?? $50 / month The Ecosystem Architect (Premium/VIP) - -Includes all previous perks, plus: - -- Top sponsor placement on Wiki front page and Mod Store footer -- Private 1-on-1 Discord lounge -- Featured mod spot on `datacentermods.com` - -## Automation - -Use a repository workflow file at `.github/workflows/sponsor-tier-sync.yml` to export current sponsor tiers and drive Discord/website sync jobs. - - - diff --git a/docs/EXTENDING_gregCore.md b/docs/EXTENDING_gregCore.md deleted file mode 100644 index a39a0545..00000000 --- a/docs/EXTENDING_gregCore.md +++ /dev/null @@ -1,338 +0,0 @@ ---- -id: extending-gregcore -title: EXTENDING gregCore -slug: /reference/extending-gregcore -description: Framework extension tutorial for adding hooks, payload parsers, plugins, and Harmony patches in gregCore. ---- - -## 1. Introduction - -Framework extensions are changes inside `gregCore` that expand the SDK/runtime capabilities for all mods and plugins. - -Why extend instead of fork: - -- Lower maintenance overhead across releases -- Better version compatibility for plugin authors -- Clear architecture boundaries (`Sdk`, `ModLoader`, `harmony`, `plugins`) - -Prerequisites: - -- Visual Studio 2022 (or `dotnet` CLI) -- .NET 6 SDK -- MelonLoader reference assemblies in `gregCore/lib/references/` - ---- - -## 2. Framework structure overview - -```text -gregCore/ -├─ framework/ -│ ├─ Sdk/ -│ │ ├─ GregNativeEventHooks.cs -│ │ ├─ GregEventDispatcher.cs -│ │ └─ GregPayload.cs -│ ├─ ModLoader/ -│ ├─ harmony/ -│ ├─ Main.cs -│ └─ gregCore.csproj -├─ plugins/ -│ └─ greg.Plugin./ -├─ Templates/ -│ ├─ greg.PluginTemplate/ -│ └─ greg.BasedModTemplate/ -└─ gregCore.sln -``` - -Extension ownership: - -- `framework/Sdk/`: public API surfaces (`gregFramework.Core` namespace) -- `framework/ModLoader/`: runtime loading and integration plumbing -- `framework/harmony/`: game interception via Harmony patches -- `plugins/`: feature modules using SDK APIs - ---- - -## 3. Extension #1: Add a new hook constant - -Target file: - -- `framework/Sdk/GregNativeEventHooks.cs` - -### Step-by-step - -1. Add a new canonical hook string constant. -2. Map event ID to hook in `ByEventId` lookup. -3. Rebuild and test subscription from a plugin/mod. - -### Before - -```csharp -namespace gregFramework.Core; - -public static class GregNativeEventHooks -{ - public const string NetworkCreateNewCable = "greg.NETWORK.CreateNewCable"; -} -``` - -### After - -```csharp -namespace gregFramework.Core; - -public static class GregNativeEventHooks -{ - public const string NetworkCreateNewCable = "greg.NETWORK.CreateNewCable"; - public const string CableColorChanged = "greg.NETWORK.ColorChanged"; - - private static readonly Dictionary ByEventId = new() - { - { (uint)EventIds.CableCreated, NetworkCreateNewCable }, - { (uint)EventIds.NewEventId, CableColorChanged } - }; -} -``` - -### Subscription test - -```csharp -using gregFramework.Core; - -GregEventDispatcher.On( - GregNativeEventHooks.CableColorChanged, - payload => { - var dump = GregPayload.Dump(payload); - MelonLoader.MelonLogger.Msg($"CableColorChanged => {dump}"); - }, - "CableInspector" -); -``` - ---- - -## 4. Extension #2: Add a new payload parser - -Target file: - -- `framework/Sdk/GregPayload.cs` - -Goal: add an explicit parser helper for color payload fields. - -### Before - -```csharp -namespace gregFramework.Core; - -public static class GregPayload -{ - public static T Get(object payload, string fieldName, T fallback) - { - // existing implementation - return fallback; - } -} -``` - -### After - -```csharp -using UnityEngine; - -namespace gregFramework.Core; - -public static class GregPayload -{ - public static T Get(object payload, string fieldName, T fallback) - { - // existing implementation - return fallback; - } - - public static Color GetColor(object payload, string fieldName, Color fallback) - { - var raw = Get(payload, fieldName, string.Empty); - if (string.IsNullOrWhiteSpace(raw)) - { - return fallback; - } - - return ColorUtility.TryParseHtmlString(raw, out var parsed) - ? parsed - : fallback; - } -} -``` - -### Integration usage - -```csharp -var cableColor = GregPayload.GetColor(payload, "CableColor", Color.white); -``` - ---- - -## 5. Extension #3: Create a new plugin project - -Target structure: - -```text -plugins/greg.Plugin.CableInspector/ -├─ greg.Plugin.CableInspector.csproj -├─ Main.cs -└─ CableInspector.cs -``` - -Use `Templates/greg.PluginTemplate/` as baseline. - -### `greg.Plugin.CableInspector.csproj` - -```xml - - - net6.0 - latest - - - - - - -``` - -### `Main.cs` - -```csharp -using MelonLoader; -using gregFramework.Core; - -[assembly: MelonInfo(typeof(greg.Plugin.CableInspector.Main), "CableInspector", "00.01.0001", "teamGreg")] -[assembly: MelonGame("Waseku", "Data Center")] - -namespace greg.Plugin.CableInspector; - -public sealed class Main : MelonMod -{ - public override void OnInitializeMelon() - { - GregEventDispatcher.On( - GregNativeEventHooks.NetworkCreateNewCable, - payload => MelonLogger.Msg(GregPayload.Dump(payload)), - "CableInspector" - ); - } - - public override void OnApplicationQuit() - { - GregEventDispatcher.UnregisterAll("CableInspector"); - } -} -``` - ---- - -## 6. Extension #4: Add a Harmony patch - -Target file: - -- `framework/harmony/NewPatches.cs` - -```csharp -using HarmonyLib; -using gregFramework.Core; - -namespace gregFramework.Harmony; - -public static class NewPatches -{ - public static void Apply(Harmony harmony) - { - var targetType = AccessTools.TypeByName("CableManager"); - var targetMethod = AccessTools.Method(targetType, "SetColor"); - var postfix = AccessTools.Method(typeof(NewPatches), nameof(SetColorPostfix)); - - if (targetMethod != null && postfix != null) - { - harmony.Patch(targetMethod, postfix: new HarmonyMethod(postfix)); - } - } - - private static void SetColorPostfix(object __instance) - { - GregEventDispatcher.Emit(GregNativeEventHooks.CableColorChanged, new - { - Source = __instance?.GetType().Name ?? "unknown" - }); - } -} -``` - ---- - -## 7. Build and deploy - -```bash -dotnet restore gregCore.sln -dotnet build gregCore.sln --configuration Release -``` - -Copy outputs: - -- `framework/bin/Release/net6.0/gregCore.dll` -> `Data Center/Mods/` -- `plugins/*/bin/Release/net6.0/*.dll` -> `Data Center/Mods/` - -Validation: - -- Launch game -- Inspect `MelonLoader/Latest.log` -- Confirm hook registrations and no startup exceptions - ---- - -## 8. Best practices - -- Use semantic versioning for newly introduced hooks. -- Keep backward compatibility via `GregCompatBridge` mappings. -- Document every new hook constant with clear event origin. -- Extend tests in `framework/gregCore.Tests/` for parser and dispatcher changes. -- Prefer additive API changes over signature-breaking edits. - ---- - -## 9. Common issues and troubleshooting - -- **`Core.Instance is null`**: framework bootstrap not ready; defer logic to next update tick. -- **`EventId not mapped`**: update `GregNativeEventHooks` event ID mapping table. -- **Build failures on references**: refresh MelonLoader references under `lib/references/` (for example via `tools/refresh_refs.py` in the gregCore repository). -- **No event callbacks**: verify `GregEventDispatcher.On(...)` uses canonical `greg.*` hook names. - ---- - -## MISSING.md rule (required for absent abstractions) - -If an extension depends on a non-existing abstraction (example: `IModExtension`), create `MISSING.md` in the affected folder. - -Required content: - -1. Missing API signature -2. Intended file/folder for implementation -3. Runtime compatibility impact (`ModLoader`, `plugins`, `runtime`) -4. greg-style pseudo code - -Example: - -```markdown -# MISSING API: IModExtension - -- Signature: - - `public interface IModExtension { void Initialize(); void Shutdown(); }` -- Target location: - - `framework/ModLoader/IModExtension.cs` -- Impact: - - Plugin load lifecycle and dependency registration -- Pseudo code: - - `ModLoader.RegisterExtension(IModExtension extension)` -``` - -This rule prevents undocumented ad-hoc APIs and keeps extensions compatible with the core architecture. - diff --git a/docs/MODDING_MelonLoader_gregCore.md b/docs/MODDING_MelonLoader_gregCore.md deleted file mode 100644 index 5001e05c..00000000 --- a/docs/MODDING_MelonLoader_gregCore.md +++ /dev/null @@ -1,320 +0,0 @@ ---- -id: modding-melonloader-gregcore -title: MelonLoader + gregCore Modding Tutorial -slug: /guides/modding-melonloader-gregcore -description: Beginner tutorial for building a first Data Center mod with MelonLoader and gregCore. ---- - -## 1. Prerequisites (5 min) - -Before you start, make sure the full toolchain is ready: - -- ✅ Visual Studio 2022 Community -- ✅ .NET 6 SDK -- ✅ Data Center (Steam) -- ✅ MelonLoader installer -- ✅ `gregCore.dll` (Release artifact or local build) - -Recommended quick checks: - -```powershell -dotnet --version -``` - -```powershell -Test-Path "C:\Program Files (x86)\Steam\steamapps\common\Data Center" -``` - ---- - -## 2. MelonLoader installation (5 min) - -1. Run `MelonLoader-Installer.exe`. -2. Select the `Data Center` game folder. -3. Complete installation. -4. Copy `gregCore.dll` to `Data Center/Mods/`. -5. Start game once and verify log output. - -[image:1] - -Expected verification file: - -- `Data Center/MelonLoader/Latest.log` - ---- - -## 3. First standalone mod (10 min) - -Create a beginner template folder in your repo/workspace: - -```text -Templates/ -└── MyFirstDataCenterMod/ - ├── MyFirstDataCenterMod.csproj - ├── Main.cs - └── README.md -``` - -### 3.1 `MyFirstDataCenterMod.csproj` - -```xml - - - net6.0 - latest - enable - - - - - ..\..\lib\references\MelonLoader\MelonLoader.dll - - - ..\..\lib\references\MelonLoader\net6\UnityEngine.CoreModule.dll - - - ..\..\lib\references\MelonLoader\net6\UnityEngine.IMGUIModule.dll - - - -``` - -### 3.2 `Main.cs` (standalone MelonLoader) - -```csharp -using MelonLoader; -using UnityEngine; - -[assembly: MelonInfo(typeof(MyFirstDataCenterMod.Main), "MyFirstDataCenterMod", "1.0.0", "teamGreg")] -[assembly: MelonGame("Waseku", "Data Center")] - -namespace MyFirstDataCenterMod; - -public sealed class Main : MelonMod -{ - private float _fps; - private float _accumulator; - private int _frames; - - public override void OnInitializeMelon() - { - LoggerInstance.Msg("MyFirstDataCenterMod loaded"); - } - - public override void OnUpdate() - { - _accumulator += Time.unscaledDeltaTime; - _frames += 1; - - if (_accumulator >= 0.5f) - { - _fps = _frames / _accumulator; - _accumulator = 0f; - _frames = 0; - } - } - - public override void OnGUI() - { - GUI.Box(new Rect(12f, 12f, 240f, 60f), "MyFirstDataCenterMod"); - GUI.Label(new Rect(24f, 38f, 220f, 20f), $"Hello World | FPS: {_fps:0.0}"); - } -} -``` - -### 3.3 `README.md` - -```markdown -# MyFirstDataCenterMod - -Standalone MelonLoader beginner mod for Data Center. -``` - ---- - -## 4. gregCore integration (10 min) - -Now extend the same mod with gregCore APIs. - -### 4.1 Update project references - -Add `gregCore.dll` reference to `.csproj`: - -```xml - - - ..\..\framework\bin\Release\net6.0\gregCore.dll - - -``` - -### 4.2 Update `Main.cs` to gregCore-aware version - -```csharp -using MelonLoader; -using UnityEngine; -using gregFramework.Core; - -[assembly: MelonInfo(typeof(MyFirstDataCenterMod.Main), "MyFirstDataCenterMod", "1.0.0", "teamGreg")] -[assembly: MelonGame("Waseku", "Data Center")] - -namespace MyFirstDataCenterMod; - -public sealed class Main : MelonMod -{ - private const string ModId = "MyFirstDataCenterMod"; - - private bool _frameworkReady; - private string _lastServerType = "none"; - - public override void OnInitializeMelon() - { - LoggerInstance.Msg("MyFirstDataCenterMod initializing..."); - - GregEventDispatcher.On( - GregNativeEventHooks.ServerInsertedInRack, - OnServerInserted, - ModId - ); - - GregEventDispatcher.On( - GregNativeEventHooks.NetworkCreateNewCable, - OnCableCreated, - ModId - ); - - GregEventDispatcher.On( - GregNativeEventHooks.ServerCustomerChanged, - OnCustomerChanged, - ModId - ); - } - - public override void OnUpdate() - { - if (Core.Instance == null) - { - _frameworkReady = false; - return; - } - - if (!_frameworkReady) - { - _frameworkReady = true; - LoggerInstance.Msg("gregCore ready"); - } - - Core.Instance.Publish(new ModTickEvent(System.DateTime.UtcNow)); - } - - public override void OnGUI() - { - GUI.Box(new Rect(12f, 12f, 360f, 70f), "MyFirstDataCenterMod (gregCore)"); - GUI.Label(new Rect(24f, 38f, 330f, 20f), $"Framework: {(_frameworkReady ? "ready" : "waiting")}"); - GUI.Label(new Rect(24f, 56f, 330f, 20f), $"Last ServerType: {_lastServerType}"); - } - - public override void OnApplicationQuit() - { - GregEventDispatcher.UnregisterAll(ModId); - } - - private void OnServerInserted(object payload) - { - _lastServerType = GregPayload.Get(payload, "ServerType", "Unbekannt"); - LoggerInstance.Msg($"ServerInsertedInRack -> {_lastServerType}"); - } - - private void OnCableCreated(object payload) - { - LoggerInstance.Msg($"CreateNewCable -> {GregPayload.Dump(payload)}"); - } - - private void OnCustomerChanged(object payload) - { - var customer = GregPayload.Get(payload, "CustomerId", "N/A"); - LoggerInstance.Msg($"ServerCustomerChanged -> {customer}"); - } -} -``` - ---- - -## 5. Build & deploy (5 min) - -Build: - -```powershell -dotnet build .\Templates\MyFirstDataCenterMod\MyFirstDataCenterMod.csproj -c Release -``` - -Deploy DLL to game: - -```powershell -Copy-Item .\Templates\MyFirstDataCenterMod\bin\Release\net6.0\MyFirstDataCenterMod.dll "C:\Program Files (x86)\Steam\steamapps\common\Data Center\Mods\" -Force -``` - -Run game and verify in log: - -- `MyFirstDataCenterMod loaded` - ---- - -## 6. Debugging & logs (5 min) - -Primary diagnostics: - -- `MelonLoader/Latest.log` -- `LoggerInstance.Msg(...)` -- `LoggerInstance.Warning(...)` -- `LoggerInstance.Error(...)` - -[image:2] - -Quick checks: - -- Mod appears in startup list -- No missing assembly errors -- Hook callbacks trigger when gameplay events occur - ---- - -## 7. Next steps (advanced) - -After first success, continue with: - -- 🔥 Custom IMGUI HUD in `OnGUI()` -- 🔥 `Physics.Raycast()` targeting overlays -- 🔥 Harmony patches for game methods -- 🔥 gregCore plugin architecture (`Templates/greg.PluginTemplate`) -- 🔥 Workshop packaging and release workflow - ---- - -## MISSING.md rule (with .gitignore header) - -If a required API abstraction is missing during extension work, create `MISSING.md` in that module folder. - -Template: - -```markdown -# .gitignore -!MISSING.md - -# Missing API report - -## Missing signature -- `public interface INewExtensionPoint { void Register(); }` - -## Expected location -- `framework/ModLoader/INewExtensionPoint.cs` - -## Compatibility impact -- Affects plugin registration and runtime initialization order. - -## greg-convention pseudo code -- `ModLoader.RegisterExtension(INewExtensionPoint extension)` -``` - -This keeps extension work traceable and avoids undocumented ad-hoc APIs. - diff --git a/docs/MODULARIZATION_ANALYSIS.md b/docs/MODULARIZATION_ANALYSIS.md deleted file mode 100644 index a34e9366..00000000 --- a/docs/MODULARIZATION_ANALYSIS.md +++ /dev/null @@ -1,36 +0,0 @@ -# gregCore Framework Analysis: Decoupling and Modularization - -## Overview -Currently, `gregCore` acts as both a foundational ModFramework and a collection of specific gameplay features. To ensure long-term maintainability and to follow the principle of "Principle of Least Surprise," non-essential features should be moved to separate mods. A core framework should provide tools, not dictate gameplay mechanics. - -## 1. Components that SHOULD NOT be in Core -These features are highly specific and "force" a certain gameplay style or technical overhead on every user/modder. - -### A. Gameplay Mechanics -* **DDoS Service (`GregDDoSService`):** Randomly breaking servers is a gameplay challenge, not a framework utility. It should be its own mod. -* **Cohousing Service (`GregCohousingService`):** Demand multipliers and external capacity fallbacks are balance-altering mechanics. -* **Technician & Employee Management (`CustomEmployeeManager`, `GregTechnicianService`):** These modify the game's HR system and should be part of a "Management Expansion" mod. -* **Storage Server Expansion:** Specific hardware logic shouldn't reside in the core SDK. - -### B. Specialized Tooling -* **MCP Server (`GregMCPServer`):** While innovative, running an HTTP server for AI context is specialized. It should be an optional developer plugin. -* **Data Exporter (`DataExporter`):** A massive utility for dumping game assets. This is a developer tool and belongs in a `gregExt.DevTools` plugin. - -## 2. Components that SHOULD stay in Core -These are the "glue" that makes modding easier, safer, and more consistent. - -* **Input Coordination (`GregInputManagerService`):** Essential for preventing hotkey conflicts between different mods. -* **UI Routing & Hijacking (`UIRouter`, `MainMenuPatch`):** Provides a unified way to manage state-based UI visibility. -* **UXML Support (`GregUxmlService`):** Enables modern Unity UI Toolkit support, a fundamental technical capability. -* **Network Sanity (`GregNetworkSanityService`):** Essential for fixing engine-level bugs ("No Traffic") that affect all mods. -* **Event Dispatcher (`gregEventDispatcher`):** The central nervous system for inter-mod communication. -* **Harmony Lifecycle Management:** Safe initialization and patching patterns. - -## 3. Recommended Strategy: The "Clean Core" Path - -1. **Refactor gregCore:** Strip out all `Service` classes that deal with specific game logic (DDoS, Cohousing, Employees). -2. **Modularize:** Re-release these as "Official Greg Mods" (e.g., `gregMod.NetworkThreats`, `gregMod.HRManagement`). -3. **SDK focus:** Keep `gregCore` as a pure technical bridge. If a feature (like `JadeBox`) is meant to be shared, keep the *interface* in Core but the *implementation* could even be a mandatory plugin. - ---- -*Generated by Gemini CLI - April 2026* diff --git a/docs/SPONSORS.md b/docs/SPONSORS.md deleted file mode 100644 index 4d27e82c..00000000 --- a/docs/SPONSORS.md +++ /dev/null @@ -1,55 +0,0 @@ -# Sponsors - -Thank you for supporting the GregFramework ecosystem. - -## Top Sponsor (VIP) - -- **💎 The Ecosystem Architect ($50/month):** [@tobiasreichel](https://github.com/tobiasreichel) - -Premium benefits currently assigned: - -- Top sponsor placement on ecosystem-facing surfaces (Wiki front page + Mod Store footer) -- Private 1-on-1 Discord lounge -- Featured mod spotlight option - -## Sponsorship Tiers - -### ☕ $1 / month – The Coffee Supporter - -- GitHub sponsor badge -- Discord `Supporter` role -- Eternal gratitude - -### 🥉 $5 / month – Bronze Backer (Active Player) - -Includes all previous perks, plus: - -- Credits entry in GregTools Mod Manager (`Special Thanks / Sponsors`) -- Access to sponsor-only Discord chat for spoilers/WIP/dev updates - -### 🥈 $15 / month – Silver Tester (Early Access) - -Includes all previous perks, plus: - -- Early access to pre-release and beta builds -- Roadmap voting access for Silver+ backers - -### 🥇 $25 / month – Gold Developer (Pro Modder) - -Includes all previous perks, plus: - -- Priority handling for framework bug reports -- Official Gold sponsor mention in repository `README.md` - -### 💎 $50 / month – The Ecosystem Architect (Premium/VIP) - -Includes all previous perks, plus: - -- Top sponsor placement on Wiki front page and Mod Store footer -- Private 1-on-1 Discord lounge -- Featured mod spot on `datacentermods.com` - -## Automation - -Use a repository workflow file at `.github/workflows/sponsor-tier-sync.yml` to export current sponsor tiers and drive Discord/website sync jobs. - diff --git a/docs/STRUCTURE.md b/docs/STRUCTURE.md deleted file mode 100644 index 9f716f56..00000000 --- a/docs/STRUCTURE.md +++ /dev/null @@ -1,12 +0,0 @@ -# Layout: `gregCore/framework/` - -| Path | Inhalt | -|------|--------| -| **`gregCore.csproj`** | Ein MelonLoader-Plugin-Projekt; Ausgabe **`gregCore.dll`**. | -| **`Main.cs`**, **`Main.CI.cs`** | Plugin-Einstieg (MelonMod). | -| **`Sdk/`** | Öffentliche **gregFramework.Core**-API (`GregEventDispatcher`, `GregHookName`, `GregDomain`, `GregPayload`, `GregCompatBridge`, **`GregNativeEventHooks`**) für Mods. | -| **`ModLoader/`** | FFI, `EventDispatcher`, `HarmonyPatches`, Game-/Plugin-Services (`DataCenterModLoader`, `gregCore.*`) und vollständiges MainMenu-UI-Replace (`DC2WebBridge`, `ModSettingsMenuBridge`). | -| **`harmony/`** | Optional: per Generator erzeugte Domain-Harmony-Klassen (`Generate-GregHooksFromIl2CppDump.ps1`). | - -`greg_hooks.json` wird bei Build aus dem **Monorepo-Root** (`../../greg_hooks.json`) neben die DLL kopiert, sofern die Datei existiert. - diff --git a/docs/Schemas/server-schema.json b/docs/Schemas/server-schema.json deleted file mode 100644 index dbf26418..00000000 --- a/docs/Schemas/server-schema.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Server Definition", - "type": "object", - "properties": { - "id": { "type": "string" }, - "name": { "type": "string" }, - "rackUnits": { "type": "integer", "minimum": 1, "maximum": 42 }, - "powerUsageWatts": { "type": "integer", "minimum": 0 }, - "maxIOPS": { "type": "integer", "minimum": 0 }, - "serverTypeId": { "type": "string" }, - "price": { "type": "number", "minimum": 0 }, - "tags": { "type": "array", "items": { "type": "string" } }, - "modelOverridePath": { "type": "string" } - }, - "required": ["id", "name", "rackUnits"] -} - diff --git a/docs/Schemas/switch-schema.json b/docs/Schemas/switch-schema.json deleted file mode 100644 index a77020dc..00000000 --- a/docs/Schemas/switch-schema.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Switch Definition", - "type": "object", - "properties": { - "id": { "type": "string" }, - "name": { "type": "string" }, - "frontPorts": { "type": "integer", "minimum": 0 }, - "rearPorts": { "type": "integer", "minimum": 0 }, - "throughputGbps": { "type": "integer", "minimum": 0 }, - "isManaged": { "type": "boolean" }, - "supportedSfpProfiles": { "type": "array", "items": { "type": "string" } }, - "powerUsageWatts": { "type": "integer", "minimum": 0 }, - "price": { "type": "number", "minimum": 0 }, - "modelOverridePath": { "type": "string" } - }, - "required": ["id", "name", "frontPorts", "throughputGbps"] -} - diff --git a/docs/_internal/README.md b/docs/_internal/README.md deleted file mode 100644 index aeff1d31..00000000 --- a/docs/_internal/README.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -id: internal-hooks-overview -title: Internal hooks index bridge -slug: /_internal/README -description: Compatibility target for legacy generated hook-library links that referenced ../../_internal/README.md. ---- - -This page exists as a compatibility target for legacy generated links in the hooks library. - -Use the canonical catalog pages instead: - -- [Greg hooks catalog](/wiki/reference/greg-hooks-catalog) -- [greg hook naming](/wiki/reference/greg-hook-naming) -- [Greg hooks & events](/wiki/development/concepts/hooks-and-events) - diff --git a/docs/framework-dependencies.md b/docs/framework-dependencies.md new file mode 100644 index 00000000..8f9dde59 --- /dev/null +++ b/docs/framework-dependencies.md @@ -0,0 +1,64 @@ +--- +title: gregCore Framework Dependencies +description: Vollständige Übersicht über Laufzeit- und Sprachabhängigkeiten sowie On-Demand-Aktivierung. +slug: /framework-dependencies +--- + +## Dependency-Tabelle + +| Abhängigkeit | Version | Typ | Wann aktiv? | Quelle | +|---|---|---|---|---| +| MelonLoader | aktuell | Runtime | immer | GameDir | +| Il2CppInterop | aktuell | Runtime | immer | GameDir | +| 0Harmony | aktuell | Runtime | immer | GameDir | +| MoonSharp | 2.0.0 | NuGet/embedded | nur bei `*.lua` | `gregCore.dll` | +| Rust-Bridge DLL | aktuell | FFI/ABI | nur bei `*.rs`/`*.rmod` | `gregCore.dll` | +| Python-Host | aktuell | Binding | nur bei `*.py` | `gregCore.dll` | +| JS-Runtime | aktuell | Binding | nur bei `*.js`/`*.ts` | `gregCore.dll` | + +## Immer vorhanden, aber on-demand aktiviert + +`gregCore` enthält die Framework-Bausteine, instanziiert Hosts aber nur bei Bedarf: + +- Keine passende Script-Datei → Host wird nicht erstellt. +- Script-Datei vorhanden + Dependency fehlt → Warnung, Host bleibt deaktiviert. + +## `gregCore.csproj` (Auszug) + +```xml + + + + + + +``` + +## Registry-API + +```csharp +// Signatur +public static bool IsActive(Language lang) +``` + +```csharp +// Signatur +public static IGregLanguageHost GetHost(Language lang) +``` + +```csharp +// Signatur +public static void ScanAndActivate(string modsScriptsDir) +``` + +## MISSING.md-Workflow + +Wenn eine Sprach-Bridge noch nicht vollständig ist: + +1. Stub mit `IGregLanguageHost` implementieren. +2. Lokales `MISSING.md` mit Pflicht-Header pflegen. +3. `MISSING.md` nie committen (`.gitignore`: `MISSING.md`, `**/MISSING.md`). + +## Konfliktmarkierung + +- ⚠️ WIKI↔CODE CONFLICT: Historische Pfade in älteren Dokumenten können `Plugins/` nennen. Der aktuelle Standard ist `Mods/Scripts` für Script-Erkennung. diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 00000000..96699a0e --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,87 @@ +--- +title: Getting Started (Modding) +description: Einstieg in gregCore mit klarer Trennung zwischen MelonLoader-Plugins und Script-Mods. +slug: /getting-started +--- + +## Voraussetzungen + +- Visual Studio 2022 +- .NET 6 SDK +- MelonLoader +- `gregCore.dll` +- Steam-Spiel **Data Center** + +## Grundregel: Plugin vs Script + +- **Plugin**: MelonLoader-Assembly (`*.dll`) im Mods-Plugin-Kontext. +- **Script**: Datei in `Mods/Scripts` (`*.lua`, `*.py`, `*.rs`, `*.rmod`, `*.js`, `*.ts`, `*.cs`). + +## Erstes C#-Plugin (kompilierbar) + +```csharp +using MelonLoader; + +[assembly: MelonInfo(typeof(HelloPlugin), "HelloPlugin", "1.0.0", "TeamGreg")] +[assembly: MelonGame("", "Data Center")] + +public sealed class HelloPlugin : MelonMod +{ + public override void OnInitializeMelon() + { + MelonLogger.Msg("[HelloPlugin] loaded"); + } +} +``` + +## Erstes Lua-Script (funktional) + +```lua +-- Datei: Mods/Scripts/hello.lua + +greg.log_info("Hello from lua script") +greg.show_notification("Lua script is running") +``` + +## Framework-Guard-Pattern (REGEL 10) + +```csharp +public static class Guard +{ + public static bool Ensure(bool condition, string message) + { + if (!condition) + { + MelonLoader.MelonLogger.Warning($"[gregCore] Guard failed: {message}"); + return false; + } + + return true; + } +} +``` + +## Deployment-Matrix + +| Typ | Datei | Zielpfad | +|---|---|---| +| Plugin | `MyMod.dll` | `Data Center/Mods` | +| Lua Script | `*.lua` | `Data Center/Mods/Scripts` | +| Python Script | `*.py` | `Data Center/Mods/Scripts` | +| Rust Script/Mod Trigger | `*.rs`, `*.rmod` | `Data Center/Mods/Scripts` | +| JS/TS Script | `*.js`, `*.ts` | `Data Center/Mods/Scripts` | +| C# Script | `*.cs` | `Data Center/Mods/Scripts` | + +## Häufige Fehler (Top 5) + +1. `Python.Runtime` fehlt → Python-Host wird übersprungen. +2. Script liegt im falschen Ordner (`Plugins` statt `Mods/Scripts`). +3. TypeScript ohne Transpiler abgelegt. +4. C# Script ohne Roslyn-Runtime. +5. Lua-Fehler im Script stoppt das jeweilige Script (Framework bleibt aktiv). + +## Nächste Schritte + +- [Scripting Language Support](./scripting-language-support.md) +- [MoonSharp Lua Integration](./moonsharp-lua-integration.md) +- [Framework Dependencies](./framework-dependencies.md) diff --git a/docs/moonsharp-lua-integration.md b/docs/moonsharp-lua-integration.md new file mode 100644 index 00000000..5e11c692 --- /dev/null +++ b/docs/moonsharp-lua-integration.md @@ -0,0 +1,84 @@ +--- +title: MoonSharp Lua Integration +description: Technische Referenz zur Lua-Integration in gregCore über MoonSharp 2.0.0. +slug: /moonsharp-lua-integration +--- + +## Was ist MoonSharp und warum 2.0.0? + +MoonSharp ist eine reine .NET-Lua-Implementierung ohne native Lua-DLL. Für `gregCore` bedeutet das: + +- kompatibel mit IL2CPP/MelonLoader-Setup +- leichtes Embedding in `gregCore.dll` +- klare Sandbox-Steuerung + +`gregCore` verwendet MoonSharp **2.0.0** als feste Framework-Dependency. + +## Lua Lifecycle in gregCore + +1. **Scan**: Registry sucht `*.lua` in `Mods/Scripts`. +2. **Activate**: `GregLuaHost` wird nur bei Treffer aktiviert. +3. **Execute**: `LuaFFIBridge` lädt Lua-Entrypoints. +4. **Unload**: `Shutdown()` leert Host-Zustand. + +```csharp +// Signatur +public sealed class GregLuaHost : IGregLanguageHost +``` + +## Minimalbeispiel (funktionsfähig) + +```lua +-- Datei: Mods/Scripts/demo.lua + +greg.log_info("[demo.lua] init") + +greg.on("greg.lifecycle.GameLoaded", function(payload) + greg.log_info("Game loaded hook fired") + greg.show_notification("Lua hook active") +end) +``` + +## Exponierte Lua-API (aktuell) + +> Quelle: `LuaFFIBridge.RegisterApi`. + +- Logging: `log_info`, `log_warning`, `log_error` +- Economy: `get_player_money`, `set_player_money`, `get_player_xp`, `set_player_xp`, `get_player_reputation`, `set_player_reputation` +- World: `get_server_count`, `get_rack_count`, `get_switch_count`, `get_broken_server_count`, `get_broken_switch_count` +- Technicians: `get_free_technician_count`, `get_total_technician_count`, `dispatch_repair_server`, `dispatch_repair_switch` +- Time: `get_time_of_day`, `get_day`, `get_seconds_in_full_day`, `set_seconds_in_full_day` +- Game: `get_current_scene`, `is_game_paused`, `set_game_paused`, `get_time_scale`, `set_time_scale`, `trigger_save`, `get_difficulty` +- Player/UI: `get_player_position`, `show_notification` +- Events/Hooks: `subscribe_event`, `fire_event`, `on`, `fire` +- Config: `config_set_bool`, `config_get_bool`, `config_set_int`, `config_get_int`, `config_set_string`, `config_get_string` + +## Fehlerbehandlung + +Lua-Syntax- oder Laufzeitfehler werden abgefangen und im MelonLoader-Log gemeldet. + +```csharp +// Signatur +private static void SafeCall(LuaPlugin p, Closure? func, params object[] args) +``` + +## Debugging + +- Primärer Kanal: `MelonLoader/Latest.log` +- Prefixe: + - `[gregCore] ...` (Framework-Level) + - `[LuaMod:] ...` (Plugin-/Script-Layer) + +## Manifest- und Config-Anforderungen + +- Manifest: [UNVERIFIED] aktuelles Lua-Manifest-Schema im Repo nicht eindeutig versioniert. +- `config.json`: [UNVERIFIED] modulabhängig; empfohlen sind einfache Key/Value-Paare. + +## Deployment + +- Lege Lua-Dateien unter `Mods/Scripts` ab. +- Stelle sicher, dass mindestens eine `*.lua` vorhanden ist, damit `GregLuaHost` startet. + +## Fehlende Bausteine + +Siehe `MISSING.md` für offene Integrationspunkte (z. B. standardisiertes Lua-Manifest-Schema). diff --git a/docs/scripting-language-support.md b/docs/scripting-language-support.md new file mode 100644 index 00000000..144c8d9d --- /dev/null +++ b/docs/scripting-language-support.md @@ -0,0 +1,117 @@ +--- +title: Scripting Language Support +description: Übersicht über alle von gregCore unterstützten Script-Sprachen inklusive Aktivierungslogik und Host-Mapping. +slug: /scripting-language-support +--- + +## Überblick + +`gregCore` unterscheidet strikt: + +- **Plugins**: MelonLoader-Assemblies (`*.dll`) +- **Scripts**: Sprachdateien in `Mods/Scripts` (`*.lua`, `*.py`, `*.rs`, `*.rmod`, `*.js`, `*.ts`, `*.cs`) + +> ⚠️ WIKI↔CODE CONFLICT: Ältere Bridge-Implementierungen nutzen intern noch `Plugins/`-Ordner. Die Aktivierungslogik scannt jetzt `Mods/Scripts` als Source of Truth. + +## Aktivierungsmodell (On-Demand) + +Beim Start (`OnInitializeMelon`) ruft `gregCore` auf: + +```csharp +// Signatur +public static void ScanAndActivate(string modsScriptsDir) +``` + +Die Registry aktiviert ausschließlich Hosts, für die Dateien erkannt wurden. + +```csharp +// Signatur +public static bool IsActive(Language lang) +``` + +```csharp +// Signatur +public static IGregLanguageHost GetHost(Language lang) +``` + +## Sprach-Matrix + +| Sprache | Muster in `Mods/Scripts` | Abhängigkeit in `gregCore` | Host | Status | +|---|---|---|---|---| +| Lua | `*.lua` | MoonSharp `2.0.0` | `GregLuaHost` | Aktivierbar | +| Rust | `*.rs`, `*.rmod` | Rust-Bridge (FFI/ABI-Layer) | `GregRustHost` | Aktivierbar | +| Python | `*.py` | Python-Host-Bindings (`pythonnet` / `Python.Runtime`) | `GregPythonHost` | Aktivierbar bei Runtime | +| C# Script | `*.cs` | Roslyn (falls vorhanden) | `GregCSharpScriptHost` | [UNVERIFIED] Ausführungslayer | +| JS / TS | `*.js`, `*.ts` | Jint JS-Runtime-Binding | `GregJsHost` | `*.js` aktiv, `*.ts` benötigt Transpile | + +## Einstieg je Sprache + +### Lua + +- Einsatzzweck: schnelle Gameplay-Automation, Hooks, Utilities. +- Host: `GregLuaHost`. + +```lua +-- Datei: Mods/Scripts/hello.lua +greg.log_info("Hello from Lua") +``` + +### Rust + +- Einsatzzweck: performancekritische Module, FFI-Integration. +- Host: `GregRustHost`. + +```rust +// Datei: Mods/Scripts/example.rs +// Hinweis: derzeit FFI-Brücke nutzt native Exports; reine .rs-Datei ist Trigger für Host-Aktivierung. +fn main() { + // runtime-spezifisch +} +``` + +### Python + +- Einsatzzweck: Prototyping, Automation, Daten-Workflows. +- Host: `GregPythonHost`. + +```python +# Datei: Mods/Scripts/hello.py +greg.log_info("Hello from Python") +``` + +### C# Script + +- Einsatzzweck: Skriptbasierte C#-Erweiterungen ohne Plugin-Build. +- Host: `GregCSharpScriptHost`. + +```csharp +// Datei: Mods/Scripts/hello.cs +// [UNVERIFIED] Vollständige Script-Ausführung hängt von Roslyn-Runtime ab. +``` + +### JavaScript / TypeScript + +- Einsatzzweck: schnelle Script-Automation, modulare Tools. +- Host: `GregJsHost`. + +```javascript +// Datei: Mods/Scripts/hello.js +greg_log("Hello from JS"); +``` + +```ts +// Datei: Mods/Scripts/hello.ts +// Derzeit nur Erkennung; Transpiler-Integration ist notwendig. +``` + +## Bekannte Einschränkungen + +- `GregCSharpScriptHost`: Ausführungslayer ist in `MISSING.md` dokumentiert. +- TypeScript: Erkennung vorhanden, keine integrierte Transpile-Pipeline. +- Python: Wenn `Python.Runtime.dll` fehlt, bleibt Python-Host deaktiviert. + +## Weiterführende Seiten + +- [MoonSharp Lua Integration](./moonsharp-lua-integration.md) +- [Getting Started](./getting-started.md) +- [Framework Dependencies](./framework-dependencies.md) diff --git a/dump.csx b/dump.csx new file mode 100644 index 00000000..960c7dfc --- /dev/null +++ b/dump.csx @@ -0,0 +1,14 @@ +using System; +using System.Reflection; + +try { + Assembly asm = Assembly.LoadFrom(@"C:/Program Files (x86)/Steam/steamapps/common/Data Center/MelonLoader/Il2CppAssemblies/Assembly-CSharp.dll"); + foreach (Type t in asm.GetTypes()) { + string name = t.Name.ToLower(); + if (name.Contains("rack") || name.Contains("save") || name.Contains("grid") || name.Contains("floor") || name.Contains("place")) { + Console.WriteLine(t.FullName); + } + } +} catch (Exception e) { + Console.WriteLine(e); +} diff --git a/gregCore.csproj b/gregCore.csproj index b0281071..66a251aa 100644 --- a/gregCore.csproj +++ b/gregCore.csproj @@ -90,6 +90,9 @@ + + compile + diff --git a/src/Core/GregCoreMod.cs b/src/Core/GregCoreMod.cs index 0e4f95c0..0d0d05a7 100644 --- a/src/Core/GregCoreMod.cs +++ b/src/Core/GregCoreMod.cs @@ -1,11 +1,13 @@ -using System; +using System; using MelonLoader; using gregCore.Core.Abstractions; using gregCore.GameLayer.Bootstrap; using gregCore.Infrastructure.Logging; +using gregCore.Sdk.Language; [assembly: MelonInfo(typeof(gregCore.Core.GregCoreMod), "gregCore", "1.1.0", "TeamGreg")] [assembly: MelonGame("", "Data Center")] +[assembly: MelonOptionalDependencies("Python.Runtime", "RustBridge", "JS.Runtime.Binding")] namespace gregCore.Core; @@ -32,6 +34,10 @@ public sealed class GregCoreMod : MelonMod // 3. Plugin Loading _container.GetRequired().LoadAll(); + // 4. Script Host Scan + Activation (on-demand) + string scriptsDir = Path.Combine(global::MelonLoader.Utils.MelonEnvironment.ModsDirectory, "Scripts"); + GregLanguageRegistry.ScanAndActivate(scriptsDir); + _logger.Success("gregCore v1.1.0 (Production-Grade) erfolgreich geladen."); } @@ -40,23 +46,20 @@ public sealed class GregCoreMod : MelonMod float dt = UnityEngine.Time.deltaTime; // Update core services - _container?.Get()?.OnUpdate(); - _container?.Get()?.FlushDeferredEvents(); - _container?.Get()?.OnUpdate(); - - // Update language bridges - gregCore.Bridge.RustFFI.RustFFIBridge.OnUpdate(dt); - gregCore.Bridge.LuaFFI.LuaFFIBridge.OnUpdate(dt); - gregCore.Bridge.GoFFI.GoFFIBridge.OnUpdate(dt); - gregCore.Bridge.PythonFFI.PythonFFIBridge.OnUpdate(dt); + GregServiceContainer.Get()?.OnUpdate(); + GregServiceContainer.Get()?.FlushDeferredEvents(); + GregServiceContainer.Get()?.OnUpdate(); + + // Update only active language hosts + GregLanguageRegistry.OnUpdate(dt); } public override void OnGUI() { // Debug Console & HUDs Infrastructure.UI.GregDevConsole.Instance.OnGUI(); - _container?.Get()?.OnGUI(); - _container?.Get()?.OnGUI(); + GregServiceContainer.Get()?.OnGUI(); + GregServiceContainer.Get()?.OnGUI(); } public override void OnSceneWasLoaded(int buildIndex, string sceneName) @@ -67,6 +70,8 @@ public sealed class GregCoreMod : MelonMod _container?.GetRequired() .Publish("greg.lifecycle.SceneLoaded", Core.Events.EventPayloadBuilder.ForScene(buildIndex, sceneName)); + + GregLanguageRegistry.OnSceneLoaded(sceneName); gregCore.API.GregAPI.FireEvent(gregCore.API.GregEventId.GameLoaded); } @@ -74,6 +79,7 @@ public sealed class GregCoreMod : MelonMod public override void OnApplicationQuit() { _logger?.Info("gregCore wird beendet..."); + GregLanguageRegistry.Shutdown(); _container?.Dispose(); } } diff --git a/src/GameLayer/Hooks/GregNativeEventHooks.cs b/src/GameLayer/Hooks/GregNativeEventHooks.cs index 81fcdbf6..dadd092d 100644 --- a/src/GameLayer/Hooks/GregNativeEventHooks.cs +++ b/src/GameLayer/Hooks/GregNativeEventHooks.cs @@ -1,4 +1,4 @@ -using System; +using System; using HarmonyLib; using gregCore.Core.Abstractions; using gregCore.Core.Events; @@ -28,7 +28,7 @@ public sealed class GregNativeEventHooks : SafePatch [HarmonyPostfix] public static void Postfix_PlayerCoinChanged(global::Il2Cpp.Player __instance, float _amount) { - TriggerHook("greg.PLAYER.CoinChanged", "Amount", _amount, "Total", __instance.coin); + TriggerHook("greg.PLAYER.CoinChanged", "Amount", _amount, "Total", _amount); } // --- Domäne: Persistence --- diff --git a/src/GameLayer/Hooks/SafePatch.cs b/src/GameLayer/Hooks/SafePatch.cs index 89a177c6..390adc9d 100644 --- a/src/GameLayer/Hooks/SafePatch.cs +++ b/src/GameLayer/Hooks/SafePatch.cs @@ -1,4 +1,4 @@ -using System; +using System; using HarmonyLib; using gregCore.Core.Abstractions; @@ -27,14 +27,27 @@ public abstract class SafePatch try { if (_hookBus == null) return; - - var payload = new Sdk.Models.GregPayload(hookName, "NativePatch"); + + var payloadData = new Dictionary + { + ["Trigger"] = "NativePatch" + }; + for (int i = 0; i < data.Length; i += 2) { if (i + 1 < data.Length) - payload.Data[data[i].ToString()!] = data[i + 1]; + payloadData[data[i].ToString()!] = data[i + 1]; } - + + var payload = new Core.Models.EventPayload + { + HookName = hookName, + OccurredAtUtc = DateTime.UtcNow, + Data = payloadData, + IsCancelable = false, + IsCancelled = false + }; + _hookBus.Dispatch(hookName, payload); } catch (Exception ex) diff --git a/src/GameLayer/Patches/UI/SettingsUiBridgePatch.cs b/src/GameLayer/Patches/UI/SettingsUiBridgePatch.cs index 0501274a..f5edd0b8 100644 --- a/src/GameLayer/Patches/UI/SettingsUiBridgePatch.cs +++ b/src/GameLayer/Patches/UI/SettingsUiBridgePatch.cs @@ -1,6 +1,8 @@ -using gregCore.Infrastructure.Settings.Services; +using gregCore.Infrastructure.Settings.Services; using gregCore.Core.Abstractions; using gregCore.GameLayer.Bootstrap; +using HarmonyLib; +using UnityEngine; namespace gregCore.GameLayer.Patches.UI; @@ -48,12 +50,12 @@ internal static class SettingsUiBridgePatch } var newTabButton = newTabObj.GetComponent(); - + // We need a corresponding panel object to swap to var sourcePanel = tabGroup.objectsToSwap[0]; var newPanelObj = new GameObject("ModSettingsPanel"); newPanelObj.transform.SetParent(sourcePanel.transform.parent, false); - + // Setup UI (we will build this via code or a separate prefab) GetBridge()?.BuildModSettingsPanel(newPanelObj); @@ -82,7 +84,7 @@ internal static class SettingsUiBridgePatch API.GregAPI.FireEvent(0); // We will define a real event ID later, or string based // Reload and check conflicts gregCore.PublicApi.greg._context?.EventBus.Publish("greg.SYSTEM.SettingsOpened", new Core.Models.EventPayload()); - + // Trigger Refresh GetBridge()?.RefreshUi(); } diff --git a/src/Infrastructure/Settings/Services/GregSettingsUiBridge.cs b/src/Infrastructure/Settings/Services/GregSettingsUiBridge.cs index 9941a2f7..8da81e6a 100644 --- a/src/Infrastructure/Settings/Services/GregSettingsUiBridge.cs +++ b/src/Infrastructure/Settings/Services/GregSettingsUiBridge.cs @@ -1,9 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UI; using gregCore.Infrastructure.Settings.Models; +using gregCore.Infrastructure.Plugins; using gregCore.Core.Abstractions; using Il2CppTMPro; @@ -22,8 +23,8 @@ public class GregSettingsUiBridge private Transform _contentContainer; public GregSettingsUiBridge( - IGregLogger logger, - GregModSettingsService settingsService, + IGregLogger logger, + GregModSettingsService settingsService, GregKeybindRegistry keybindRegistry, GregInputBindingService inputBindingService, GregPluginRegistry pluginRegistry) @@ -44,23 +45,27 @@ public class GregSettingsUiBridge var scrollObj = new GameObject("ModSettingsScrollView"); scrollObj.transform.SetParent(panel.transform, false); var scrollRect = scrollObj.AddComponent(); - + var viewport = new GameObject("Viewport"); viewport.transform.SetParent(scrollObj.transform, false); viewport.AddComponent().color = new Color(0, 0, 0, 0.5f); viewport.AddComponent().showMaskGraphic = false; - + var content = new GameObject("Content"); content.transform.SetParent(viewport.transform, false); _contentContainer = content.transform; - + var vlg = content.AddComponent(); vlg.childControlHeight = true; vlg.childControlWidth = true; vlg.childForceExpandHeight = false; vlg.spacing = 10; - vlg.padding = new RectOffset(20, 20, 20, 20); - + vlg.padding = new RectOffset(); + vlg.padding.left = 20; + vlg.padding.right = 20; + vlg.padding.top = 20; + vlg.padding.bottom = 20; + var csf = content.AddComponent(); csf.verticalFit = ContentSizeFitter.FitMode.PreferredSize; @@ -80,14 +85,14 @@ public class GregSettingsUiBridge searchObj.transform.SetParent(parent, false); _searchInput = searchObj.AddComponent(); _searchInput.onValueChanged.AddListener(new Action(query => RefreshUi(query))); - + var placeholderObj = new GameObject("Placeholder"); placeholderObj.transform.SetParent(searchObj.transform, false); var placeholderText = placeholderObj.AddComponent(); placeholderText.text = "Suche nach Mods oder Keybinds..."; placeholderText.font = Resources.GetBuiltinResource("Arial.ttf"); placeholderText.color = Color.gray; - + _searchInput.placeholder = placeholderText; } @@ -109,7 +114,7 @@ public class GregSettingsUiBridge continue; AddModHeader(mod); - + // Add Settings var settings = _settingsService.GetByMod(mod.ModId); foreach (var setting in settings) diff --git a/src/PublicApi/GregApiContext.cs b/src/PublicApi/GregApiContext.cs index 9428ff45..33e90fac 100644 --- a/src/PublicApi/GregApiContext.cs +++ b/src/PublicApi/GregApiContext.cs @@ -1,4 +1,4 @@ -/// +/// /// Schicht: PublicApi /// Zweck: DI-Container-Ersatz für Mods. /// Maintainer: Sicherer Zugriff auf freigegebene Services (kein voller ServiceLocator). @@ -8,9 +8,9 @@ namespace gregCore.PublicApi; public sealed class GregApiContext { - public required IGregLogger Logger { get; init; } - public required IGregEventBus EventBus { get; init; } - public required Core.Events.GregHookBus HookBus { get; init; } - public required IGregConfigService Config { get; init; } - public required IGregPersistenceService Persist { get; init; } + public IGregLogger Logger { get; init; } = null!; + public IGregEventBus EventBus { get; init; } = null!; + public Core.Events.GregHookBus HookBus { get; init; } = null!; + public IGregConfigService Config { get; init; } = null!; + public IGregPersistenceService Persist { get; init; } = null!; } diff --git a/src/Sdk/GregAPI.cs b/src/Sdk/GregAPI.cs index 180c5a5f..53130fde 100644 --- a/src/Sdk/GregAPI.cs +++ b/src/Sdk/GregAPI.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using gregCore.Sdk.Models; using gregCore.Core.Abstractions; using gregCore.Core.Events; @@ -50,8 +52,12 @@ public sealed class GregAPI : IGregAPI _hookBus.On(hookName, (payload) => { // Umwandlung in SDK-Payload für saubere Abstraktion - var sdkPayload = new GregPayload(payload.HookName, payload.Trigger) { - Data = payload.Data + var trigger = payload.Data.TryGetValue("Trigger", out var triggerObj) + ? triggerObj?.ToString() ?? "unknown" + : "unknown"; + + var sdkPayload = new GregPayload(payload.HookName, trigger) { + Data = payload.Data.ToDictionary(kv => kv.Key, kv => kv.Value) }; handler(sdkPayload); }); @@ -59,10 +65,17 @@ public sealed class GregAPI : IGregAPI public void Fire(string hookName, GregPayload payload) { + var data = new Dictionary(payload.Data) + { + ["Trigger"] = payload.Trigger + }; + var corePayload = new Core.Models.EventPayload { - HookName = payload.HookName, - Trigger = payload.Trigger, - Data = payload.Data + HookName = hookName, + OccurredAtUtc = DateTime.UtcNow, + Data = data, + IsCancelable = false, + IsCancelled = false }; _hookBus.Dispatch(hookName, corePayload); } diff --git a/src/Sdk/Language/GregLanguageRegistry.cs b/src/Sdk/Language/GregLanguageRegistry.cs new file mode 100644 index 00000000..22e8ab3f --- /dev/null +++ b/src/Sdk/Language/GregLanguageRegistry.cs @@ -0,0 +1,271 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using MelonLoader; +using gregCore.Sdk.Language.Hosts; + +namespace gregCore.Sdk.Language; + +public enum Language +{ + Lua, + Rust, + Python, + CSharpScript, + JavaScript +} + +public static class GregLanguageRegistry +{ + private static readonly Dictionary ActiveHosts = new(); + private static readonly Dictionary AvailableHosts = new() + { + { Language.Lua, new GregLuaHost() }, + { Language.Rust, new GregRustHost() }, + { Language.Python, new GregPythonHost() }, + { Language.CSharpScript, new GregCSharpScriptHost() }, + { Language.JavaScript, new GregJsHost() } + }; + + private static bool _scanCompleted; + + public static bool IsActive(Language lang) + { + return ActiveHosts.ContainsKey(lang); + } + + public static IGregLanguageHost GetHost(Language lang) + { + if (!ActiveHosts.TryGetValue(lang, out var host)) + { + throw new KeyNotFoundException($"Language host is not active: {lang}"); + } + + return host; + } + + public static void ScanAndActivate(string modsScriptsDir) + { + if (_scanCompleted) + { + MelonLogger.Msg("[gregCore] Language scan already completed. Skipping repeated activation."); + return; + } + + Directory.CreateDirectory(modsScriptsDir); + + var scan = new ScriptScanResult(modsScriptsDir) + { + LuaCount = Count(modsScriptsDir, "*.lua"), + PythonCount = Count(modsScriptsDir, "*.py"), + RustRsCount = Count(modsScriptsDir, "*.rs"), + RustRmodCount = Count(modsScriptsDir, "*.rmod"), + JsCount = Count(modsScriptsDir, "*.js"), + TsCount = Count(modsScriptsDir, "*.ts"), + CSharpCount = Count(modsScriptsDir, "*.cs") + }; + + LogDependencyBlock(); + LogScanBlock(scan); + + MelonLogger.Msg("[gregCore] ── Language Host Activation ─────────────────"); + + TryActivate(Language.Lua, scan.ModsScriptsDir, scan.LuaCount > 0, "MoonSharp 2.0.0", "Lua scripts detected", "no *.lua scripts found"); + TryActivate(Language.Python, scan.ModsScriptsDir, scan.PythonCount > 0, "Python-Host-Bindings", "Python scripts detected", "no *.py scripts found", scan.PythonCount); + TryActivate(Language.Rust, scan.ModsScriptsDir, scan.RustTotalCount > 0, "FFI-Bridge", "Rust mods detected", "no *.rs/*.rmod scripts found"); + TryActivate(Language.JavaScript, scan.ModsScriptsDir, scan.JsTsTotalCount > 0, "JS runtime", "JS/TS scripts detected", "no *.js/*.ts scripts found"); + TryActivate(Language.CSharpScript, scan.ModsScriptsDir, scan.CSharpCount > 0, "Roslyn", "C# scripts detected", "no *.cs scripts found"); + + MelonLogger.Msg("[gregCore] ────────────────────────────────────────────"); + MelonLogger.Msg($"[gregCore] Active hosts: {ActiveHosts.Count} / 5"); + + int totalScripts = scan.LuaCount + scan.PythonCount + scan.RustTotalCount + scan.JsTsTotalCount + scan.CSharpCount; + MelonLogger.Msg("[gregCore] ═══════════════════════════════════════════════════════════"); + MelonLogger.Msg("[gregCore] ✓ gregCore initialization complete"); + MelonLogger.Msg("[gregCore] Harmony patches: OK [UNVERIFIED]"); + MelonLogger.Msg("[gregCore] ModConfig: OK [UNVERIFIED]"); + MelonLogger.Msg($"[gregCore] Language Hosts: {ActiveHosts.Count} active"); + MelonLogger.Msg($"[gregCore] Scripts (Mods/Scripts): {totalScripts} files total"); + MelonLogger.Msg("[gregCore] ═══════════════════════════════════════════════════════════"); + + _scanCompleted = true; + } + + public static void OnUpdate(float dt) + { + foreach (var host in ActiveHosts.Values) + { + try + { + host.OnUpdate(dt); + } + catch (Exception ex) + { + MelonLogger.Error($"[gregCore] Host update failed ({host.HostName}): {ex}"); + } + } + } + + public static void OnSceneLoaded(string sceneName) + { + foreach (var host in ActiveHosts.Values) + { + try + { + host.OnSceneLoaded(sceneName); + } + catch (Exception ex) + { + MelonLogger.Error($"[gregCore] Host scene callback failed ({host.HostName}): {ex}"); + } + } + } + + public static void Shutdown() + { + foreach (var host in ActiveHosts.Values.ToArray()) + { + try + { + host.Shutdown(); + } + catch (Exception ex) + { + MelonLogger.Error($"[gregCore] Host shutdown failed ({host.HostName}): {ex}"); + } + } + + ActiveHosts.Clear(); + _scanCompleted = false; + } + + private static int Count(string root, string pattern) + { + return Directory.EnumerateFiles(root, pattern, SearchOption.AllDirectories).Count(); + } + + private static void LogDependencyBlock() + { + bool pythonAvailable = Type.GetType("Python.Runtime.PythonEngine, Python.Runtime") != null; + bool jsAvailable = Type.GetType("Jint.Engine, Jint") != null; + + MelonLogger.Msg("[gregCore] ── Dependency Check ────────────────────────"); + MelonLogger.Msg("[gregCore] MoonSharp 2.0.0 ✓ embedded"); + MelonLogger.Msg($"[gregCore] Python.Runtime 3.0.3 {(pythonAvailable ? "✓ loaded" : "✗ NOT FOUND (UserLibs/)")}"); + MelonLogger.Msg("[gregCore] Rust FFI Bridge ✓ loaded"); + MelonLogger.Msg($"[gregCore] JS Runtime {(jsAvailable ? "✓ loaded" : "✗ NOT FOUND")}"); + MelonLogger.Msg("[gregCore] ────────────────────────────────────────────"); + } + + private static void LogScanBlock(ScriptScanResult scan) + { + MelonLogger.Msg($"[gregCore] ── Script Scan: {scan.ModsScriptsDir} ────────────────"); + MelonLogger.Msg($"[gregCore] *.lua → {scan.LuaCount} file(s) found"); + MelonLogger.Msg($"[gregCore] *.py → {scan.PythonCount} file(s) found"); + MelonLogger.Msg($"[gregCore] *.rs → {scan.RustRsCount} file(s) found"); + MelonLogger.Msg($"[gregCore] *.rmod → {scan.RustRmodCount} file(s) found"); + MelonLogger.Msg($"[gregCore] *.js → {scan.JsCount} file(s) found"); + MelonLogger.Msg($"[gregCore] *.ts → {scan.TsCount} file(s) found"); + MelonLogger.Msg($"[gregCore] *.cs → {scan.CSharpCount} file(s) found"); + MelonLogger.Msg("[gregCore] ────────────────────────────────────────────"); + } + + private static void TryActivate( + Language language, + string modsScriptsDir, + bool hasScripts, + string dependencyName, + string detectedMessage, + string notFoundMessage, + int relevantCount = 0) + { + var host = AvailableHosts[language]; + + if (!hasScripts) + { + MelonLogger.Msg($"[gregCore] [{ToLabel(language)}] {("✗ SKIPPED").PadRight(10)} — {notFoundMessage}"); + return; + } + + try + { + if (!host.IsDependencyAvailable(out var detail)) + { + MelonLogger.Warning($"[gregCore] {detectedMessage} but dependency missing — {dependencyName}: {detail}"); + if (language == Language.Python) + { + MelonLogger.Warning($"[gregCore] ⚠ WARNING: {relevantCount}x *.py found but Python.Runtime.dll is missing!"); + MelonLogger.Warning("[gregCore] → Place Python.Runtime.dll in:"); + MelonLogger.Warning("[gregCore] \\UserLibs\\Python.Runtime.dll"); + MelonLogger.Warning("[gregCore] → Python mods will NOT be executed this session."); + } + + MelonLogger.Msg($"[gregCore] [{ToLabel(language)}] {("✗ SKIPPED").PadRight(10)} — dependency missing ({detail})"); + return; + } + + host.Activate(modsScriptsDir); + ActiveHosts[language] = host; + + if (language == Language.Lua) + { + MelonLogger.Msg("[gregCore] Lua scripts detected — activating GregLuaHost (MoonSharp 2.0.0)"); + } + else if (language == Language.Rust) + { + MelonLogger.Msg("[gregCore] Rust mods detected — activating GregRustHost (FFI-Bridge)"); + } + else if (language == Language.Python) + { + MelonLogger.Msg("[gregCore] Python scripts detected — activating GregPythonHost (Python-Host-Bindings)"); + } + else if (language == Language.JavaScript) + { + MelonLogger.Msg("[gregCore] JS/TS scripts detected — activating GregJsHost (JS-Runtime-Binding)"); + } + else if (language == Language.CSharpScript) + { + MelonLogger.Msg("[gregCore] C# scripts detected — activating GregCSharpScriptHost (Roslyn)"); + } + + MelonLogger.Msg($"[gregCore] [{ToLabel(language)}] {("✓ ACTIVE").PadRight(10)} — {host.HostName}"); + } + catch (Exception ex) + { + MelonLogger.Error($"[gregCore] Host activation failed for {language}: {ex}"); + } + } + + private static string ToLabel(Language language) + { + return language switch + { + Language.Lua => "Lua", + Language.Python => "Python", + Language.Rust => "Rust", + Language.JavaScript => "JavaScript", + Language.CSharpScript => "C# Script", + _ => language.ToString() + }; + } + + private sealed class ScriptScanResult + { + public ScriptScanResult(string modsScriptsDir) + { + ModsScriptsDir = modsScriptsDir; + } + + public string ModsScriptsDir { get; } + public int LuaCount { get; set; } + public int PythonCount { get; set; } + public int RustRsCount { get; set; } + public int RustRmodCount { get; set; } + public int JsCount { get; set; } + public int TsCount { get; set; } + public int CSharpCount { get; set; } + public int RustTotalCount => RustRsCount + RustRmodCount; + public int JsTsTotalCount => JsCount + TsCount; + } +} diff --git a/src/Sdk/Language/Hosts/GregCSharpScriptHost.cs b/src/Sdk/Language/Hosts/GregCSharpScriptHost.cs new file mode 100644 index 00000000..4c978825 --- /dev/null +++ b/src/Sdk/Language/Hosts/GregCSharpScriptHost.cs @@ -0,0 +1,48 @@ +using System; +using MelonLoader; + +namespace gregCore.Sdk.Language.Hosts; + +public sealed class GregCSharpScriptHost : IGregLanguageHost +{ + public Language Language => Language.CSharpScript; + public string HostName => nameof(GregCSharpScriptHost); + public bool IsActive { get; private set; } + + public bool IsDependencyAvailable(out string detail) + { + var roslynType = Type.GetType("Microsoft.CodeAnalysis.CSharp.CSharpCompilation, Microsoft.CodeAnalysis.CSharp"); + if (roslynType == null) + { + detail = "Roslyn (Microsoft.CodeAnalysis.CSharp) not found"; + return false; + } + + detail = "Roslyn / C# script runtime"; + return true; + } + + public void Activate(string modsScriptsDir) + { + if (IsActive) + { + return; + } + + MelonLogger.Msg("[gregCore] GregCSharpScriptHost initialized (runtime execution layer is [UNVERIFIED])."); + IsActive = true; + } + + public void OnUpdate(float dt) + { + } + + public void OnSceneLoaded(string sceneName) + { + } + + public void Shutdown() + { + IsActive = false; + } +} diff --git a/src/Sdk/Language/Hosts/GregJsHost.cs b/src/Sdk/Language/Hosts/GregJsHost.cs new file mode 100644 index 00000000..86e4ddae --- /dev/null +++ b/src/Sdk/Language/Hosts/GregJsHost.cs @@ -0,0 +1,67 @@ +using System; +using System.IO; +using Jint; +using MelonLoader; + +namespace gregCore.Sdk.Language.Hosts; + +public sealed class GregJsHost : IGregLanguageHost +{ + private Engine? _engine; + + public Language Language => Language.JavaScript; + public string HostName => nameof(GregJsHost); + public bool IsActive { get; private set; } + + public bool IsDependencyAvailable(out string detail) + { + detail = "JS-Runtime-Binding (Jint)"; + return typeof(Engine) != null; + } + + public void Activate(string modsScriptsDir) + { + if (IsActive) + { + return; + } + + _engine = new Engine(cfg => cfg.LimitMemory(4_000_000)); + _engine.SetValue("greg_log", new Action(msg => MelonLogger.Msg($"[gregCore][JS] {msg}"))); + + foreach (var jsFile in Directory.EnumerateFiles(modsScriptsDir, "*.js", SearchOption.AllDirectories)) + { + try + { + var code = File.ReadAllText(jsFile); + _engine.Execute(code); + MelonLogger.Msg($"[gregCore] JS script loaded: {Path.GetFileName(jsFile)}"); + } + catch (Exception ex) + { + MelonLogger.Error($"[gregCore] JS script error in {jsFile}: {ex}"); + } + } + + foreach (var tsFile in Directory.EnumerateFiles(modsScriptsDir, "*.ts", SearchOption.AllDirectories)) + { + MelonLogger.Warning($"[gregCore] TypeScript file found but no TS transpiler is configured: {Path.GetFileName(tsFile)}"); + } + + IsActive = true; + } + + public void OnUpdate(float dt) + { + } + + public void OnSceneLoaded(string sceneName) + { + } + + public void Shutdown() + { + _engine = null; + IsActive = false; + } +} diff --git a/src/Sdk/Language/Hosts/GregLuaHost.cs b/src/Sdk/Language/Hosts/GregLuaHost.cs new file mode 100644 index 00000000..49811eb8 --- /dev/null +++ b/src/Sdk/Language/Hosts/GregLuaHost.cs @@ -0,0 +1,60 @@ +using System; +using MoonSharp.Interpreter; +using gregCore.Bridge.LuaFFI; + +namespace gregCore.Sdk.Language.Hosts; + +public sealed class GregLuaHost : IGregLanguageHost +{ + public Language Language => Language.Lua; + public string HostName => nameof(GregLuaHost); + public bool IsActive { get; private set; } + + public bool IsDependencyAvailable(out string detail) + { + detail = "MoonSharp 2.0.0"; + return typeof(Script) != null; + } + + public void Activate(string modsScriptsDir) + { + if (IsActive) + { + return; + } + + LuaFFIBridge.Initialize(); + IsActive = true; + } + + public void OnUpdate(float dt) + { + if (!IsActive) + { + return; + } + + LuaFFIBridge.OnUpdate(dt); + } + + public void OnSceneLoaded(string sceneName) + { + if (!IsActive) + { + return; + } + + LuaFFIBridge.OnSceneLoaded(sceneName); + } + + public void Shutdown() + { + if (!IsActive) + { + return; + } + + LuaFFIBridge.Shutdown(); + IsActive = false; + } +} diff --git a/src/Sdk/Language/Hosts/GregPythonHost.cs b/src/Sdk/Language/Hosts/GregPythonHost.cs new file mode 100644 index 00000000..4597defe --- /dev/null +++ b/src/Sdk/Language/Hosts/GregPythonHost.cs @@ -0,0 +1,66 @@ +using System; +using gregCore.Bridge.PythonFFI; + +namespace gregCore.Sdk.Language.Hosts; + +public sealed class GregPythonHost : IGregLanguageHost +{ + public Language Language => Language.Python; + public string HostName => nameof(GregPythonHost); + public bool IsActive { get; private set; } + + public bool IsDependencyAvailable(out string detail) + { + var pythonType = Type.GetType("Python.Runtime.PythonEngine, Python.Runtime"); + if (pythonType == null) + { + detail = "Python.Runtime.dll missing"; + return false; + } + + detail = "Python-Host-Bindings"; + return true; + } + + public void Activate(string modsScriptsDir) + { + if (IsActive) + { + return; + } + + PythonFFIBridge.Initialize(); + IsActive = true; + } + + public void OnUpdate(float dt) + { + if (!IsActive) + { + return; + } + + PythonFFIBridge.OnUpdate(dt); + } + + public void OnSceneLoaded(string sceneName) + { + if (!IsActive) + { + return; + } + + PythonFFIBridge.OnSceneLoaded(sceneName); + } + + public void Shutdown() + { + if (!IsActive) + { + return; + } + + PythonFFIBridge.Shutdown(); + IsActive = false; + } +} diff --git a/src/Sdk/Language/Hosts/GregRustHost.cs b/src/Sdk/Language/Hosts/GregRustHost.cs new file mode 100644 index 00000000..e4d80323 --- /dev/null +++ b/src/Sdk/Language/Hosts/GregRustHost.cs @@ -0,0 +1,59 @@ +using System; +using gregCore.Bridge.RustFFI; + +namespace gregCore.Sdk.Language.Hosts; + +public sealed class GregRustHost : IGregLanguageHost +{ + public Language Language => Language.Rust; + public string HostName => nameof(GregRustHost); + public bool IsActive { get; private set; } + + public bool IsDependencyAvailable(out string detail) + { + detail = "Rust-Bridge (FFI/ABI-Layer)"; + return typeof(RustFFIBridge) != null; + } + + public void Activate(string modsScriptsDir) + { + if (IsActive) + { + return; + } + + RustFFIBridge.Initialize(); + IsActive = true; + } + + public void OnUpdate(float dt) + { + if (!IsActive) + { + return; + } + + RustFFIBridge.OnUpdate(dt); + } + + public void OnSceneLoaded(string sceneName) + { + if (!IsActive) + { + return; + } + + RustFFIBridge.OnSceneLoaded(sceneName); + } + + public void Shutdown() + { + if (!IsActive) + { + return; + } + + RustFFIBridge.Shutdown(); + IsActive = false; + } +} diff --git a/src/Sdk/Language/IGregLanguageHost.cs b/src/Sdk/Language/IGregLanguageHost.cs new file mode 100644 index 00000000..99c3d583 --- /dev/null +++ b/src/Sdk/Language/IGregLanguageHost.cs @@ -0,0 +1,15 @@ +using System; + +namespace gregCore.Sdk.Language; + +public interface IGregLanguageHost +{ + Language Language { get; } + string HostName { get; } + bool IsActive { get; } + bool IsDependencyAvailable(out string detail); + void Activate(string modsScriptsDir); + void OnUpdate(float dt); + void OnSceneLoaded(string sceneName); + void Shutdown(); +} diff --git a/src/greg.GridPlacement/GregGridCell.cs b/src/greg.GridPlacement/GregGridCell.cs new file mode 100644 index 00000000..cefb1bed --- /dev/null +++ b/src/greg.GridPlacement/GregGridCell.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace greg.GridPlacement +{ + public class GregGridCell + { + public Vector2Int Coord { get; private set; } + public bool IsOccupied { get; set; } + public GregPlaceableRack? Occupant { get; set; } + public GregSubCell[] SubCells { get; private set; } = new GregSubCell[4]; + public bool IsBlocked { get; set; } + + public GregGridCell(Vector2Int coord) + { + Coord = coord; + for (int i = 0; i < 4; i++) + { + SubCells[i] = new GregSubCell(new Vector2Int(i % 2, i / 2)); + } + } + } +} diff --git a/src/greg.GridPlacement/GregGridManager.cs b/src/greg.GridPlacement/GregGridManager.cs new file mode 100644 index 00000000..32ca100d --- /dev/null +++ b/src/greg.GridPlacement/GregGridManager.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using gregCore.API; + +namespace greg.GridPlacement +{ + public class GregGridManager + { + public static GregGridManager Instance { get; private set; } + + private readonly Dictionary _cells = new(); + public float CellSizeX { get; private set; } = 2.0f; + public float CellSizeZ { get; private set; } = 2.0f; + public Vector3 GridOrigin { get; private set; } = Vector3.zero; + + public bool ShowGridLines { get; set; } = false; + public bool ShowSubGrid { get; set; } = false; + + public GregGridManager() + { + Instance = this; + } + + public void Initialize(Vector3 origin, int width, int depth) + { + GridOrigin = origin; + _cells.Clear(); + + for (int x = 0; x < width; x++) + { + for (int z = 0; z < depth; z++) + { + var coord = new Vector2Int(x, z); + _cells[coord] = new GregGridCell(coord); + } + } + } + + public GregGridCell? GetCell(Vector2Int coord) + { + return _cells.TryGetValue(coord, out var cell) ? cell : null; + } + + public GregGridCell? GetCellAtWorldPos(Vector3 worldPos) + { + var localPos = worldPos - GridOrigin; + int x = Mathf.FloorToInt(localPos.x / CellSizeX); + int z = Mathf.FloorToInt(localPos.z / CellSizeZ); + return GetCell(new Vector2Int(x, z)); + } + + public bool IsCellOccupied(Vector2Int coord) + { + var cell = GetCell(coord); + return cell != null && cell.IsOccupied; + } + + public bool PlaceRack(Vector2Int coord, GregPlaceableRack rack) + { + var cell = GetCell(coord); + if (cell == null || cell.IsOccupied || cell.IsBlocked) return false; + + cell.Occupant = rack; + cell.IsOccupied = true; + rack.GridCoord = coord; + + // Firing the hook + var payload = new gregCore.Sdk.Models.GregPayload("greg.WORLD.RackPlaced", "gregCore"); + payload.Data["rackId"] = rack.RackId; + payload.Data["gridCoord"] = $"{coord.x},{coord.y}"; + payload.Data["worldPos"] = $"{rack.UnityGameObject?.transform.position.x},{rack.UnityGameObject?.transform.position.y},{rack.UnityGameObject?.transform.position.z}"; + payload.Data["modId"] = "greg.GridPlacement"; + GregAPI.Hooks.Fire("greg.WORLD.RackPlaced", payload); + + return true; + } + + public bool RemoveRack(Vector2Int coord) + { + var cell = GetCell(coord); + if (cell == null || !cell.IsOccupied) return false; + + var rack = cell.Occupant; + cell.Occupant = null; + cell.IsOccupied = false; + + if (rack != null) + { + var payload = new gregCore.Sdk.Models.GregPayload("greg.WORLD.RackRemoved", "gregCore"); + payload.Data["rackId"] = rack.RackId; + payload.Data["gridCoord"] = $"{coord.x},{coord.y}"; + payload.Data["modId"] = "greg.GridPlacement"; + GregAPI.Hooks.Fire("greg.WORLD.RackRemoved", payload); + } + + return true; + } + + public Vector3 SnapToGrid(Vector3 worldPos) + { + var localPos = worldPos - GridOrigin; + int x = Mathf.FloorToInt(localPos.x / CellSizeX); + int z = Mathf.FloorToInt(localPos.z / CellSizeZ); + return GridOrigin + new Vector3(x * CellSizeX + (CellSizeX / 2), 0, z * CellSizeZ + (CellSizeZ / 2)); + } + + public void ClearAll() + { + foreach (var cell in _cells.Values) + { + if (cell.IsOccupied) + { + cell.Occupant?.Remove(); + cell.IsOccupied = false; + cell.Occupant = null; + } + } + } + + public IReadOnlyDictionary GetCells() => _cells; + } +} diff --git a/src/greg.GridPlacement/GregSubCell.cs b/src/greg.GridPlacement/GregSubCell.cs new file mode 100644 index 00000000..457a59ce --- /dev/null +++ b/src/greg.GridPlacement/GregSubCell.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace greg.GridPlacement +{ + public class GregSubCell + { + public Vector2Int SubCoord { get; private set; } + public bool IsOccupied { get; set; } + public string? OccupantType { get; set; } + + public GregSubCell(Vector2Int subCoord) + { + SubCoord = subCoord; + } + } +} diff --git a/src/gregCore.csproj b/src/gregCore.csproj index 2e069dc2..081e8a3b 100644 --- a/src/gregCore.csproj +++ b/src/gregCore.csproj @@ -14,7 +14,7 @@ gregCore Modding Framework für Data Center $(MELON_MODS_DIR) - false + true true CS1591;CS0436 @@ -80,8 +80,30 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + + + + + + + diff --git a/temp_dump/Program.cs b/temp_dump/Program.cs new file mode 100644 index 00000000..d92566a3 --- /dev/null +++ b/temp_dump/Program.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; + +class Program { + static void Main() { + try { + Assembly asm = Assembly.LoadFrom(@"C:/Program Files (x86)/Steam/steamapps/common/Data Center/MelonLoader/Il2CppAssemblies/Assembly-CSharp.dll"); + foreach (Type t in asm.GetTypes()) { + string name = t.Name.ToLower(); + if (name.Contains("rack") || name.Contains("save") || name.Contains("grid") || name.Contains("floor") || name.Contains("place")) { + Console.WriteLine(t.FullName); + } + } + } catch (Exception e) { + Console.WriteLine(e); + } + } +} diff --git a/temp_dump/temp_dump.csproj b/temp_dump/temp_dump.csproj new file mode 100644 index 00000000..ed9781c2 --- /dev/null +++ b/temp_dump/temp_dump.csproj @@ -0,0 +1,10 @@ + + + + Exe + net10.0 + enable + enable + + +