# h4tiux/pubg2017ps architecture

> Architecture diagram of the GitHub repository h4tiux/pubg2017ps, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/h4tiux/pubg2017ps
- Repository: https://github.com/h4tiux/pubg2017ps

## Overview

##### Project Type and Purpose
- This is an open-source private server for PUBG 2017 (“PUBG2017PS”).
- It injects into the official Unreal Engine 4 game binary, loads a mod-loader (UE4SS), and hosts a custom server so players can run and join a private match locally.

##### File Structure
- Top-level:
– Mods/                      ← directory of individual Lua-based game mods
– RUN_LocalServer.bat, RUN_LocalClientJoin.bat
– UE4SS-settings.ini, UE4SS.log, imgui.ini
– liveview/, watches/       ← debugging extensions (filters, watches)
- Mods/ substructure:
– Each mod in Mods/<ModName>/Scripts/main.lua
– Shared code in Mods/shared/UEHelpers and Mods/shared/jsbProfiler
– OGServerProxy contains a “dlls” folder (native proxy library)
– mods.json and mods.txt define load order and metadata
- Configuration and entry points:
– Batch files kick off the game in server or client mode with specific flags
– INI files configure UE4SS mod-loader, ImGui overlay, and logging

##### Extract README Insights
- Purpose: Turn the official PUBG binary into a local private server + client.
- Usage: Copy files into TslGame/Binaries/Win64, then run batch scripts.

##### Main Components & Interactions
a. Game Executable
– Unreal Engine 4 “TslGame.exe”
– Launch modes: headless server vs. client join
b. UE4SS Mod-Loader (Injected DLL)
– Hooks into game startup, reads UE4SS-settings.ini
– Loads all Mods from Mods/ directory
c. Mods (Lua Scripts + Native DLL)
– Individual Lua mods (ActorDumper, ConsoleCommands, SplitScreen, etc.)
– Shared modules (UEHelpers, jsbProfiler) referenced by each mod
– OGServerProxy’s DLL implements network redirection to private server
d. Configuration & Debugging
– INI files (UE4SS, imgui) control overlays & logging
– liveview/ and watches/ folders supply real-time debugging filters
e. Batch Scripts
– RUN_LocalServer.bat: launches TslGame.exe in server mode (-nullrhi -nosound)
– RUN_LocalClientJoin.bat: launches client and connects to localhost
f. Network Flow
– Client instance ↔ OGServerProxy ↔ Private server logic (inside TslGame)
– No external internet connection

##### Architectural Patterns & Design Principles
- Plugin/Mod architecture: UE4SS acts as a host, mods are independent Lua modules
- Shared libraries: common utilities in Mods/shared minimize code duplication
- Proxy pattern: OGServerProxy DLL intercepts and reroutes network calls
- Separation of concerns: batch scripts handle environment setup; INI files manage configuration; Lua scripts implement features

