voxels-scripting-server v0.9.11
Self-hosted Voxels.com Scripting Server.
A package to allow people to create their own persistent scripting server. This module exports two objects:
- Method
makeVSS(); This function returns a promise containing the WebSocketServer when it has successfully started. - Object
expressAppwhich is the expressappobject. See the express npm module documentation.
How to run your own server
Run
npm iImport
makeVSSand enter a few lines of code: Usingimport
import {makeVSS} from 'voxels-scripting-server'
makeVSS(670).then((wss) => {
if (wss) {
console.log("Websocket started");
} else {
console.error("Websocket did not start");
}
});Using require:
const vss =require("voxels-scripting-server");
vss.default.makeVSS(670).then((wss) => {
if (wss) {
console.log("Websocket started");
} else {
console.error("Websocket did not start");
}
});There is a demo on repl.it: https://replit.com/@Benjythebee/testCryptovoxelsserver#index.js
In the examples above, replace
670with the parcel id or space id you want to create a server for.Once your server setup, go to your parcel page on Voxels.com and set
Hosted scriptto true;Then set the host address to
wss://[The Address of server]/, Hit save.
Development
Clone the repo
npm run test:serverwill run a quick test server inclient/serverusing the source code.npm run test:clientwill run a quick test client inclient/client_test.ts.
Contributing
Create a branch and do your changes
Make sure your code is formatted using
npm run formatAlso make sure your code builds using
npm run buildCreate a Pull request at https://github.com/cryptovoxels/Voxels-Scripting-Server .
todo:
- Introduce ability to interconnect parcels.
- Better tests
Any ideas are welcomed