agones icon indicating copy to clipboard operation
agones copied to clipboard

Refactor simple-game-server

Open markmandel opened this issue 1 year ago • 0 comments

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 giant switch 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?

https://github.com/googleforgames/agones/blob/d85a5ae97695ab7937f95ae7ae656401d3e35cfa/examples/simple-game-server/main.go#L605-L611

...and anything else that jumps out!

markmandel avatar May 08 '24 16:05 markmandel