diff --git a/domain/cache/game_c/game.go b/domain/cache/game_c/game.go index 82de8479c604f1c594887e2e8ddce63705f23aca..619ac1f82c4a8b3a49ee69407a3957f0314834f7 100644 --- a/domain/cache/game_c/game.go +++ b/domain/cache/game_c/game.go @@ -9,17 +9,18 @@ import ( ) type gameAutoJoinMsg struct { - TraceId string - Token string - EnterType string - GameCode string - Is1V1 string - GameMode string + TraceId string + Token string + EnterType string + GameCode string + Is1V1 string + GameMode string + Is1V1Robot string } -func SetAutoMathEnterRoom(userId uint64, imGroupId, traceId, token, enterType, gameCode, is1V1, gameMode string) error { +func SetAutoMathEnterRoom(userId uint64, imGroupId, traceId, token, enterType, gameCode, is1V1, gameMode, is1V1Robot string) error { key := game_e.GetAutoMathEnterRoom(userId, imGroupId) - info := gameAutoJoinMsg{traceId, token, enterType, gameCode, is1V1, gameMode} + info := gameAutoJoinMsg{traceId, token, enterType, gameCode, is1V1, gameMode, is1V1Robot} data, err := json.Marshal(info) if err != nil { return err diff --git a/route/group_r/group_op.go b/route/group_r/group_op.go index 7773a347b2958f72a93841a7367b2ba712bd878f..cafd44ba589521ad741eb1c342d1aa9b2a84cb7a 100644 --- a/route/group_r/group_op.go +++ b/route/group_r/group_op.go @@ -1734,6 +1734,7 @@ func downgradeRoom(myContext *mycontext.MyContext, gi *group_m.GroupInfo) error // @Param gameCode formData string false "gameCode" // @Param is1V1 formData int false "是否1v1,0否1是" // @Param gameMode formData int false "游戏模式0.快速1.经典" +// @Param is1V1Robot formData int false "是否游戏机器人,0否1是" // @Success 200 {object} group_cv.GroupChannelId // @Router /v1/imGroup/in [put] func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { @@ -1748,6 +1749,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { gameCode := c.PostForm("gameCode") is1V1 := c.PostForm("is1V1") gameMode := c.PostForm("gameMode") + is1V1Robot := c.PostForm("is1V1Robot") // 把id:9 添加进房间:5030的黑名单 if (userId == 2087771 || userId == 1763211) && groupId == "HTGS#a46766257" { return myContext, bizerr.NoPrivileges @@ -1894,7 +1896,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { if enterType != "" && gameCode != "" { traceId, _ := c.Get(mycontext.TRACEID) token := c.Writer.Header().Get(mycontext.TOKEN) - err := game_c.SetAutoMathEnterRoom(userId, gi.ImGroupId, cast.ToString(traceId), token, enterType, gameCode, is1V1, gameMode) + err := game_c.SetAutoMathEnterRoom(userId, gi.ImGroupId, cast.ToString(traceId), token, enterType, gameCode, is1V1, gameMode, is1V1Robot) if err != nil { model.Log.Errorf("GroupIn cache.SetAutoMathEnterRoom userId:%v, imGroupId:%v, err:%v", userId, gi.ImGroupId, err) }