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
you should be able to view other players and jump around together,
although while testing locally one of the clients would always trigger
the "Some irregularities have been found with your connection to the
server, so your game will be closed" speed check for some reason ???
really not sure, might just be my machine
chunking uhhh works ? kind of, not tested for more than a few seconds
before one of the clients disconnects
- loginMetadata is passed to shards through redis now
- shards announce they're alive via redis.AnnounceShard() which just
populates a hashset keyed 'shards'
- login servers grab the 'shards' hashset and randomly picks a shard to
pass the player to (for now)
- ./service shard && ./service login
- Many new environment variables, check config/config.go for more info.
or for a tl;dr just read the Dockerfile for the required ones
- Shard and login services now run in different processes ! (and
containers?? wooaaah)
- the shard's ip sent to the client via the login server is currently hardcoded in config/config.go
- no packets other than P_CL2FE_REQ_PC_ENTER and P_CL2FE_REQ_PC_LOADING_COMPLETE are supported via the shard server
- moved Peer from the server package to the protocol package, it was also renamed to CNPeer as most fusionfall specific constants in the client use the 'CN' prefix.
- protocol: added GenSerialKey() which securely generates an EnterSerialKey
- login server accepts a shard via LoginServer.AddShard()
- login server will pass LoginMetaData to the selected shard via ShardServer.QueueLogin()
- misc. refactoring
- server/loginServer: no longer sending packets by pointer, except in cases like AcceptLogin(), which operates on a sent structure slice. since these are already allocated, no need to copy them
honestly forgot it got added to the commit history. there's nothing worth protecting in this db. i'll save you some time, the password for the 'hello' account is 'world'.
- DB work has started in db. this will be a direct port of the OpenFusion DB format.
- LoginServer is now less of a dummy. You can create and login to accounts, and create a character to go through the tutorial with.
- config.go will host some commonly changed variables.
- protocol: fixed a bug relating to arrays being ignored while encoding packets