glance522/rf4_server_simulator
GamesA Go local-server simulator for the RF4 fishing game client, aimed at players and protocol researchers.
Project Overview
This is a Go implementation of a local server simulator for the fishing game client version 4.0.25034, intended for technical study of protocol encoding, session ordering, state machines, persistence, and server engineering. It is a hobby project, not a complete recreation of the official service and not a production-ready or long-term private-server solution.
The runtime is a launcher plus two service processes. The gateway handles client login over HTTPS, token issuance, TCP sessions, frame encoding, RC4 encryption in both directions, ACKs, keepalive, and reconnect state persisted to the database. The gameserver handles command dispatch, push guards, the fishing loop, items, shops, mail, and skills. State lives in a single SQLite file with WAL, plus a read-only attached static database. The launcher embeds an admin panel on the same local port.
Quick Start
Players who only want to run the simulator do not need Go or a local build. Download the latest Windows build from Releases, unzip it, read the bundled quick-start text, and double-click 启动服务器.cmd or run bin\launcher.exe. The first run creates data/, initializes the database, and sets up a default admin account admin/admin123. The launcher then starts gameserver and gateway in order, performs health checks, restarts crashed processes with exponential backoff, and exposes a control center at http://127.0.0.1:9500 with admin page under #admin.
Before connecting the client:
- Edit the Windows hosts file and add
127.0.0.1 api.rf4game.ruand127.0.0.1 api.rf4game.comas documented. - Trust the self-signed certificate
certs/server.crtgenerated on first gateway run by installing it into the Trusted Root Certification Authorities store. - In the control center, save the absolute path to
rf4_x64.exeand launch it with regionCN.
For source builds, install Go 1.27.3 or later and run powershell -File build.ps1 on Windows or make build in Git Bash/Linux; output goes to bin/. See the deployment guide for full setup, configuration, and troubleshooting.
Constraints
- The supported client version is 4.0.25034; other versions are unverified.
- Only hand rod, simple bottom, and simple lure fishing methods have been tested; fishing supports catching and basic settlement but not official spawn, probability, ecosystem, event, or economy behavior.
- Many commands are protocol-valid but incomplete in business logic, so the server is not production-ready.
- Client login requires administrator rights to modify hosts and install a trusted local certificate.
- The project states it accepts no donations, top-ups, or paid features and that the repository contains only server simulation and study code, not the game itself.
- The license is MIT, and the author's stated usage boundaries do not alter the rights granted by that license.
HotRepo's Take
The repository entered HotRepo's new-project list on 2026-11-04 on the Go list, with a recorded gain of 32 stars and 16 forks over roughly 19 hours. The star curve rose from 102 to 160 between 2026-11-04 and 2026-11-06 UTC, with most movement early in that window and slower growth afterward. No all-language daily rank was recorded. What stands out technically is the explicit split between gateway and gameserver, the RC4 session state persisted for reconnects, and the embedded admin control plane with a shared SQLite command queue, which is more specific than a generic game-server template. The material does not establish whether the prebuilt launcher corresponds to the published source.
Written by AI from the project's README, updated . The project's own docs are the source of truth.