How ndekopon/overlaytools works
Project Type and Purpose
• This is a full-stack, single-machine overlay tool for Apex Legends custom matches.
• The C++ “proxy” component connects to the game’s LiveAPI via WebSocket, processes incoming events, and exposes them over local HTTP and WebSocket endpoints.
• A browser-based frontend (“htdocs”) consumes those streams to render real-time overlays in OBS.
• A WebView2-based configuration GUI (“webapi-config” solution) allows match administrators to view, correct, and switch overlays in real time.
High-Level File Structure Analysis
Top-level:
• apexliveapi_proxy.sln / .vcxproj ← C++ proxy solution
• dump2json.vcxproj ← standalone CLI to convert raw events to JSON
• htdocs/ ← static web assets & sample custom overlays
• src/ ← core proxy code (threads, WebSocket server, LiveAPI client, protobuf events)
• webapi-config/ ← WebView2 GUI solution for configuration
Key Components and Their Roles
• Game LiveAPI WebSocket Client (src/http_get_thread.cpp, livedata.cpp)
• Event Processing Core (src/events/*.pb.cc/.pb.h, duplicated in threads, filters, shared_context)
• Local HTTP Server for static files (htdocs) and WebSocket Server for event push (websocket_server.cpp/thread.cpp)
• dump2json tool for offline event dumps
• WebView2-based Admin GUI (webapi-config/main_window.cpp + htm/css/js from htdocs/webapi-config.*)
proxy’s HTTP_GET_THREAD connects, decodes, forwards events into the Event Processing Core.
3. Core uses multiple worker threads (duplication_thread, filedump, local_thread) to buffer, log, dump, or transform events.
4. WebSocket Server thread broadcasts processed events to all connected frontends (OBS browser, Admin GUI).
Architectural Patterns and Principles
• Modular, thread-per-responsibility (producer, consumer, logger, WebSocket broadcaster).
• Publisher–Subscriber pattern: event core publishes to WebSocket clients and file dump.
• Separation of concerns:
• Core C++ engine handles I/O, processing, network.
• Web frontend handles presentation and customization.
• GUI handles configuration and live control.
• No external dependencies: entirely local, minimal external network.