A toy implementation of the FusionFall Packet Protocol in Go
Go to file
CPunch 670d4a514c more better CNPeer.Send()
this fixes a race condition where if 2 goroutines try to send a packet at the same time, they could end up being
malformed due to the 2 separate calls to peer.conn.Write().

instead of writing the packet size to peer.conn.Write() directly, we make space in buf for the packet size,
and patch it in place. this lets us get away with only having 1 call to peer.conn.Write() which will ensure that
the full packet is written properly and be goroutine safe :3
2023-08-23 17:38:10 -05:00
cmd Switched to redis/postgres, major refactoring 2023-06-22 01:53:38 -05:00
config added NPCs; added tdata submodule 2023-06-27 00:36:02 -05:00
core more better CNPeer.Send() 2023-08-23 17:38:10 -05:00
login switched NPC autoincremented ID to atomic int 2023-06-27 20:06:51 -05:00
shard send chat packets to *all* players 2023-06-27 22:05:08 -05:00
tdata@cc65dbb402 added NPCs; added tdata submodule 2023-06-27 00:36:02 -05:00
tools refactoring; moved client to protocol package 2023-03-07 17:04:57 -06:00
.gitignore removed test.db 2023-03-09 15:33:39 -06:00
.gitmodules added NPCs; added tdata submodule 2023-06-27 00:36:02 -05:00
build.sh Switched to redis/postgres, major refactoring 2023-06-22 01:53:38 -05:00
compose.yaml added NPCs; added tdata submodule 2023-06-27 00:36:02 -05:00
Dockerfile dockerfile: switch to scratch 2023-06-20 18:33:29 -05:00
go.mod Switched to redis/postgres, major refactoring 2023-06-22 01:53:38 -05:00
go.sum Switched to redis/postgres, major refactoring 2023-06-22 01:53:38 -05:00
README.md started docker image 2023-06-20 02:12:15 -05:00

gopenfusion

A toy implementation of the Fusionfall Packet Protocol written in Go.

Landwalker demo

An implementation of a landwalker server is located in login/ && shard/. This includes a functional login server and a dummy shard (supporting the minimum amount of packets necessary). The DB implementation in core/db/ matches the OpenFusion 1.4 SQLite tables, which the login server uses. There's no support for NPCs nor other players, and is liable to softlock the client.

Startup the environment using

$ chmod +x ./build.sh && ./build.sh
$ docker compose up

login server is hosted at 127.0.0.1:23000, just join from your favorite client

Generating structures

Dump and decompile the Assembly - CSharp.dll assembly from the fusionfall main.unity3d, using a tool like ilspycmd. The full output source can then be passed to genstructs.py script located in tools/, which will handle scraping constants and calculating structure padding. See the script for details on usage.