This is horribly outdated and was written many years before I properly understood how to implement these things. Therefore I would not use this as an example # of the "correct" way of doing this. However there could still be some useful bits in there...somewhere...
This repository is an example of an authoritative game server using node.js, socket.io, and three.js.
- Download this repository into your server's webroot
- Configure a virtual host with the public root set to
/your/servers/webroot/open-browser-fps/client
- Open file
./open-browser-fps/server/index.js
and change the port number of the socketio server to whichever port you want it to run on (the default is 3000) - Open file
./open-browser-fps/client/index.html
and change the following line to point to the address of your new virtual host:
var socket = io('http://local.openbrowserfps.com:3000');
var socket = io('http://your.host.name:your-socketio-port#');
- Browse to
./open-browser-fps/server/
and run commandnodejs index.js
to spin up the socketio server - Open your web browser and navigate to the url you configured for your virtual host
- When the page loads, the command line will log that a new user has connected. You will be able to move around, but you will not see another character.
- Open another browser tab and browse to your url. You will now see the character from your other browser tab.
- There is currently no "shoot" functionality, if anyone tries.
- If I remember correctly, I was in the middle of optimizing peer interpolation when I last left off with this project. If anyone has any suggestions on a better way to handle it please open an issue and let me know.
- If anyone has any feedback on how to improve upon this project I would love to hear what you have to say. Opening an issue would be the best way for now.
- This project is a mash of several other projects and plugins. When I have more time I will track them down and add them to the bottom of this readme. Author's credit remains in comments.