Groundwork for handler that allows reconnecting
This commit is contained in:
parent
829a80d62a
commit
58002a1b38
@ -126,3 +126,9 @@ func JoinPrivateGame(c *gin.Context) {
|
||||
c.Header("Access-Control-Allow-Origin", "*")
|
||||
c.IndentedJSON(http.StatusOK, info)
|
||||
}
|
||||
|
||||
func JoinGame(c *gin.Context) {
|
||||
gameID := c.Param("id")
|
||||
log.Println(gameID)
|
||||
c.JSON(http.StatusOK, gameID)
|
||||
}
|
||||
|
@ -70,3 +70,7 @@ func waitForAndHandlePlayerID(ctx context.Context, conn *gorillaws.Conn) {
|
||||
lobby.Game.SetWebsocketConnectionFor(ctx, player, conn)
|
||||
log.Println("player after setting connection: ", player)
|
||||
}
|
||||
|
||||
func ConnectWsForGame(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
3
main.go
3
main.go
@ -28,7 +28,10 @@ func main() {
|
||||
router.GET("/api/hostPrivate", handler.HostPrivateGameHandler)
|
||||
router.POST("/api/joinPrivate", handler.JoinPrivateGame)
|
||||
router.GET("/api/ws", websocket.RegisterWebSocketConnection)
|
||||
|
||||
router.GET("/api/getLobbyForPassphrase/:phrase", handler.GetLobbyForPassphraseHandler)
|
||||
router.GET("/api/registerWsForGame/:id", websocket.ConnectWsForGame)
|
||||
router.POST("/api/joinGame/:id", handler.JoinGame)
|
||||
|
||||
if debugMode {
|
||||
log.Println("Starting service WITHOUT TLS")
|
||||
|
Loading…
Reference in New Issue
Block a user