From 4ec023e1c27241086bb7698b98ac187228e9a9f6 Mon Sep 17 00:00:00 2001 From: shine <1042864399@qq.com> Date: Sat, 19 Oct 2024 20:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=B8=E6=88=8F=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1id=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/gamesViews.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/views/gamesViews.go b/views/gamesViews.go index 423ee24..58e614c 100644 --- a/views/gamesViews.go +++ b/views/gamesViews.go @@ -79,7 +79,7 @@ func StartGameListen() { c.JSON(http.StatusOK, gin.H{}) }) - // 开始游戏 + // 对方同意开始游戏 router.POST("/start_game", func(c *gin.Context) { user, msg, is := service.PublicPostCheck(c) if !is { @@ -89,8 +89,9 @@ func StartGameListen() { game.itemX = float32(msg["x"].(float64)) game.itemY = float32(msg["y"].(float64)) game.winSum = int(msg["win"].(float64)) + gameUuid := msg["game_uuid"].(string) online := &models.Online{ID: user.ID, Ip: user.Ip, Port: user.Port} - game.AddNet(utils.Uuid.CreateUUID(), 1, online, &user.Users) + game.AddNet(gameUuid, 1, online, &user.Users) game.Show() c.JSON(200, gin.H{"message": "ok"}) })