Implemented radio button system for entering the games. Production mode

This commit is contained in:
Jonas Hahn
2025-08-27 15:22:13 +02:00
parent c04466835e
commit 0e6e48cd7b
2 changed files with 8 additions and 8 deletions

View File

@@ -12,6 +12,6 @@ clear_on_rebuild = true
keep_scroll = true
[proxy]
enabled = true
enabled = false
proxy_port = 8090
app_port = 18765

View File

@@ -48,9 +48,15 @@ func postEnter(c *gin.Context) {
tableSlug := sess.Get("TableSlug")
var slug string
var t *Table
if tableSlug != nil {
slug = tableSlug.(string)
if slug != "" {
// Get the current table
db.Model(&Table{}).Where("slug = ?", slug).First(&t)
} else {
t = nil
}
}
// Parse form
@@ -153,10 +159,6 @@ func postEnter(c *gin.Context) {
// Create game
var g Game
// Get the current table
var t Table
db.Model(&Table{}).Where("slug = ?", slug).First(&t)
if slug != "" {
g = Game{
ScoreA: scoreA,
@@ -208,8 +210,6 @@ func postEnter(c *gin.Context) {
log.Println(err)
}
log.Println(p.dElo)
if err := db.Create(&GameUser{GameID: g.ID, UserID: p.u.ID, Side: p.side, DeltaElo: p.dElo}).Error; err != nil {
c.String(http.StatusInternalServerError, "failed to assign player")
return