How policing-redefined/commondataframework works
Project type and purpose
• This is an open-source C# plugin library for the LSPDFR (Los Santos Police Department First Response) mod in GTA V.
• Its purpose is to provide a shared, synchronized vehicle and pedestrian data API across all dependent plugins.
File structure
• Top-level solution: CommonDataFramework.sln
• Single C# project: CommonDataFramework/
· API folder: public entrypoints (CDFEvents.cs, CDFFunctions.cs)
· Engine folder: core runtime (event dispatch, IO, utilities, logging)
· Modules folder: domain-specific data handlers (PedDatabase, VehicleDatabase, Postals, etc.)
· Settings.cs and .ini reflector: configuration management
• No separate frontend/backend—this is a runtime plugin loaded into GTA V via RagePluginHook.
README for additional insights
• Architecture is event-driven: hooks into LSPDFR events (OnOnDutyStateChanged, GetPedData, GetVehicleData).
• Configurable via .ini and XML for IntelliSense.
• Data store is in-memory with optional persistence window via Engine.IO (IniReflector).
a. Main components
1. GTA V + RagePluginHook (host environment)
2. LSPDFR core plugin API (external service)
3. CommonDataFramework.dll
• API Layer (CDFEvents, CDFFunctions)
• Engine Core (event loop, IO, Logger)
• Utility helpers (extensions, resources)
• Modules (PedDatabase, VehicleDatabase, Postals, PedResidence)
4. Configuration store (.ini files, optional XML for IntelliSense)
5. Dependent plugins (e.g., “Policing Redefined”)
b. Relationships & interactions
• On game startup, RagePluginHook loads CDF DLL
• CDF registers to LSPDFR events via the API layer
• When events fire (e.g., ped created, on-duty state change), Engine Core dispatches to Modules
• Modules read/write data objects (PedData, VehicleData)
• Modules persist state temporarily in memory and optionally to .ini via IniReflector
• Dependent plugins call CDFFunctions.GetPedData()/GetVehicleData() to retrieve synchronized state
c. Architectural patterns/design principles
• Plugin architecture: loosely coupled via public API
• Event-driven design: subscribe/publish to LSPDFR events
• Modular domain decomposition: separate modules per data domain
• Single project, layered design (API → Engine → Modules → IO)
d. Key technologies & frameworks
• C#, .NET Framework (RagePluginHook host)
• LSPDFR Mod API
• RAGE engine
• IniReflector for configuration
• Visual Studio solution (.sln, .csproj)
Essential details
• Modules individually to reflect domain separation
• Event loop: GTA V → LSPDFR event → CDFFunctions → Module handler
• Config loader (IniReflector) as a distinct IO component