Skip to content
Stefano Balietti edited this page Oct 28, 2020 · 5 revisions

Digital Ocean Mini FAQ

  • How do I login into my server?

You will need to open an SSH (Secure SHell). Then you type:

ssh root@my_server_address
  • What is the address of my server?

You can find it in your Digital Ocean dashboard.

  • How do I upload my game to the server?

The easiest one is to use git. Upload your code to a git repository (e.g., github or bitbucket) and then pull the code from the repository into the games directory of your nodeGame server.

Alternatively, you can look into bash commands such as scp or rsync.

  • How do I start my game?

First of all, you may want to remove the demo game:

rm -r nodegame-vXXX/games/ultimatum

where XXX is the actual version of nodeGame installed.

Then you need to restart nodeGame server. From the nodeGame installation folder type:

pm2 delete launcher
pm2 start launcher.js -- --default yourGameName
  • What is pm2 and why should I use it?

Pm2 is a process manager: it makes sure the server is running even after you close the terminal and it will automatically restart it in case of a fatal error. It is recommended that you launch your node server with pm2.

  • OK, I used pm2, but where is the output of my server now?

Pm2 saves the logs under ~/.pm2/logs.

You can find more information about pm2 here:

http://pm2.keymetrics.io/docs/usage/quick-start/

  • Why do I see a blank page if I try to connect to my game?

You might have specified the wrong channel name (or no channel at all). This may happen happen, for example, if you manually copy your game from an existing directory.

To fix the blank screen, open file public/js/index.js and find the line containing node.connect. Make sure that the argument passed to the connect method matches the name of your channel. The name of the channel is specified in file channel/channe.settings.js and it usually matches the name of your game. For example, if your game is named ultimatum, the name of the channel would be /ultimatum/; so, the correct line should be: node.connect('/ultimatum').

  • Why do I get a "Bad Gateway Error"?

This is a generic Nginx error meaning that something went wrong with the nodeGame server. Here are a list diagnostic steps:

  • Check if nodeGame is still running. Ssh into the droplet and type pm2 info launcher.

  • Inspect the pm2 logs for a possible cause of error in ~/.pm2/logs.

  • Remember to launch your game with pm2, otherwise the server will die if you close the shell or lose Internet connection.

  • How do I update the Droplet to the newest version of nodeGame?

You can follow these instructions.

Clone this wiki locally