Refactor simple-game-server
markmandel opened this issue · comments
Mark Mandel commented
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
map
of commands rather than a giantswitch
statement - 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?
agones/examples/simple-game-server/main.go
Lines 605 to 611 in d85a5ae
...and anything else that jumps out!