agones
agones copied to clipboard
Refactor simple-game-server
https://github.com/googleforgames/agones/blob/main/examples/simple-game-server/main.go is getting really large, and a little unweildy!
Let's take some time to refactor it it into something that's a bit more manageable.
Some suggestions include:
- Use a
mapof commands rather than a giantswitchstatement - Split into multiple files (where it makes sense)
- A lot of the SDK calls, such as
setAnnotation(...)have very similar function wrappers - can we generalise this in some way?
https://github.com/googleforgames/agones/blob/d85a5ae97695ab7937f95ae7ae656401d3e35cfa/examples/simple-game-server/main.go#L605-L611
...and anything else that jumps out!