Package Protocol

From RAGE Multiplayer Wiki
Revision as of 04:15, 29 May 2024 by Shr0x (talk | contribs) (package2)

Summary

http://package/ is the protocol for the root folder of client_packages, so http://package/ returns client_packages, makes it easier for you to require files client-side.

When referencing to other files in client_packages, you use

http://package/

For example, a file located in client_packages\index.html can be referred to with

http://package/index.html

A file located in client_packages\my-resource\index.html can be referred to with

http://package/my-resource/index.html

You can also require json files with it http://package/my-resource/beasts.json, so it'll be

const beasts = require('http://package/my-resource/beasts.json')
  • NOTE: JSON Require only works in CEF.

Package2

http://package2/

Similar to package/ but is cached in memory on connection and provides instant access, also packs all CEF resources into a single file (example: if you have loads of files in your cef (images etc) it packs them into a single 30MB file)

Only works if your cef files are stored in client_packages/package2