MIT licensed smol PS for moc simulation. raw protobufs are available~
cmd
Program entrypoint.
config
Anything used for the config files. They will be autogenerated when missing.
Honestly, I liked working on this very much because of how composable it was.
Currently there is:
hotfix.json
- Hotfix for query_gatewaylx.json
- For lua "execution"player.json
- Player data (uid, username, character, etc.)ports.json
- Ports for the serversscene.json
- Map, player position, and calyx positionconfig.json
- SRTools config Popura edition
gameserver
TCP. Basic. Calyx moc simulator. But atleast you can run lua nicely.
Currently there is no ingame commands yet, but I plan to add some later on for modifying the things in player.json.
You can find the handler list in here.
pb
Protocol buffers. Feel free to take the raw protobufs from here.
sdkserver
HTTP server.
Nothing special about it. Auth is hardcoded and all that. There is, however, auto hotfix.
Lua "Executor" and the SRTools Manager is also implemented here (mostly because I couldn't find an egui
in Go).
setup.go
This will automatically compile the protobufs, generate cmd id file, and compile the server.
You can skip this part if you want to use prebuilt.
- Go v1.24.5
- protoc v31.1
- protoc-gen-go v1.36.6
These versions are pulled out of my ass (aka what I used while developing this). You can probably use older or newer ones.
Not making a detailed tutorial for installing these because you should know how to if you want to build from source.
- Proxy (or a redirect patch, I guess)
- Download the
FireflySR.Tool.Proxy
from here - No need to configure anything, you can just extract and run
- When asked about root certificate, let it install
- If you experience internet connectivity issues after playing, manually disable the proxy in your Windows settings
Install mitmproxy
and their certificate. Set HTTP_PROXY and HTTPS_PROXY env var of the game to the mitmproxy
server. Run it with this script:
from mitmproxy import http
def request(flow: http.HTTPFlow) -> None:
target_hosts = [
".hoyoverse.com",
".mihoyo.com",
".bhsr.com",
".starrails.com",
".mob.com",
".hyg.com"
]
if any(flow.request.pretty_host.endswith(host) for host in target_hosts):
flow.request.scheme = "http"
flow.request.host = "127.0.0.1"
flow.request.port = 21000
You can also use process specific capture instead of using env vars, I suppose.
- Download the
{game_version}.zip
(NOT THE SOURCE CODE!!) from here - Extract the ZIP file
- Run the
server
binary (exe, whatever) - Make sure the proxy is properly redirecting game traffic to the server
- Go have fun
- Make sure you have the prerequisites
- Clone this repository
- Run
go mod tidy
- Run
go run setup.go
- Run
go run cmd/server/main.go
or./cmd/server/main.exe
or whatever - Make sure the proxy is properly redirecting game traffic to the server
- Go have fun
- Very important: Go's json library does NOT validate the jsons. So if your json is fucked up, it won't tell you.
- You can "execute" lua through
http://127.0.0.1:21000/lua_executor
- There's also
/srtools_manager
, so you don't have to overwrite yourconfig.json
manually. - Make sure you choose
config.json
from https://srtools.pages.dev/ and notfreesr-data.json
(I am too lazy to implement that one) - Traces are hardcoded to 6/10/10/10 because not all e3 or e5 is the same
Me, Yulian. I made the code, duh.
Naruse. For protos & helping migrate old code.
Lukopa. Very fun lua scripts. I'm not gonna share them :3