##### Final Checklist
- Components: TslGame.exe, UE4SS mod-loader, each mod, shared libs, OGServerProxy DLL, Private Server logic, batch scripts, config files, debug tooling
- Labels: concise but descriptive, include file/folder names where relevant

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Configuration & Launch Scripts
    subgraph "Launch & Configuration" 
        direction TB
        RUN_Server["RUN_LocalServer.bat"]:::script
        RUN_Client["RUN_LocalClientJoin.bat"]:::script
        UE4SSSettings["UE4SS-settings.ini"]:::config
        imguiIni["imgui.ini"]:::config
        UE4SSLog["UE4SS.log"]:::config
        modsJson["mods.json"]:::config
        modsTxt["mods.txt"]:::config
    end

    %% Core Executable and Loader
    TslGame["TslGame.exe"]:::core
    UE4SS["UE4SS Mod-Loader (DLL)"]:::core

    %% Mods Loaded by UE4SS
    subgraph "Lua Mods" 
        direction TB
        ActorDumper["ActorDumperMod"]:::script
        BPML_Generic["BPML_GenericFunctions"]:::script
        BPModLoader["BPModLoaderMod"]:::script
        CheatManager["CheatManagerEnablerMod"]:::script
        ConsoleCommands["ConsoleCommandsMod"]:::script
        ConsoleEnabler["ConsoleEnablerMod"]:::script
        Keybinds["Keybinds"]:::script
        LineTrace["LineTraceMod"]:::script
        SplitScreen["SplitScreenMod"]:::script
        LuaProfiler["jsbLuaProfilerMod"]:::script
        OGServerProxyLua["OGServerProxyLua"]:::script
        subgraph "Shared Utilities"
            direction TB
            UEHelpers["UEHelpers.lua"]:::script
            jsbProfiler["jsbProfi.lua"]:::script
        end
    end

    %% Native Proxy and Network
    subgraph "Network & Proxy"
        direction TB
        OGProxyDLL["OGServerProxy DLLs"]:::native
        PrivateServer["Private Server Logic"]:::network
        Cloud[("Network Cloud")]:::network
    end

    %% Debugging Overlays
    subgraph "Debug Tooling"
        direction TB
        ImGuiOverlay["ImGui Overlay"]:::debug
        liveview["liveview/filters.meta.json"]:::debug
        watches["watches/watches.meta.json"]:::debug
    end

    %% Connections
    RUN_Server -->|"launch server"| TslGame
    RUN_Client -->|"launch client"| TslGame

    TslGame -->|"inject hook"| UE4SS
    UE4SS -->|"loads mods"| ActorDumper
    UE4SS --> BPML_Generic
    UE4SS --> BPModLoader
    UE4SS --> CheatManager
    UE4SS --> ConsoleCommands
    UE4SS --> ConsoleEnabler
    UE4SS --> Keybinds
    UE4SS --> LineTrace
    UE4SS --> SplitScreen
    UE4SS --> LuaProfiler
    UE4SS --> OGServerProxyLua

    ActorDumper -->|uses| UEHelpers
    BPML_Generic --> UEHelpers
    BPModLoader --> UEHelpers
    CheatManager --> UEHelpers
    ConsoleCommands --> UEHelpers
    ConsoleEnabler --> UEHelpers
    Keybinds --> UEHelpers
    LineTrace --> UEHelpers
    SplitScreen --> UEHelpers
    LuaProfiler --> jsbProfiler
    OGServerProxyLua --> OGProxyDLL

    OGProxyDLL -->|"intercept network"| PrivateServer
    PrivateServer --> Cloud
    OGServerProxyLua --> Cloud

    UE4SSSettings -.->|"configures"| UE4SS
    imguiIni -.->|"configures"| ImGuiOverlay
    UE4SSLog -.->|"logs to"| UE4SS

    ImGuiOverlay --> TslGame
    liveview -.-> ImGuiOverlay
    watches -.-> ImGuiOverlay

    modsJson -.->|"metadata"| UE4SS
    modsTxt -.-> UE4SS

    %% Click Events
    click UE4SSSettings "https://github.com/h4tiux/pubg2017ps/blob/main/UE4SS-settings.ini"
    click imguiIni "https://github.com/h4tiux/pubg2017ps/blob/main/imgui.ini"
    click UE4SSLog "https://github.com/h4tiux/pubg2017ps/blob/main/UE4SS.log"
    click RUN_Server "https://github.com/h4tiux/pubg2017ps/blob/main/RUN_LocalServer.bat"
    click RUN_Client "https://github.com/h4tiux/pubg2017ps/blob/main/RUN_LocalClientJoin.bat"
    click modsJson "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/mods.json"
    click modsTxt "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/mods.txt"
    click ActorDumper "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/ActorDumperMod/Scripts/main.lua"
    click BPML_Generic "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/BPML_GenericFunctions/Scripts/main.lua"
    click BPModLoader "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/BPModLoaderMod/Scripts/main.lua"
    click CheatManager "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/CheatManagerEnablerMod/Scripts/main.lua"
    click ConsoleCommands "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/ConsoleCommandsMod/Scripts/main.lua"
    click ConsoleEnabler "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/ConsoleEnablerMod/Scripts/main.lua"
    click Keybinds "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/Keybinds/Scripts/main.lua"
    click LineTrace "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/LineTraceMod/Scripts/main.lua"
    click SplitScreen "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/SplitScreenMod/Scripts/main.lua"
    click LuaProfiler "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/jsbLuaProfilerMod/Scripts/main.lua"
    click OGServerProxyLua "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/OGServerProxyLua/Scripts/main.lua"
    click UEHelpers "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/shared/UEHelpers/UEHelpers.lua"
    click jsbProfiler "https://github.com/h4tiux/pubg2017ps/blob/main/Mods/shared/jsbProfiler/jsbProfi.lua"
    click OGProxyDLL "https://github.com/h4tiux/pubg2017ps/tree/main/Mods/OGServerProxy/dlls/"

    %% Styles
    classDef core fill:#1f77b4,stroke:#000,color:#fff
    classDef script fill:#2ca02c,stroke:#000,color:#fff
    classDef native fill:#ff7f0e,stroke:#000,color:#fff
    classDef config fill:#ffdb58,stroke:#000,color:#000
    classDef debug fill:#7f7f7f,stroke:#000,color:#fff
    classDef network fill:#9467bd,stroke:#000,color:#fff
    classDef script stroke-dasharray: 2 2
    classDef config stroke-dasharray: 2 2
    classDef debug stroke-dasharray: 2 2
```
