CityRP Documentation Repository

env

Environment Handling Class.

The ENV class handles top level abstractions of gmsv_environ.

Functions

ENV:Get(name) → string?Source ☍

Gets the value of an env-var.

Parameters

  • namestringThe env-var to get

Returns

  1. string?The value found, nil otherwise

Example

ENV:Get("MY_ENV_VAR")
ENV:LoadOverrides()Source ☍

Loads ENV.overridesPath, if present, into ENV.overrides. A client started through Steam can't be handed environment variables, so a local listen server reads them from this file instead. A dedicated server ignores it, so a stray copy on a host can never point a real server at another database.

Tables

ENVSource ☍
ENV.overridesSource ☍

Variables that ENV:Get returns ahead of the process environment, loaded from ENV.overridesPath.

Fields

ENV.__indexSource ☍

Lookup table.

ENV.moduleSource ☍

The loaded gmsv_environ module. A field rather than a captured local, so a unit suite can stand in for it.

ENV.overridesPathSource ☍

The file a local listen server reads its variables from, under the LUA path. Nothing in this repo or cityrp2-cfg creates it.