Add the concept of a player and the /register endpoint

This commit is contained in:
Marc Di Luzio 2020-05-31 00:06:14 +01:00
parent 8c4bf4f75f
commit eccb726f74
11 changed files with 129 additions and 36 deletions

View file

@ -8,6 +8,8 @@ import (
"os"
"os/signal"
"syscall"
"github.com/mdiluz/rove/pkg/rovegame"
)
var port = flag.Int("port", 8080, "The port to host on")
@ -16,6 +18,14 @@ func main() {
fmt.Println("Initialising...")
// Set up the world
world := rovegame.NewWorld()
fmt.Printf("World created\n\t%+v\n", world)
// Create a new router
router := NewRouter()
fmt.Printf("Router Created\n")
// Set up the close handler
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
@ -25,9 +35,6 @@ func main() {
os.Exit(0)
}()
// Create a new router
router := NewRouter()
fmt.Println("Initialised")
// Listen and serve the http requests