diff --git a/call/config.go b/call/config.go index b16778f..003076f 100644 --- a/call/config.go +++ b/call/config.go @@ -732,7 +732,21 @@ func GetConfigGameList(num int, cond ...int) []*common.ConfigGameList { if v.GameProvider == common.ProviderPG2 || v.GameProvider == common.ProviderJiLi2 { continue } - ret = append(ret, v) + provider := -1 + if v.GameProvider == common.ProviderJili { + provider = common.ProviderJiLi2 + } else if v.GameProvider == common.ProviderPGSoft { + provider = common.ProviderPG2 + } + if provider != -1 { + game := GetConfigGameListByGameID(provider, v.GameID) + if game != nil { + ret = append(ret, v) + continue + } + } else { + ret = append(ret, v) + } } sort.Slice(ret, func(i, j int) bool { return ret[i].Sort > ret[j].Sort diff --git a/call/pay.go b/call/pay.go index a6c3e93..0f99734 100644 --- a/call/pay.go +++ b/call/pay.go @@ -259,7 +259,7 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s SendMailWithContent(uid, SystemTitle, fmt.Sprintf(EmailDiscount, ticket.DiscountAmount/common.DecimalDigits, ticket.RechargeAmount/common.DecimalDigits)) } else if nextTicket.ID > 0 { AddUserDiscountTicket(uid, nextTicket.DiscountAmount, nextTicket.RechargeAmount, -1, 1, true) - SendMailWithContent(uid, SystemTitle, fmt.Sprintf(EmailDiscount, ticket.DiscountAmount/common.DecimalDigits, ticket.RechargeAmount/common.DecimalDigits)) + SendMailWithContent(uid, SystemTitle, fmt.Sprintf(EmailDiscount, nextTicket.DiscountAmount/common.DecimalDigits, nextTicket.RechargeAmount/common.DecimalDigits)) } } } diff --git a/call/redis.go b/call/redis.go index 80b3635..98813af 100644 --- a/call/redis.go +++ b/call/redis.go @@ -15,6 +15,14 @@ func AddChannel(channelID int, isSuccess bool) { totalKey := fmt.Sprintf("channel_total_%v", channelID) successKey := fmt.Sprintf("channel_success_%v", channelID) + // 检查键是否存在,如果不存在则设置过期时间 + if client.Exists(ctx, totalKey).Val() == 0 { + client.Set(ctx, totalKey, 0, 10*time.Minute) + } + if client.Exists(ctx, successKey).Val() == 0 { + client.Set(ctx, successKey, 0, 10*time.Minute) + } + // 增加总订单数 client.Incr(ctx, totalKey) @@ -23,9 +31,6 @@ func AddChannel(channelID int, isSuccess bool) { client.Incr(ctx, successKey) } - // 设置过期时间为10分钟 - client.Expire(ctx, totalKey, 10*time.Minute) - client.Expire(ctx, successKey, 10*time.Minute) } // GetChannelStatus 获取渠道状态 diff --git a/cmd/build.sh b/cmd/build.sh index 037ba5e..a34264c 100644 --- a/cmd/build.sh +++ b/cmd/build.sh @@ -8,5 +8,5 @@ cd pb/proto # go generate cd ../.. #go build main.go -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o indiaprovider main.go -#CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gameserver main.go \ No newline at end of file +#CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o indiaprovider main.go +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gameserver main.go \ No newline at end of file diff --git a/common/redis_keys.go b/common/redis_keys.go index 6c98efd..5390f6d 100644 --- a/common/redis_keys.go +++ b/common/redis_keys.go @@ -44,9 +44,10 @@ const ( RedisKeyRealMail = "realMail" // 给玩家发真实邮件控制 // RedisKeyPlayerPay = "playerPay" // 玩家10分钟内付费拉起的渠道记录 RedisKeyPlayerPayInterval = "playerPayInterval" // 玩家拉单间隔限制 - RedisKeyGameCurrency = "gameCurrency" // 玩家进入游戏时选择的币种 - RedisKeyPlayerRTP = "playerRtp" // 玩家RTP - RedisKeyChannelOrder = "channelOrder" // + RedisKeyPlayerPayCount = "playerPayIntervalCount" + RedisKeyGameCurrency = "gameCurrency" // 玩家进入游戏时选择的币种 + RedisKeyPlayerRTP = "playerRtp" // 玩家RTP + RedisKeyChannelOrder = "channelOrder" // ) const ( @@ -60,7 +61,7 @@ func GetRedisKeyGameCurrency(uid int) string { } func GetRedisKeyPlayerPayCount(uid int) string { - return fmt.Sprintf("%v:%v:%v", RedisKeyPlayerPayInterval, uid) + return fmt.Sprintf("%v:%v:%v", RedisKeyPlayerPayCount, uid) } func GetRedisKeyPlayerChannelPayInterval(channel, uid int) string { return fmt.Sprintf("%v:%v:%v", RedisKeyPlayerPayInterval, uid, channel) diff --git a/modules/pay/gopay/values.go b/modules/pay/gopay/values.go index cececc8..2517ce9 100644 --- a/modules/pay/gopay/values.go +++ b/modules/pay/gopay/values.go @@ -1,8 +1,8 @@ package gopay const ( - payURL = "https://gooopay.online/api/recharge/create" - withdrawURL = "https://gooopay.online/api/deposit/create" + payURL = "https://rummylotus.online/api/recharge/create" + withdrawURL = "https://rummylotus.online/api/deposit/create" mid = "2024100038" key = "326eb5a2f78a4dacb4780104ba16030c" ) diff --git a/modules/web/handler/firstpage.go b/modules/web/handler/firstpage.go index 814d7a1..b4f8f23 100644 --- a/modules/web/handler/firstpage.go +++ b/modules/web/handler/firstpage.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "math/rand" "server/call" "server/common" "server/db" @@ -65,16 +66,20 @@ func FirstPage(c *gin.Context) { gameNum := req.GameNum if strings.ToLower(v.Name) == "hot" { gameNum = 100 - } - if v.JumpType == 1 { - one.List = call.GetConfigGameList(gameNum, v.JumpID) + if v.JumpType == 1 { + one.List = call.GetConfigGameList(gameNum, v.JumpID) + } else { + one.List = call.GetConfigGameList(gameNum, 0, v.JumpID) + } } else { - one.List = call.GetConfigGameList(gameNum, 0, v.JumpID) + one.List = call.GetConfigGameList(0, 0) + rand.Shuffle(len(one.List), func(i, j int) { + one.List[i], one.List[j] = one.List[j], one.List[i] + }) } + if gameNum != req.GameNum { - // rand.Shuffle(len(one.List), func(i, j int) { - // one.List[i], one.List[j] = one.List[j], one.List[i] - // }) + if len(one.List) > req.GameNum { one.List = one.List[:req.GameNum] } diff --git a/modules/web/handler/game.go b/modules/web/handler/game.go index 69358c8..8aff578 100644 --- a/modules/web/handler/game.go +++ b/modules/web/handler/game.go @@ -2,6 +2,7 @@ package handler import ( "fmt" + "math/rand" "server/call" "server/common" "server/db" @@ -29,16 +30,31 @@ func GameList(c *gin.Context) { resp := &values.GameListResp{Provider: req.Provider} a.Data = resp var list, tmp []*common.ConfigGameList + var randFlag bool + if req.Provider == -1 { req.Provider = 0 } if req.Mark == -1 { req.Mark = 0 + } else { + req.Mark = 0 + randFlag = true } if req.Type == -1 || req.Type == 1 { req.Type = 0 } + + // if req.Provider == -1 { + // req.Provider = 0 + // randFlag = true + // } tmp = call.GetConfigGameList(0, req.Provider, req.Mark, req.Type) + if randFlag { + rand.Shuffle(len(tmp), func(i, j int) { + tmp[i], tmp[j] = tmp[j], tmp[i] + }) + } if len(req.Name) > 0 { reqName := strings.ToLower(req.Name) for _, v := range tmp { diff --git a/modules/web/handler/recharge.go b/modules/web/handler/recharge.go index 6888827..0a8b5d6 100644 --- a/modules/web/handler/recharge.go +++ b/modules/web/handler/recharge.go @@ -151,7 +151,6 @@ func PlayerRecharge(c *gin.Context) { return } log.Debug("player %v recharge:%+v", a.UID, *req) - call.AddChannel(req.PayChannel, false) if req.CurrencyType == 0 { req.CurrencyType = common.CurrencyINR } @@ -172,6 +171,8 @@ func PlayerRecharge(c *gin.Context) { a.Msg = "Requests are too frequent, please try again later" return } + + call.AddChannel(req.PayChannel, false) // if req.UserPhone == "" { // req.UserPhone = util.CheckPhone(req.UserPhone) // }