The server moly-server (crate moly-server-host) stores player documents and answers requests from the game. It is moly's own implementation and has no interface or implementation in common with the original game's servers: it answers only POST /rpc in moly's binary protocol (moly-protocol), every request first declares moly's protocol version, and any other path is answered with 404. The original game client cannot connect to it; it serves only moly's client. It is included in each platform's package. A server-only package, moly-server-<version>-<platform>, is also available for running the server on another machine of your own, for your own moly client to connect to.
The server and the game read the same resources. The listen address, resource directory and save directory are set in the configuration file moly.toml or through the environment variables that override its keys; see the [server] and [resources] keys. For the commands to build and start the server from source, see Native program.
- By default, the server listens on
127.0.0.1:15800, and its control port is127.0.0.1:15801. When it is ready, it prints one line with its address. If a port is already in use, it exits with status 1. - The game connects to the server at
server.url(MOLY_SERVER_URL). If the connection fails, it shows a specific message and does not fall back to an in-process implementation. - The server and the game read the same resource root and master table keys, so they see the same master tables.
Protocol 12 adds authoritative harvest maps, ordinary hit and gather settlement, and bulk harvest. Upgrade the game and server together. The server persists the maps and their refresh window in the player document, so restarting a session does not regenerate collected resources. Documents without these fields are accepted and receive a map on their first harvest-site request. Invalid stored maps or refresh windows are rejected instead of silently replacing saved state.