Skip to content

Beginner's Setup Guide

Devin Spikowski edited this page May 12, 2016 · 44 revisions

If you want to run D-Zone for your Discord server, you will need a computer to run the node server, and a web host to put the client files for people to see it. This guide is written for Windows, but much of it should be the same on other systems.

First, you must install Node. I use the LTS release.

To check that you have installed Node properly, open a command prompt and type node -v. It should tell you what version you have just installed. Also run npm -v to ensure this too was installed.

Create a folder somewhere for D-Zone to live. This should probably be an empty folder. Do not download the D-Zone package from GitHub! In the empty folder, right click while holding Shift and choose "Open command window here". You could also browse to the folder manually in CMD if you know how. Then run this:

npm install d-zone

This will take a few minutes. You may see some warnings, this is okay. If you get an error and the package did not install, you may need to download the Visual C++ runtimes from Microsoft. You also may need Python 2.7 installed. If an error tells you it refuses to install as a dependency of itself, you did not read the previous paragraph closely enough.

Rename discord-config-example.json to discord-config.json and insert the login and server info for your Discord server(s). If you are using a BOT account, you only need its token. For a normal account, you only need the email and password. If you don't know your server ID, look in Server Settings > Widget in Discord.

You must specify one default Discord server. You can include multiple servers here, and as long as your bot can connect to them, they will be available for clients to view. You can password-protect a server from being viewed by a client by using the password property (see notes). If you want certain channels to be ignored, you can include the ignoreChannels property, which accepts an array of channel names and ignores any messages in those channels.

Rename socket-config-example.json to socket-config.json and insert the IP and port you want to run the websocket on. If you're going to run the server on your computer, this would be your IP. The port can be almost anything you want, but I recommend 3000. If you're behind a router, you may need to forward this port.

While in the same command prompt window (or in a new one, as long as it's pointed at your D-Zone folder) start the server with npm start or just node index.js

The client files are all contained within the web folder, and need to be built with npm run-script build. After running that, you will have a file called bundle.js in /web/static. Upload everything in the web folder except the script folder to your web host. Do not remove the web folder from the package; the server component requires it.

If everything works, the client should connect to the default server, generate a world, and receive live updates via websocket from the server.

If it's stuck on "Connecting..." make sure that the port in your socket config is open.

If you're having any other problems, you can send me an email or catch me on Discord here: https://discord.gg/0MvHMfHcTKUvE2kC Or, you can send me a friend request on Discord: vegeta897#7583

Remember, this is still being developed! Check back for updates and keep your server up to date with npm update 😀 Remember to re-build the bundle.js and re-upload the web files after updating!

Notes

Respect the privacy of the users in your Discord server. By creating a D-Zone for your server without a password, you are allowing anyone with the URL to view any conversations your bot has permission to see.

The build script creates a minified bundle file with no source mapping, while watch is not minified but is quicker to run and has source mapping. So, watch is good for development and build is good for deployment. If you have no idea what this means, use build

Clone this wiki locally