SONGS OF THE SHOALS · ONLINE岛风渔歌 · 联机指南

Multiplayer server guide岛风渔歌联机服务器指南

Go fishing, build a home, and meet your friends at the starting line. Choose a player-hosted world or keep a dedicated server running.一起钓鱼、建造家园,也在起跑线上相遇。可以由一位玩家开房,也可以搭建持续运行的独立服务器。

01 · Choose how to play01 · 选择联机方式

Open Online from the main menu. Rooms support up to four players.在主菜单打开「联机 / Online」,房间最多支持 4 位玩家。

Host a world房主模式

Create or resume a world and play as its host. Reusing the world ID resumes its save. Everyone disconnects when the host leaves.创建或继续世界,房主也能参与游玩。相同世界目录名会恢复存档;房主离开后房间关闭。

Connect to a server服务器模式

Enter the server IP and UDP port, or its full wss:// address, plus the room password. The separate port field is hidden for WSS. Friends can come and go while the server stays online.输入服务器 IP 和 UDP 端口,或完整的 wss:// 地址,再填写房间密码。WSS 会隐藏单独的端口输入。服务器在线时,朋友可以各自上线和下线。

Join a host by IP, or select Steam with a lobby ID when both players launch matching builds through Steam. Steam invitations across networks require separate validation.加入房主可使用 IP;双方从 Steam 启动匹配构建时,也可选择 Steam 并输入房间编号。Steam 邀请跨网络连接需另行验收。

Use the room panel to invite friends, save, and organize air, boat or car races. Join, ready up, then let the organizer start. Vehicles are equalized, players do not collide, and R resets with a five-second penalty. Scores belong to this room.使用房间面板邀请好友、保存,以及发起飞机、赛艇或赛车比赛。成员加入并准备后,由发起者开始。比赛统一载具,玩家之间无碰撞,按 R 重置加 5 秒;成绩只属于当前房间。

Buildings and the shared warehouse belong to the world. Each player keeps their own inventory, fish hold and equipment. Members share building permissions, so play with people you trust.建筑和公共仓库属于世界;每位玩家分别保管背包、鱼舱和装备。成员共享建筑编辑权限,适合与可信朋友游玩。

02 · Start a Windows server02 · 启动 Windows 服务器

Use a complete, imported project checkout and the pinned Godot 4.7.2 engine. In the project folder, create your server directory and copy the sample configuration. Change the room password before sharing the address.准备完整且已完成资源导入的项目和固定版本 Godot 4.7.2。在项目根目录创建服务器目录、复制示例配置;分享地址前先修改房间密码。

New-Item -ItemType Directory C:\ShoalsServer -Force
Copy-Item .\server.example.json C:\ShoalsServer\server.json

Edit server.json:编辑 server.json:

{
  "world": "shared-harbor",
  "name": "Our island",
  "bind": "0.0.0.0",
  "port": 27027,
  "max_players": 4,
  "password": "replace-with-your-room-password",
  "transport": "enet",
  "autosave_seconds": 30
}
.\tools\start_multiplayer_server.ps1 -Config C:\ShoalsServer\server.json -DataDirectory C:\ShoalsServer\world

The launcher checks the engine version. An optional -GodotPath can point to another 4.7.2 installation. Wait for MULTIPLAYER_WORLD_READY authority=true dedicated=true before connecting. The game runs headlessly; keep the process running.启动脚本会校验引擎版本,可用 -GodotPath 指向另一处 4.7.2 安装。等待日志出现 MULTIPLAYER_WORLD_READY authority=true dedicated=true 后再连接。服务无窗口运行,需要保持进程在线。

World IDs allow letters, digits, hyphens and underscores, up to 48 characters. Ports: 1024–65535. Player limit: 2–4. Autosave: 10–300 seconds. Dedicated servers use enet or websocket. The data directory selects the save; use one running process per directory.世界目录名只接受英文字母、数字、短横线和下划线,最长 48 字符。端口范围 1024–65535,人数 2–4,自动保存间隔 10–300 秒。独立服务器使用 enet 或 websocket;数据目录决定存档位置,同一目录只能运行一个进程。

03 · Make it reachable03 · 让朋友连得进来

Use 127.0.0.1 on the server computer, its LAN address on your local network, or its public address over the internet. 0.0.0.0 is a listening address, not a client destination. Allow your configured UDP port in the host firewall, cloud security group and router forwarding rules when applicable.同机测试用 127.0.0.1;局域网用服务器的局域网地址;外网用公网地址。0.0.0.0 是监听地址,不能用来加入房间。按网络情况在系统防火墙、云安全组和路由器映射中放行配置的 UDP 端口。

Example Windows firewall rule, run by an administrator and adjusted to your network:Windows 防火墙示例,由管理员按实际网络范围执行:

New-NetFirewallRule -DisplayName "Shoals UDP 27027" -Direction Inbound -Action Allow -Protocol UDP -LocalPort 27027

Carrier-grade NAT can prevent inbound connections even with a local firewall rule. Use a reachable host or trusted virtual LAN. ENet game traffic is currently unencrypted; choose a unique room password.运营商 NAT 可能阻止外网入站,仅添加本机防火墙规则并不足够。可使用支持入站的主机或可信虚拟局域网。ENet 游戏流量目前未加密,请使用独立的房间密码。

An encrypted WSS entry point通过 HTTPS 端口连接

