Commit ab72f7bd authored by chenweijian's avatar chenweijian

游戏

parent 74cfec26
...@@ -13,11 +13,13 @@ type gameAutoJoinMsg struct { ...@@ -13,11 +13,13 @@ type gameAutoJoinMsg struct {
Token string Token string
EnterType string EnterType string
GameCode string GameCode string
Is1V1 string
GameMode string
} }
func SetAutoMathEnterRoom(userId uint64, imGroupId, traceId, token, enterType, gameCode string) error { func SetAutoMathEnterRoom(userId uint64, imGroupId, traceId, token, enterType, gameCode, is1V1, gameMode string) error {
key := game_e.GetAutoMathEnterRoom(userId, imGroupId) key := game_e.GetAutoMathEnterRoom(userId, imGroupId)
info := gameAutoJoinMsg{traceId, token, enterType, gameCode} info := gameAutoJoinMsg{traceId, token, enterType, gameCode, is1V1, gameMode}
data, err := json.Marshal(info) data, err := json.Marshal(info)
if err != nil { if err != nil {
return err return err
......
...@@ -1730,8 +1730,10 @@ func downgradeRoom(myContext *mycontext.MyContext, gi *group_m.GroupInfo) error ...@@ -1730,8 +1730,10 @@ func downgradeRoom(myContext *mycontext.MyContext, gi *group_m.GroupInfo) error
// @Param nonce header string true "随机数字" // @Param nonce header string true "随机数字"
// @Param groupId formData string true "群ID" // @Param groupId formData string true "群ID"
// @Param password formData string false "房间密码" // @Param password formData string false "房间密码"
// @Param enterType formData int false "进房类型:1.ludo游戏快速匹配进房 2:uno" // @Param enterType formData int false "进房类型:1.ludo游戏快速匹配进房 2:uno 10.domino"
// @Param gameCode formData string false "gameCode" // @Param gameCode formData string false "gameCode"
// @Param is1V1 formData int false "是否1v1,0否1是"
// @Param gameMode formData int false "游戏模式0.快速1.经典"
// @Success 200 {object} group_cv.GroupChannelId // @Success 200 {object} group_cv.GroupChannelId
// @Router /v1/imGroup/in [put] // @Router /v1/imGroup/in [put]
func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
...@@ -1744,6 +1746,8 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -1744,6 +1746,8 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
password := c.PostForm("password") password := c.PostForm("password")
enterType := c.PostForm("enterType") enterType := c.PostForm("enterType")
gameCode := c.PostForm("gameCode") gameCode := c.PostForm("gameCode")
is1V1 := c.PostForm("is1V1")
gameMode := c.PostForm("gameMode")
// 把id:9 添加进房间:5030的黑名单 // 把id:9 添加进房间:5030的黑名单
if (userId == 2087771 || userId == 1763211) && groupId == "HTGS#a46766257" { if (userId == 2087771 || userId == 1763211) && groupId == "HTGS#a46766257" {
return myContext, bizerr.NoPrivileges return myContext, bizerr.NoPrivileges
...@@ -1890,7 +1894,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -1890,7 +1894,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
if enterType != "" && gameCode != "" { if enterType != "" && gameCode != "" {
traceId, _ := c.Get(mycontext.TRACEID) traceId, _ := c.Get(mycontext.TRACEID)
token := c.Writer.Header().Get(mycontext.TOKEN) token := c.Writer.Header().Get(mycontext.TOKEN)
err := game_c.SetAutoMathEnterRoom(userId, gi.ImGroupId, cast.ToString(traceId), token, enterType, gameCode) err := game_c.SetAutoMathEnterRoom(userId, gi.ImGroupId, cast.ToString(traceId), token, enterType, gameCode, is1V1, gameMode)
if err != nil { if err != nil {
model.Log.Errorf("GroupIn cache.SetAutoMathEnterRoom userId:%v, imGroupId:%v, err:%v", userId, gi.ImGroupId, err) model.Log.Errorf("GroupIn cache.SetAutoMathEnterRoom userId:%v, imGroupId:%v, err:%v", userId, gi.ImGroupId, err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment