Dimensions is: A routing service that can also load balance connections. For use with Terraria Servers.
Follow the link and download either version. https://nodejs.org/en/
Download the plugin and put it in each Terraria Server for use with Dimensions
- Download the latest release and extract it to its own folder
- Open a cmd prompt/terminal at the folder and execute the command
npm install --only=production
(it may take a bit to finish) - Copy the file "config.js.example" and rename it to "config.js" and edit it to your specifications (Config Wiki)
- To start Dimensions execute
npm run start
Download and install Redis for your OS
Redis is used for the Pub/Sub for detached reloading. If you do not care for this, you do not need to install redis.
- Set enabled to true in the config for the redis option
- To reload changes to the cmd handlers, packet handlers, config or extensions, without restarting Dimensions
- Run
node dimensions_cli.js
- Reload Config:
reload
- Reload Command Handlers:
reloadcmds
- Reload Packet Handlers:
reloadhandlers
- Reload Extensions:
reloadplugins
- Reload Config:
- The responses for each command currently are only output by each Dimensions instance rather than in the CLI
- Run
If you intend to modify Dimensions in any way, be it for your own use or to make minor changes, it is recommended that you modify the original Typescript. This will not only provide you with more safety regarding changes, but the original source is likely to be more understandable and you can merge changes from this repo using git.
- Clone this repo
cd
into the new directory- run
npm install
- There are a few scripts in the package.json
- to build (and test)
npm run build
this will transpile the ts files to js, run the tests and put all output js files into a build directory - to build then run
npm run bstart
this will build and then run the index.js in the build directory - to start without building run
npm run start
- to build (and test)
Dimensions uses the latest Typescript (v2) and uses the strict null checking. When editing and building, it is important to use these features when developing to avoid issues that would otherwise have been caught by the transpiler.
To build an extension:
npm init
in a new folder to initialise itnpm i dimensions@npm:@popstarfreas/dimensions
, this installs dimensions as a dependency- Have a look at an existing extension or the abstract extension class to see a template for where to start
Thanks to all who have financially supported development:
- OFF (Teeria; http://teeria.eu/)
- Devi (TerraPix)
- Anzhelika (Novux; http://novux.ru)
- Ricko (Red Bunny; https://steamcommunity.com/groups/redbunnybr)