Skip to content

[Feature Request] Server Resources sync — allow server owners to publish required client files, downloaded automatically before connect. #414

Description

@staark-dev

Summary

Server owners currently have no official way to distribute required client-side resources (custom ASI plugins, CLEO scripts, textures, models) to players. Players either miss required files and get a degraded experience, or server owners resort to forum posts and manual instructions.
This proposal adds a Server Resources system — similar to FastDL in Garry’s Mod or resource sync in FiveM — directly into the open.mp launcher.

Problem

•	Servers that require custom client mods have no reliable distribution channel
•	Players join with missing or outdated files, causing visual glitches or missing features
•	Server owners resort to Discord pins, forum posts, or third-party installers
•	No integrity checking — players may have modified local files that differ from the server’s expected versions

Proposed Solution

A two-part system: a resource manifest published by the server, and automatic sync in the launcher before connecting.

Part 1 — Resource Manifest (server side)

Each server optionally publishes a JSON manifest at a URL declared in its SA:MP rules (via AddServerRule in Pawn):

// On the server (gamemode)
AddServerRule("omp_resources", "https://cdn.myserver.com/resources.json");
```

The manifest format:
```
{
  "version": 1,
  "resources": [
    {
      "name": "myserver_hud.asi",
      "url": "https://cdn.myserver.com/files/myserver_hud.asi",
      "sha256": "a3f1c2...",
      "version": "1.2.0",
      "destination": "modloader",
      "required": true
    },
    {
      "name": "myserver_vehicles.txd",
      "url": "https://cdn.myserver.com/files/myserver_vehicles.txd",
      "sha256": "b7e9d1...",
      "version": "3.0.1",
      "destination": "models/txd",
      "required": false
    }
  ]
}
```

### Fields:
	•	destination — relative path inside GTA:SA folder (modloader, cleo, models/txd, models/dff)
	•	required — if true, launcher warns and blocks connecting if file is missing or hash doesn’t match
	•	sha256 — integrity check, compared against local file hash before downloading

##Part 2 — Launcher behavior (client side)

When a player clicks Connect on a server that has omp_resources in its rules:
	1.	Launcher fetches the manifest URL
	2.	Compares each resource against local files (path + SHA-256 hash)
	3.	Shows a dialog:
	•	✓ All files up to date → connect immediately
	•	⬇ N files need download → show list + “Download and Connect” button
	•	Required files missing → “Download required” (can’t skip), optional files can be skipped
	4.	Downloads missing/outdated files with a per-file progress bar
	5.	Files are placed in the correct GTA:SA subdirectory
	6.	Launcher proceeds to connect
Optional UX addition: a dedicated Server Resources sub-tab in the server detail panel showing the resource list and local sync status at a glance.

##Security considerations

Only files declared in the manifest are downloaded
	•	SHA-256 hash verification before the file is moved into place — corrupted or tampered downloads are rejected
	•	Files are placed only in declared destination paths within the GTA:SA folder — no arbitrary write paths
	•	The manifest URL must use HTTPS
	•	Server owners are responsible for their CDN content — this is consistent with how SA:MP already works (servers can inject Pawn scripts into clients)

##Why this belongs in the launcher

The launcher is the only component that:
	•	Knows the local GTA:SA path
	•	Has file system access before the game starts
	•	Already queries server rules via UDP before connecting
	•	Has the user’s attention at the exact right moment (pre-connect)
This cannot be done inside the game client itself without significant complexity.


##Implementation notes

Manifest URL read from server rules (already fetched during server query)
	•	File download: Rust reqwest crate (already in Cargo.toml as a dependency)
	•	Hash verification: Rust sha2 crate
	•	Frontend: modal dialog + progress bars in React, consistent with existing join modal
	•	No new backend infrastructure required for server owners — any static file hosting works (CDN, GitHub Releases, S3, even a simple nginx)

###Prior art

Garry’s Mod FastDL — server-declared file server, client downloads before map load
	•	FiveM / RedM — full resource streaming system built into the client
	•	Counter-Strike — sv_downloadurl for custom content
	•	MTA:SA — built-in resource download system
All major SA-adjacent multiplayer mods have solved this problem. SA:MP never did. This is an opportunity for open.mp to set a new standard.


## Willingness to contribute

I have a working UI prototype of both the client-side resource sync flow and the owner-side manifest configuration panel. I am willing to implement this and submit a PR. Looking for team feedback on:
	1.	Whether omp_resources server rule is the right mechanism, or if there’s a better hook
	2.	Preferred approach for the download dialog UX
	3.	Any security concerns I may have missed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions