Resources
Varion server logic is organized into resources. A resource can contain server code, client scripts, assets, streamed files or a native module integration.
Full field references live on their own pages:
- resource.toml — every resource descriptor and
stream.tomlfield (canonical source). - server.toml — every server configuration key.
This page covers structure and concepts only.
server-data Layout
text
server.toml
resources/
mymode/
resource.toml
server/
client/
cache/
data/
modules/
sdk/
include/What a resource contains
resource.toml— the descriptor (see resource.toml).- Server entry (
main) — onlytype = "js"is executed by the current server. - Client entry (
client-main) andclient-files— delivered to the client via the manifest. stream.toml— streamed game files (see the canonical reference).
Resource Types
| Type | Purpose | Docs |
|---|---|---|
js | Server and/or client JavaScript | JavaScript |
csharp | Server C# (preview, not executed by the current server) | C# |
go | Server Go (preview) | Go |
asset-pack | Static files served over HTTP | resource.toml |
dlc / rpf | Streamed game files | resource.toml |
Only js (with a non-empty main) starts a server host, and the JS host auto-starts for those resources. You do NOT list them in server.toml → modules — the modules/loadModules key has nothing to do with running JavaScript.
Selection and dependencies
server.toml→resources: an empty list loads EVERY subfolder ofresourcesDirthat has aresource.toml(resources withenabled = falseare skipped). A non-empty list loads exactly those folders by exact name, in the given order. Wildcards (*,dir/*) are not expanded in this list.- Dependencies are declared in
deps(aliasdependencies) and published in the manifest, but the current loader does not reorder resources by them — order comes from theresourceslist. - Client permissions
required-permissions/optional-permissionsmay appear in descriptors, but the current server does not parse them (reserved).
Resource config
js
// server
const cfg = varion.getResourceConfig();
// client
const cfg = varion.getResourceConfig('mymode');