Skip to content

I'm in! #2

@Addyvan

Description

@Addyvan

If you are like me, it's nice to dig around and follow along when source code is provided. There were a couple hurdles getting running on this one so I figured I'd share.

Server side

This is using a newer-ish version node.js 's import syntax so you will need to use nvm to swap over to somewhere around 15.8.0 using nvm. You can install nvm using:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

Once installed:

nvm install 15.8.0

Simon seems to have removed server/package.json. I was able to fill in the blanks and this worked fine for me:

{
  "name": "server",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "gl-matrix": "^3.3.0",
    "socket.io": "^3.1.1"
  },
  "scripts": {
    "start": "node index.mjs"
  }
}

Once you have that set done you can run the following to start the server:

npm install
node index.mjs

Leave this running in a separate terminal.

Client side

Install http-server

sudo npm install -g http-server

Then run a simple http-server to serve up the files. If you don't do this you will get CORS issues.

$ http-server
Starting up http-server, serving ./
Available on:
  http://127.0.0.1:8081
  http://192.168.1.129:8081
  http://10.0.7.10:8081
  http://192.168.96.1:8081
Hit CTRL-C to stop the server

I was able to see the login screen, walk around and kill some monsters named after my username lol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions