# multitheftauto/multitheftauto-archived architecture

> Architecture diagram of the GitHub repository multitheftauto/multitheftauto-archived, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/multitheftauto/multitheftauto-archived
- Repository: https://github.com/multitheftauto/multitheftauto-archived

## Overview

This repository implements Multi Theft Auto: a multiplayer modification for Grand Theft Auto: San Andreas, with a client, dedicated server, Lua scripting, game integration, and GUI. The intended user workflow is to launch the client, connect to a server, load a resource, and experience synchronized gameplay; only some internal links in that flow are evidenced by the excerpts. The server-side Lua manager visibly creates script VMs and registers APIs, while the client engine Lua definitions visibly perform model-loading operations. The README is empty, so capability coverage is based on the tree and source index; unsampled runtime connections are omitted or marked unverified.

Main entry points: [`MTA10/core/CCore.cpp`](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/core/CCore.cpp) (Client core), [`MTA10/game_sa/CGameSA.cpp`](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CGameSA.cpp) (Game API), [`MTA10/mods/deathmatch/logic/CClientGame.cpp`](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/mods/deathmatch/logic/CClientGame.cpp) (Client game logic), [`MTA10_Server/mods/deathmatch/Server.cpp`](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/Server.cpp) (Dedicated server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Client and core"]
  node_loader["Client loader<br/>[Main.cpp]"]
  node_clientcore["Client core<br/>[CCore.cpp]"]
  node_chat["Chat<br/>[CChat.cpp]"]
  node_crash["Crash handling<br/>[CrashHandler.cpp]"]
  node_gui["GUI toolkit<br/>[CGUI_Impl.h]"]
  node_tcpmanager["TCP socket manager<br/>[CTCPManager.cpp]"]
end

subgraph group_game["Game integration"]
  node_gameapi["Game API<br/>[CGameSA.cpp]"]
  node_entities["Game entities<br/>[CEntitySA.cpp]"]
  node_camera["Camera<br/>[CCameraSA.h]"]
  node_ped["Pedestrian<br/>[CPedSA.cpp]"]
  node_playerinfo["Player state<br/>[CPlayerInfoSA.h]"]
  node_gamepools["Game pools<br/>[CPoolsSA.h]"]
  node_handling["Vehicle handling"]
end

subgraph group_clientplay["Client gameplay"]
  node_clientgame["Client game logic<br/>[CClientGame.cpp]"]
  node_clientresources["Client resources"]
end

subgraph group_server["Server runtime"]
  node_server["Dedicated server<br/>[Server.cpp]"]
  node_serverresources["Server resources"]
  node_servermap["Map management<br/>[CMapManager.cpp]"]
  node_serverhandling["Handling manager"]
  node_tcpserver["Server socket manager"]
end

subgraph group_scripting["Lua scripting"]
  node_clientlua["Client Lua engine API"]
  node_serverlua["Server Lua manager<br/>[CLuaManager.cpp]"]
  node_moduleapi["Lua module API"]
end

node_player(("Player"))

node_player -.->|"launches"| node_loader
node_loader -.->|"starts"| node_clientcore
node_player -.->|"uses"| node_clientcore
node_clientcore -.->|"dispatches"| node_clientgame
node_clientgame -.->|"loads resources"| node_clientresources
node_clientresources -.->|"exposes engine API"| node_clientlua
node_clientlua -.->|"loads game assets"| node_gameapi
node_clientgame -.->|"controls game"| node_gameapi
node_gameapi -.->|"uses entities"| node_entities
node_gameapi -.->|"uses camera"| node_camera
node_gameapi -.->|"uses peds"| node_ped
node_gameapi -.->|"reads state"| node_playerinfo
node_gameapi -.->|"uses pools"| node_gamepools
node_server -.->|"manages resources"| node_serverresources
node_serverresources -.->|"starts scripts"| node_serverlua
node_serverlua -->|"implements interface"| node_moduleapi
node_serverlua -.->|"registers map APIs"| node_servermap
node_server -.->|"manages handling"| node_serverhandling
node_server -.->|"uses sockets"| node_tcpserver
node_clientcore -->|"creates sockets"| node_tcpmanager
node_clientcore -.->|"provides chat"| node_chat
node_clientcore -.->|"uses GUI"| node_gui
node_clientcore -.->|"handles failures"| node_crash
node_clientgame -.->|"applies handling"| node_handling

click node_loader "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/loader/Main.cpp"
click node_clientcore "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/core/CCore.cpp"
click node_chat "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/core/CChat.cpp"
click node_crash "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/core/CrashHandler.cpp"
click node_gameapi "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CGameSA.cpp"
click node_entities "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CEntitySA.cpp"
click node_camera "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CCameraSA.h"
click node_ped "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CPedSA.cpp"
click node_playerinfo "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CPlayerInfoSA.h"
click node_gamepools "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CPoolsSA.h"
click node_handling "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CHandlingManagerSA.cpp"
click node_gui "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/gui/CGUI_Impl.h"
click node_clientgame "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/mods/deathmatch/logic/CClientGame.cpp"
click node_clientresources "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/mods/deathmatch/logic/CResourceManager.cpp"
click node_clientlua "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Engine.cpp"
click node_server "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/Server.cpp"
click node_serverresources "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/logic/CResourceManager.cpp"
click node_servermap "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/logic/CMapManager.cpp"
click node_serverhandling "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/logic/CHandlingManager.cpp"
click node_serverlua "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/logic/lua/CLuaManager.cpp"
click node_moduleapi "https://github.com/multitheftauto/multitheftauto-archived/blob/master/Shared/publicsdk/include/ILuaModuleManager.h"
click node_tcpmanager "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/core/tracking/CTCPManager.cpp"
click node_tcpserver "https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/core/sockets/CTCPServerSocketImplManager.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loader,node_clientcore,node_chat,node_crash,node_gui,node_tcpmanager toneBlue
class node_gameapi,node_entities,node_camera,node_ped,node_playerinfo,node_gamepools,node_handling toneAmber
class node_clientgame,node_clientresources toneMint
class node_server,node_serverresources,node_servermap,node_serverhandling,node_tcpserver toneRose
class node_clientlua,node_serverlua,node_moduleapi,node_player toneIndigo
```

## Components

### Client and core

- [Client loader](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/loader/Main.cpp): `MTA10/loader/Main.cpp`
- [Client core](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/core/CCore.cpp): `MTA10/core/CCore.cpp`
- [Chat](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/core/CChat.cpp): `MTA10/core/CChat.cpp`
- [Crash handling](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/core/CrashHandler.cpp): `MTA10/core/CrashHandler.cpp`
- [GUI toolkit](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/gui/CGUI_Impl.h): `MTA10/gui/CGUI_Impl.h`
- [TCP socket manager](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/core/tracking/CTCPManager.cpp): `MTA10/core/tracking/CTCPManager.cpp`

### Game integration

- [Game API](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CGameSA.cpp): `MTA10/game_sa/CGameSA.cpp`
- [Game entities](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CEntitySA.cpp): `MTA10/game_sa/CEntitySA.cpp`
- [Camera](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CCameraSA.h): `MTA10/game_sa/CCameraSA.h`
- [Pedestrian](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CPedSA.cpp): `MTA10/game_sa/CPedSA.cpp`
- [Player state](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CPlayerInfoSA.h): `MTA10/game_sa/CPlayerInfoSA.h`
- [Game pools](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CPoolsSA.h): `MTA10/game_sa/CPoolsSA.h`
- [Vehicle handling](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/game_sa/CHandlingManagerSA.cpp): `MTA10/game_sa/CHandlingManagerSA.cpp`

### Client gameplay

- [Client game logic](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/mods/deathmatch/logic/CClientGame.cpp): `MTA10/mods/deathmatch/logic/CClientGame.cpp`
- [Client resources](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/mods/deathmatch/logic/CResourceManager.cpp): `MTA10/mods/deathmatch/logic/CResourceManager.cpp`

### Server runtime

- [Dedicated server](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/Server.cpp): `MTA10_Server/mods/deathmatch/Server.cpp`
- [Server resources](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/logic/CResourceManager.cpp): `MTA10_Server/mods/deathmatch/logic/CResourceManager.cpp`
- [Map management](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/logic/CMapManager.cpp): `MTA10_Server/mods/deathmatch/logic/CMapManager.cpp`
- [Handling manager](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/logic/CHandlingManager.cpp): `MTA10_Server/mods/deathmatch/logic/CHandlingManager.cpp`
- [Server socket manager](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/core/sockets/CTCPServerSocketImplManager.cpp): `MTA10_Server/core/sockets/CTCPServerSocketImplManager.cpp`

### Lua scripting

- [Client Lua engine API](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Engine.cpp): `MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Engine.cpp`
- [Server Lua manager](https://github.com/multitheftauto/multitheftauto-archived/blob/master/MTA10_Server/mods/deathmatch/logic/lua/CLuaManager.cpp): `MTA10_Server/mods/deathmatch/logic/lua/CLuaManager.cpp`
- [Lua module API](https://github.com/multitheftauto/multitheftauto-archived/blob/master/Shared/publicsdk/include/ILuaModuleManager.h): `Shared/publicsdk/include/ILuaModuleManager.h`

### Other components

- **Player**

## Connections

- Player → Client loader: launches
- Client loader → Client core: starts
- Player → Client core: uses
- Client core → Client game logic: dispatches
- Client game logic → Client resources: loads resources
- Client resources → Client Lua engine API: exposes engine API
- Client Lua engine API → Game API: loads game assets
- Client game logic → Game API: controls game
- Game API → Game entities: uses entities
- Game API → Camera: uses camera
- Game API → Pedestrian: uses peds
- Game API → Player state: reads state
- Game API → Game pools: uses pools
- Dedicated server → Server resources: manages resources
- Server resources → Server Lua manager: starts scripts
- Server Lua manager → Lua module API: implements interface (evidence: `MTA10_Server/mods/deathmatch/logic/lua/CLuaManager.cpp`)
- Server Lua manager → Map management: registers map APIs
- Dedicated server → Handling manager: manages handling
- Dedicated server → Server socket manager: uses sockets
- Client core → TCP socket manager: creates sockets (evidence: `MTA10/core/tracking/CTCPManager.cpp`)
- Client core → Chat: provides chat
- Client core → GUI toolkit: uses GUI
- Client core → Crash handling: handles failures
- Client game logic → Vehicle handling: applies handling
