Here's some code about Minecraft… big WIP
- Mostly about the main game protocol
- Some, originaly from NetherrackDev/netherrack (packets, packets' table & auth)
The MasterPlan would be to make a server supporting multiple client's versions on a distributed back-end. Storing terrain chunks in redis or something like that. Or sharding the generated chunks between running instances with custom pubsub ans raft. Because. Fun.
WIP reimplementation of netherrack's mc protocol handler without the reflection based parser Make huge use of golang type alias so every packet's field type has a Read/Write method
The rational behind it is that the original implementation :
- can't support multiple protocol versions at once
- make heavy use of reflexion to read/write packets
- did a clever use of struct's tag for buffer's and array's length
, but I think it's better solved by type alias which give us ptr deferencing helland I find it great to reuse those tags at compile time
And the more complete implementation mc-server/MCServer (support 1.8)
- duplicate the parser methods to handle changes in protocol
- manually implement every packet's reading/writing
- is in C++
Generate protocol read/write methods from packet's struct definitions using golang AST
run go run protocol/generate/* < protocol/packets.go > protocol/generated.go
allow to login from an 1.8 client with some patch to netherrack and then login to an other server should add packets proxying to catch broken packet parsing and record session for automated tests mostly experiments residues
- http://wiki.vg/
- be more performant and maintainable than MCServer
- api to control game entities
- of course a map like that
- allow unlimited client with virtual entity ids
- coordinate translation to allow wrapping around the map
- dispatcher patern + golang chan's sweetness : be aware of blocking channels & slow clients