For a server behind an existing HTTPS site, set transport to websocket and bind to 127.0.0.1. With a valid TLS certificate, add this location inside the Nginx server block. Back up the configuration, run nginx -t, then reload Nginx.已有 HTTPS 站点时,可将 transport 设为 websocket,bind 设为 127.0.0.1。使用有效 TLS 证书,在 Nginx 的 server 块内添加以下路径;先备份配置,执行 nginx -t 通过后再重载。

location = /game/ws {
    if ($http_upgrade = "") { return 404; }
    proxy_pass http://127.0.0.1:27027;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_read_timeout 300s;
    proxy_send_timeout 300s;
    proxy_buffering off;
}

Players enter wss://your-domain/game/ws and the room password. Keep the backend port bound to loopback. The client validates the certificate and domain. WSS uses TCP, so packet loss can cause more noticeable delays than ENet/UDP; it suits small private tests. Authentication and world rules are the same.玩家输入 wss://你的域名/game/ws 和房间密码;后端端口保持仅本机监听。客户端会校验证书和域名。WSS 使用 TCP,丢包时延迟可能比 ENet/UDP 明显,适合小规模私人测试;身份验证和世界规则相同。

Manage a Linux service管理 Linux 服务

Use the pinned Linux engine and a complete server bundle, including imported resources and Linux extensions. The repository provides tools/multiplayer/shoals-test.service and stop_server.sh. Install them after creating the service user and directories; adjust paths to your installation. Keep the password in a configuration readable only by the service account.使用固定版本的 Linux 引擎和完整服务器包,包含导入资源及 Linux 扩展。仓库提供 tools/multiplayer/shoals-test.service 和 stop_server.sh;创建服务用户与目录后安装,按实际位置调整路径。密码放在仅服务账户可读的配置中。

sudo systemctl daemon-reload
sudo systemctl start shoals-test
sudo systemctl status shoals-test --no-pager
sudo journalctl -u shoals-test -n 80 --no-pager
sudo systemctl stop shoals-test

The template uses /opt/shoals-test/current for the game, /etc/shoals-test/server.json for configuration, and /var/lib/shoals-test/world for saves. Stop requests a save and waits for exit. Stopping preserves the world. A test service can remain manually started without enabling boot startup.模板使用 /opt/shoals-test/current 存放游戏、/etc/shoals-test/server.json 存放配置、/var/lib/shoals-test/world 存放世界。stop 会请求保存并等待退出,存档保留。测试服务可以只手动启动,无需启用开机运行。

04 · Save, stop and back up04 · 保存、停服与备份

Confirmed inventory and building transactions are saved before acknowledgment. Position and time use periodic checkpoints. To stop safely, run this from another terminal and wait for the server process to exit:已确认的物品和建造交易先保存再回复;位置和时间定期保存。在另一个终端执行以下命令,并等待进程退出:

.\tools\stop_multiplayer_server.ps1 -DataDirectory C:\ShoalsServer\world

Back up the entire stopped data directory. world.json contains the checksummed world; .tmp is an uncommitted write and .bak supports interruption recovery. Do not combine files manually or run synchronized copies concurrently. Forced termination can lose the latest position checkpoint.停服后备份整个数据目录。world.json 带有校验和,.tmp 是未提交写入,.bak 用于中断恢复。不要手动混合文件或同时运行网盘同步的副本;强制终止可能丢失最近的位置检查点。

Player identity lives in multiplayer/identity.pem inside the Godot user-data folder. Keep your private identity safe and transfer it securely when changing computers. Do not share it. Multiplayer saves are separate from solo saves; solo imports, cross-server inventory and automatic host migration are not included.玩家身份保存在 Godot 用户数据目录的 multiplayer/identity.pem。换电脑时请安全迁移自己的身份文件,不要分享私钥。联机存档和单人存档分开;目前没有单人存档导入、跨服务器物品迁移或自动房主迁移。

To move a hosted world to a server, save and close it, copy multiplayer/worlds/<world>/ from the host user-data folder into the server data directory, and use matching builds. Keep the host player's identity file to reconnect as the same player.把房主世界转为独立服务器时,先保存并退出,把房主用户数据目录中的 multiplayer/worlds/<world>/ 复制到服务器数据目录,双方使用匹配构建。保留房主原身份文件,即可用同一玩家身份重连。

05 · Troubleshooting05 · 常见问题

Timeout or connection failed连接失败或超时
Wait for world readiness. For ENet, check IP, UDP port and forwarding. For WSS, check the complete URL, TLS certificate and Nginx upgrade proxy.先等世界就绪。ENet 检查 IP、UDP 端口和映射;WSS 检查完整地址、TLS 证书及 Nginx 的连接升级代理。
Password or identity rejected密码或身份验证失败
Check the password and identity file. The same identity cannot join twice.检查密码和身份文件;同一身份不能重复在线。
Content mismatch版本或内容不同
Use exactly matching multiplayer builds. Preserve the world instead of overwriting it to bypass validation.客户端和服务器使用同一份联机构建;保留存档,不要通过覆盖世界跳过校验。
World busy or save failed目录占用或保存失败
Stop the earlier process for that directory. Check disk space and write permission. Do not delete player saves to clear a lock.先停止使用该目录的旧进程,检查磁盘空间和写权限。不要通过删除存档解决占用。

Movement responds locally and remote players are interpolated. The world authority handles catches, construction, race clocks and gates. This is friendly co-op, with no guarantee of competitive anti-cheat.移动在本地响应,远端玩家使用插值显示;世界端处理鱼获、建造、比赛计时和检查点。这是好友合作模式,不提供公开竞技级反作弊保证。