# lilithrainbows/habboairplus architecture

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

- Interactive diagram: https://gitdiagram.com/lilithrainbows/habboairplus
- Repository: https://github.com/lilithrainbows/habboairplus

## Overview

##### Project type and purpose
- This is a modified Habbo Hotel client delivered as an Adobe AIR SWF (HabboAir.swf) plus a README of enabled commands and features.
- It’s neither a full‐stack app nor a microservice but rather a client‐side plugin/hack tool that injects custom behavior into an existing Flash/AIR application.

##### File structure
- Top-level files:
- HabboAir.swf – the patched AIR/Flash binary you distribute
- README.txt – documentation of commands and features
- No source folders; all logic is embedded in the SWF.  Build/deploy is simply packaging the SWF for AIR.

##### Insights from README
- Dozens of “:commands” showing a command interpreter built into the SWF.
- Many “forced mode” UI & rendering tweaks, network‐side operations “USE AT OWN RISK,” indicating hooks into both client rendering and server messaging code.
- Local SWF inclusions (local_include folder) for custom furni assets.

##### Main architectural components
a. Adobe AIR/Flash runtime
b. Original Habbo client modules (network, UI, room engine, avatar engine)
c. Injection/patch layer inside HabboAir.swf
d. Command interpreter and parser
e. Feature modules (lighting, backlight, adblock, chat tweaks, physics overrides, etc.)
f. Local storage/config – saving variables, hotkeys, SWF includes
g. External tooling (JPEXS) used during development to decompile & patch the SWF

##### Relationships and interactions
- The AIR runtime hosts the patched SWF which wraps the original Habbo client classes.
- On load, the injection layer patches or overrides methods in core modules (rendering, input handling, network messaging).
- The command interpreter listens to chat input or hotkeys, dispatches to feature modules.
- Feature modules manipulate UI/render state or intercept outgoing/incoming messages.
- Local storage persists user settings between sessions.
- If a local SWF is found in local_include, the loader module dynamically inserts it into the room engine.

##### Architectural patterns & principles
- Decorator/Monkey-patching: core classes are wrapped or replaced at runtime.
- Plugin pattern: each command or feature is a self-contained handler module.
- Single responsibility: interpreter vs. individual feature handlers vs. storage.
- Loose coupling: commands invoke features via a central dispatcher.

- Clear labels for: AIR runtime, Original Habbo SWF, Injection layer, Interpreter, Feature modules, Local storage, External loader
– Runtime/Platform (e.g., rounded rectangle)
– Injection & interpreter (highlighted)

## Diagram (Mermaid)

```mermaid
flowchart TD
    AIR["Adobe AIR/Flash Runtime"]:::runtime
    AIR --> SWF["Patched SWF\n(HabboAir.swf)"]:::injection

    subgraph "Patched SWF Components"
        direction TB
        Original["Original Habbo Client Modules"]:::original
        Inject["Injection/Patch Layer"]:::injection
        Interpreter["Command Interpreter & Parser"]:::interpreter

        subgraph "Feature Modules"
            direction TB
            Lighting["Lighting"]:::feature
            Backlight["Backlight"]:::feature
            Adblock["Adblock"]:::feature
            ChatTweaks["Chat Tweaks"]:::feature
            Physics["Physics Overrides"]:::feature
        end

        Storage["Local Storage/Configuration"]:::storage
        Loader["Dynamic Local SWF Loader"]:::storage
        Docs["Documentation of Commands\n(README.txt)"]:::docs
    end

    Original -->|"wrapped by"| Inject
    Inject -->|"patches"| Original

    Interpreter -->|"dispatch"| Lighting
    Interpreter -->|"dispatch"| Backlight
    Interpreter -->|"dispatch"| Adblock
    Interpreter -->|"dispatch"| ChatTweaks
    Interpreter -->|"dispatch"| Physics

    Lighting -->|"modify UI/render"| Original
    Backlight -->|"modify UI/render"| Original
    Adblock -->|"intercept network"| Original
    ChatTweaks -->|"modify chat UI"| Original
    Physics -->|"override physics"| Original

    Interpreter -->|"load includes"| Loader
    Storage -->|"persist settings"| Interpreter
    Interpreter -->|"read settings"| Storage

    Docs -.-> Interpreter

    click SWF "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Original "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Inject "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Interpreter "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Lighting "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Backlight "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Adblock "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click ChatTweaks "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Physics "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Storage "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Loader "https://github.com/lilithrainbows/habboairplus/blob/main/HabboAir.swf"
    click Docs "https://github.com/lilithrainbows/habboairplus/blob/main/README.txt"

    classDef runtime fill:#a2d2ff,stroke:#000
    classDef original fill:#adb5bd,stroke:#000
    classDef injection fill:#ffe066,stroke:#000
    classDef interpreter fill:#ffadad,stroke:#000
    classDef feature fill:#caffbf,stroke:#000
    classDef storage fill:#bde0fe,stroke:#000
    classDef docs fill:#e9ecef,stroke:#000
```
