Clone this repo:

git clone https://www.tausquared.net/mc4.git
Files
file.gitignore
file.nojekyll
fileLICENSE
textREADME.md
textTODO.md
fileapi.js
filecollision.js
fileconfig.js
filecontrols.js
filecraft.js
filedebug.js
filedump.js
fileentity.js
filegeometry.js
fileicon.js
fileindex.html
fileinventory.js
fileitem.js
folderlib
filelight.js
filemain.css
filemain.js
filemap.js
filemapgen.js
filemenu.js
filemeshgen-worker.js
filemeshgen.js
foldermods
filemods.js
filenode.js
imageplay-button.png
fileplayer.js
filerenderer.js
folderserver
fileserver-common.js
fileserver-local.js
folderserver-py
fileserver-remote.js
folderserverlist
filetexture.js
foldertextures
foldertools
fileui-inv.js
fileui.css
fileui.js
fileutil.js

README.md

mc4

Multiplayer, browser-based voxel building game inspired by Minetest

Play ← try it out!

Gameplay quick reference

Keys

Commands

License

The web client is licensed under GPLv3+, and the server is AGPLv3+. See LICENSE and the top of each source code file for license information. Library and asset license files are spread throughout the source tree, links are listed below.

Server

Compiling

Install build dependencies:

# apt-get install make g++ libwebsocketpp-dev libboost-dev libsqlite3-dev libssl-dev

If your distro doesn't package libwebsocketpp-dev, grab it from here and compile the server with something like:

$ CPPFLAGS="-I/path/to/websocketpp-x.x.x/" make -j4

The server has optional TLS support, which is strongly recommended for production use (the client-server protocol relies on it for security). If you're running locally or just testing, this is not necessary. The decision as to whether or not to use TLS must be made at compile time.

Compile without SSL/TLS enabled (recommended for testing or local use):

$ make -j4

Compile with SSL/TLS enabled (strongly recommended for production use):

$ CPPFLAGS=-DTLS make -j4

Any time you recompile with different CPPFLAGS, be sure to make clean first.

Running

The server's runtime dependencies are libsqlite3 and libssl1.1, but these will have been installed alongside the build dependencies.

The server can be configured using an ini file (see config_example.ini) or on the command line. For example:

$ ./mc4-server --config-file config_example.ini
$ ./mc4-server -o server.port=8081
$ ./mc4-server --config-file config_example.ini -o "server.motd=-- Welcome to the server.\n-- Have a nice day."

Note that command line options are processed in the order given, so if you want to override an option from the config file, put your override after the config file.

By default, the server will run on port 8080 and store data to an SQLite database in test_map.sqlite.

$ ./mc4-server

If you're using TLS, take a look at config_example.ini and set the appropriate options pointing to certificate files and such.

Deploying

If you're more serious about running a server, take a look at the resources in server/deploy/

Libraries/assets/etc.

Libraries (client)

Libraries (server)

Assets

NOTICE

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See notices
at the top of each source code file for more information.

The game will probably work. It might stop working. It might have serious security vulnerabilities. No guarantees. (But if you do notice anything, please file an issue and/or pull request.)