Skip to content

For developers

Uploading a script

Packaging and publishing MafiaHub resources (Arcane MP, Kingdoms Connected, Mafia 2 Online, Fallout MP).

Prepare the package

Pack the resource folder the server loads (or everything inside it) as .zip, .rar or .7z. Its package.json needs a mafiahub block:

package.json
"mafiahub": {
  "serverScripts": ["dist/server.js"],
  "clientScripts": ["dist/client.js"],
  "files": ["dist/client.js"]
},
"latch": {
  "ignore": ["config.json"]
}
FileWhat happens in the package
serverScripts and other server .js/.jsonEncrypted; only runs with a valid license.
clientScripts, sharedScripts, filesThe game sends these to players, so they can't be encrypted. Their JavaScript is obfuscated instead (you can turn this off).
Anything in latch.ignoreStays readable (for example a config the server owner should edit).
node_modules/, images, soundsStay readable.
.ts, .mapNever go into the package; your source stays private.
  • Upload the compiled JavaScript (for example dist/). You don't need src/.
  • To leave a server file readable, tick it in the preview or list it under latch.ignore. The main server scripts always stay encrypted.
  • Resources in resourceDependencies aren't bundled; server owners install those separately.
  • Limits: the archive can be up to 100 MB, and up to 300 MB and 6,000 files once extracted. Password-protected archives can't be read.
  • Programs and native files (.exe, .dll, .node…) aren't blocked, but they're flagged for the team to review.

Upload and publish

  1. 1In your workspace, click Upload script and choose the archive. Your browser opens it and shows what happens to each file.
  2. 2If the preview shows a problem (for example serverScripts is empty or a listed file is missing), fix it before publishing.
  3. 3Fill in the name, description, category, ecosystem and version number (like 1.0.0).
  4. 4Click Publish. The package is encrypted; once it's ready you can grant access. Saving as a draft doesn't publish it.

New versions

Upload a new version from the script's page. The version number has to be higher than the last one. If you write a changelog, everyone with access sees it with the update. You can withdraw an old version to hide it from downloads; servers already running it keep running.

Pro and up: if the newest version has a problem, roll it back from the script's page. It's withdrawn, and everyone who downloaded it is told to go back to the previous version. Servers keep running what they have until they replace it.