How k1x78/samp_clone works
samp_clone is a C++20 reimplementation of the SA-MP 0.3.DL multiplayer client and dedicated server. A player starts the client, which initializes the game and network session; the client exchanges game traffic with the server, whose game layer manages players and world state and runs Pawn gamemodes through its VM. The repository also includes server query/RCON, downloadable assets, and client rendering and UI. Edges are limited to relationships shown by excerpts, SOURCE INDEX references, or README statements; unsampled implementation details are left unconnected.
Main entry points: client/main.cpp Client Startup · network_client.hpp Client Network · server/main.cpp Server Startup · game_layer.cpp Server Game Layer
Components 21
Client Runtime
- Client Startup
src/client/main.cpp - Client Settings
src/client/config.h - Client Network
src/client/include/samp/client/network_client.hpp - Client World
src/client/include/samp/client/world_state.hpp - Asset Downloads
src/client/include/samp/client/asset_manager.hpp - Client UI
src/client/chatwindow.h
Server Runtime
- Server Startup
src/server/main.cpp - Server Configuration
src/server/include/samp/server/config.hpp - RakNet Server
src/server/include/samp/server/raknet_server.hpp - Server Game Layer
src/server/game_layer.cpp - Query and RCON
src/server/include/samp/server/query_server.hpp
Pawn Scripting
- Pawn VM
src/pawn/pawn_vm.cpp - Server Natives
src/pawn/natives.cpp
Shared Protocol
- Bitstream
src/protocol/include/samp/proto/bitstream.hpp - Wire Encoding
src/protocol/include/samp/proto/wire.hpp - Reliable Frames
src/protocol/reliability_frame.cpp
Game Rendering
- Game Runtime
src/client/game/game.h - Game Hooks
src/client/game/hooks.h - D3D Hooks
src/client/d3dhook/IDirect3DDevice9Hook.h - Model Preview
src/client/game/model_preview.cpp
Other components
- Player
Connections 25
- Player → Client Startup: starts client
README.md - Client Startup → Client Settings: reads settings
src/client/main.cpp - Client Startup → Game Runtime: initializes game
src/client/main.cpp - Client Startup → Client Network: creates session
src/client/main.cpp - Client Startup → Client UI: initializes UI
src/client/main.cpp - Client Startup → Game Hooks: installs render hook
src/client/main.cpp - Client Startup → Model Preview: creates preview
src/client/main.cpp - Client Network → Bitstream: encodes traffic
src/client/include/samp/client/network_client.hpp - Client Network → Wire Encoding: uses wire format
src/client/include/samp/client/network_client.hpp - Client Network → Reliable Frames: uses reliable frames
src/client/include/samp/client/network_client.hpp - Client Network → Client World: maintains state
src/client/include/samp/client/network_client.hpp - Client Network → Asset Downloads: manages assets
src/client/include/samp/client/network_client.hpp - Client Network → RakNet Server: exchanges game traffic
- Server Startup → Server Configuration: loads configuration
src/server/main.cpp - Server Startup → Server Game Layer: loads gamemode
src/server/main.cpp - Server Startup → RakNet Server: configures network
src/server/main.cpp - Server Startup → Query and RCON: serves queries
src/server/main.cpp - RakNet Server → Server Game Layer: delivers game messages
- Server Game Layer → Pawn VM: runs gamemode
- Server Game Layer → RakNet Server: sends RPCs
- Pawn VM → Server Natives: registers natives
- Server Natives → Bitstream: builds RPC payloads
src/pawn/natives.cpp - Game Runtime → Game Hooks: uses game hooks
- Model Preview → D3D Hooks: uses device hook
src/client/game/model_preview.cpp - Model Preview → Game Runtime: uses game services
src/client/game/model_preview.cpp