mofangmin 1 year ago
parent 115b1ff269
commit 89adb1779f
  1. 6
      call/pay.go
  2. 7
      call/user.go
  3. 4
      cmd/build.sh
  4. 22
      common/activity.go
  5. 1
      common/config.go
  6. 1
      common/currency.go
  7. 5
      common/redis_keys.go
  8. 4
      modules/backend/handler/guser/getGameUserInfo.go
  9. 23
      modules/web/handler/activity.go
  10. 4
      modules/web/handler/game.go
  11. 3
      modules/web/providers/jili2/base.go
  12. 1
      modules/web/providers/jili2/handler.go
  13. 8
      modules/web/providers/jili2/values.go
  14. 3
      modules/web/providers/pg2/base.go
  15. 2
      modules/web/providers/pg2/handler.go
  16. 7
      modules/web/providers/pg2/values.go

@ -84,7 +84,7 @@ func Withdraw(data *pb.InnerWithdrawReq) (*pb.InnerWithdrawResp, error) {
// CheckUserBet 检测玩家余额 // CheckUserBet 检测玩家余额
func CheckUserBet(uid int, t common.CurrencyType) { func CheckUserBet(uid int, t common.CurrencyType) {
cash := GetUserCurrency(uid, t) cash := GetUserCurrency(uid, t)
if cash < config.GetConfig().Web.BreakLimit { if cash < GetConfigPlatform().MiniAmount {
_, err := db.Mysql().UpdateRes(&common.PlayerProfile{UID: uid}, map[string]interface{}{"need_bet": 0}) _, err := db.Mysql().UpdateRes(&common.PlayerProfile{UID: uid}, map[string]interface{}{"need_bet": 0})
if err != nil { if err != nil {
log.Error("err:%v", err) log.Error("err:%v", err)
@ -232,7 +232,7 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s
if r.ProductID == 0 { if r.ProductID == 0 {
ticket := GetConfigDiscountTicketByAmount(discountOriginAmount) ticket := GetConfigDiscountTicketByAmount(discountOriginAmount)
log.Info("ticket:%v", ticket) log.Info("ticket:%v", ticket)
if ticket.Id > 0 { if ticket.ID > 0 {
// 赠送优惠券 // 赠送优惠券
tickets := GetConfigDiscountTicket() tickets := GetConfigDiscountTicket()
sort.Slice(tickets, func(i, j int) bool { sort.Slice(tickets, func(i, j int) bool {
@ -257,7 +257,7 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s
if val < ticket.CurProb { if val < ticket.CurProb {
AddUserDiscountTicket(uid, ticket.DiscountAmount, ticket.RechargeAmount, -1, 0, true) AddUserDiscountTicket(uid, ticket.DiscountAmount, ticket.RechargeAmount, -1, 0, true)
SendMailWithContent(uid, SystemTitle, fmt.Sprintf(EmailDiscount, ticket.DiscountAmount/common.DecimalDigits, ticket.RechargeAmount/common.DecimalDigits)) SendMailWithContent(uid, SystemTitle, fmt.Sprintf(EmailDiscount, ticket.DiscountAmount/common.DecimalDigits, ticket.RechargeAmount/common.DecimalDigits))
} else if nextTicket.Id > 0 { } else if nextTicket.ID > 0 {
AddUserDiscountTicket(uid, nextTicket.DiscountAmount, nextTicket.RechargeAmount, -1, 1, true) 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, ticket.DiscountAmount/common.DecimalDigits, ticket.RechargeAmount/common.DecimalDigits))
} }

@ -800,13 +800,14 @@ func GetRtpControl(uid int) int {
// 2.个控 // 2.个控
// 3.大盘 // 3.大盘
rtp := GetConfigPlatform().Rtp rtp := GetConfigPlatform().Rtp
if rtpData.Id > 0 { if rtpData.Id > 0 && rtpData.Rtp > 0 {
rtp = rtpData.Rtp rtp = rtpData.Rtp
} } else {
if rtp > 0 && rtpConf.Id > 0 { if rtpConf.ID > 0 {
if withdrawRechargePer >= int64(rtpConf.EnterPer) && withdrawRechargePer <= int64(rtpConf.ExitPer) { if withdrawRechargePer >= int64(rtpConf.EnterPer) && withdrawRechargePer <= int64(rtpConf.ExitPer) {
rtp = rtpConf.Rtp rtp = rtpConf.Rtp
} }
} }
}
return rtp return rtp
} }

@ -8,5 +8,5 @@ cd pb/proto
# go generate # go generate
cd ../.. cd ../..
#go build main.go #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 indiaprovider main.go
#CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gameserver main.go CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gameserver main.go

@ -551,11 +551,11 @@ func (m *ConfigActivityPopup) TableName() string {
} }
type ConfigDiscountTicket struct { type ConfigDiscountTicket struct {
Id int `gorm:"column:id;type:int(11) AUTO_INCREMENT;primary_key" json:"id"` ID int `gorm:"column:id;type:int(11) AUTO_INCREMENT;primary_key" json:"id"`
RechargeAmount int64 `gorm:"column:recharge_amount;type:bigint(20)" json:"recharge_amount"` RechargeAmount int64 `gorm:"column:recharge_amount;type:bigint(20)" web:"recharge_amount"`
DiscountAmount int64 `gorm:"column:discount_amount;type:bigint(20)" json:"discount_amount"` DiscountAmount int64 `gorm:"column:discount_amount;type:bigint(20)" web:"discount_amount"`
CurProb int `gorm:"column:cur_prob;type:int(11)" json:"cur_prob"` CurProb int `gorm:"column:cur_prob;type:int(11)" web:"cur_prob"`
NextProb int `gorm:"column:next_prob;type:int(11)" json:"next_prob"` NextProb int `gorm:"column:next_prob;type:int(11)" web:"next_prob"`
} }
func (m *ConfigDiscountTicket) TableName() string { func (m *ConfigDiscountTicket) TableName() string {
@ -563,12 +563,12 @@ func (m *ConfigDiscountTicket) TableName() string {
} }
type ConfigRtp struct { type ConfigRtp struct {
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` ID int `gorm:"column:id;type:int(11) AUTO_INCREMENT;primary_key"`
MinRecharge int64 `gorm:"column:min_recharge;type:bigint(20);comment:最小充值" json:"min_recharge"` MinRecharge int64 `gorm:"column:min_recharge;type:bigint(20);comment:最小充值" web:"min_recharge"`
MaxRecharge int64 `gorm:"column:max_recharge;type:bigint(20);comment:最小充值" json:"max_recharge"` MaxRecharge int64 `gorm:"column:max_recharge;type:bigint(20);comment:最小充值" web:"max_recharge"`
Rtp int `gorm:"column:rtp;type:int(11);comment:rtp" json:"rtp"` Rtp int `gorm:"column:rtp;type:int(11);comment:rtp" json:"rtp" web:"rtp"`
EnterPer int `gorm:"column:enter_per;type:int(11);comment:进入提存比" json:"enter_per"` EnterPer int `gorm:"column:enter_per;type:int(11);comment:进入提存比" web:"enter_per"`
ExitPer int `gorm:"column:exit_per;type:int(11);comment:退出提存比" json:"exit_per"` ExitPer int `gorm:"column:exit_per;type:int(11);comment:退出提存比" web:"exit_per"`
} }
func (m *ConfigRtp) TableName() string { func (m *ConfigRtp) TableName() string {

@ -180,6 +180,7 @@ type ConfigPlatform struct {
BlackList int `gorm:"column:black_list;type:int(11);default:0;comment:是否开启黑名单 0不开 1开启" json:"BlackList" web:"black_list"` BlackList int `gorm:"column:black_list;type:int(11);default:0;comment:是否开启黑名单 0不开 1开启" json:"BlackList" web:"black_list"`
Rtp int `gorm:"column:rtp;type:int(11);default:0;comment:平台RTP" json:"Rtp" web:"rtp"` Rtp int `gorm:"column:rtp;type:int(11);default:0;comment:平台RTP" json:"Rtp" web:"rtp"`
ShareBindReward int64 `gorm:"column:share_bind_reward;type:bigint(20);default:0;comment:分享奖励" json:"ShareBindReward" web:"share_bind_reward"` ShareBindReward int64 `gorm:"column:share_bind_reward;type:bigint(20);default:0;comment:分享奖励" json:"ShareBindReward" web:"share_bind_reward"`
MiniAmount int64 `gorm:"column:mini_amount;type:bigint(20);default:0;comment:小于这个金额就充值" json:"MiniAmount" web:"mini_amount"`
} }
func (c *ConfigPlatform) TableName() string { func (c *ConfigPlatform) TableName() string {

@ -100,6 +100,7 @@ const (
CurrencyEventActivitySlots // slots奖池 CurrencyEventActivitySlots // slots奖池
CurrencyEventActivitySuper // 超级1+2 CurrencyEventActivitySuper // 超级1+2
CurrencyEventActivityBetDraw // 下注抽奖 CurrencyEventActivityBetDraw // 下注抽奖
CurrencyEventActivityShareBind // 分享绑定
CurrencyEventAll CurrencyEventAll
CurrencyEventGM = 1000 // 后台修改货币 CurrencyEventGM = 1000 // 后台修改货币

@ -45,6 +45,7 @@ const (
// RedisKeyPlayerPay = "playerPay" // 玩家10分钟内付费拉起的渠道记录 // RedisKeyPlayerPay = "playerPay" // 玩家10分钟内付费拉起的渠道记录
RedisKeyPlayerPayInterval = "playerPayInterval" // 玩家拉单间隔限制 RedisKeyPlayerPayInterval = "playerPayInterval" // 玩家拉单间隔限制
RedisKeyGameCurrency = "gameCurrency" // 玩家进入游戏时选择的币种 RedisKeyGameCurrency = "gameCurrency" // 玩家进入游戏时选择的币种
RedisKeyPlayerRTP = "playerRtp"
) )
const ( const (
@ -189,3 +190,7 @@ func GetBackendReviewKey(date string, channel *int) string {
} }
return ret return ret
} }
func GetRedisKeyPlayerRtp(uid int) string {
return fmt.Sprintf("%v:%v", RedisKeyPlayerRTP, uid)
}

@ -96,8 +96,10 @@ func GetGameUserInfo(c *gin.Context) {
rtp := call.GetUserRtp(uid) rtp := call.GetUserRtp(uid)
if rtp.Id == 0 { if rtp.Id == 0 {
db.Mysql().Create(rtp) db.Mysql().Create(rtp)
} rtp.Rtp, _ = db.Redis().GetInt(common.GetRedisKeyPlayerRtp(uid))
} else {
resp.Rtp = rtp.Rtp resp.Rtp = rtp.Rtp
}
// resp.RechargeUsdt = usdtInfo.TotalRecharge // resp.RechargeUsdt = usdtInfo.TotalRecharge
// resp.WithdrawUsdt = usdtInfo.TotoalWithdraw // resp.WithdrawUsdt = usdtInfo.TotoalWithdraw

@ -776,7 +776,7 @@ func ActivityLuckyCodeDraw(c *gin.Context) {
} }
resp := &values.ActivityLuckyCodeDrawResp{} resp := &values.ActivityLuckyCodeDrawResp{}
a.Data = resp a.Data = resp
code, _ := strconv.Atoi(req.LuckyCode)
var reward int64 var reward int64
// 判断是否为分享吗 // 判断是否为分享吗
@ -800,8 +800,7 @@ func ActivityLuckyCodeDraw(c *gin.Context) {
UID: a.UID, UID: a.UID,
Type: common.CurrencyINR, Type: common.CurrencyINR,
Value: reward, Value: reward,
Event: common.CurrencyEventTask, Event: common.CurrencyEventActivityShareBind,
Exi1: code,
NeedBet: call.GetConfigCurrencyResourceNeedBet(common.CurrencyResourceBonus, reward), NeedBet: call.GetConfigCurrencyResourceNeedBet(common.CurrencyResourceBonus, reward),
}, },
}) })
@ -813,13 +812,19 @@ func ActivityLuckyCodeDraw(c *gin.Context) {
} }
} else { } else {
now := time.Now() now := time.Now()
code, err := strconv.Atoi(req.LuckyCode)
if err != nil {
a.Code = values.CodeParam
a.Msg = "The code you entered is incorrect"
return
}
luckyCode := &common.ActivityLuckyCode{Code: code, Date: now.Format("20060102")} luckyCode := &common.ActivityLuckyCode{Code: code, Date: now.Format("20060102")}
if !a.MGet(luckyCode) { err = db.Mysql().Get(&luckyCode)
if err != nil {
a.Code = values.CodeParam a.Code = values.CodeParam
a.Msg = "The code you entered is incorrect" a.Msg = "The code you entered is incorrect"
return return
} }
codeType := luckyCode.Type codeType := luckyCode.Type
data := &common.ActivityLuckyCodeData{UID: a.UID} data := &common.ActivityLuckyCodeData{UID: a.UID}
db.Mysql().Get(data) db.Mysql().Get(data)
@ -873,12 +878,12 @@ func ActivityLuckyCodeDraw(c *gin.Context) {
break break
} }
} }
_, err := call.UpdateCurrencyPro(&common.UpdateCurrency{ _, err = call.UpdateCurrencyPro(&common.UpdateCurrency{
CurrencyBalance: &common.CurrencyBalance{ CurrencyBalance: &common.CurrencyBalance{
UID: a.UID, UID: a.UID,
Type: common.CurrencyINR, Type: common.CurrencyINR,
Value: reward, Value: reward,
Event: common.CurrencyEventTask, Event: common.CurrencyEventActivityLuckyCode,
Exs1: fmt.Sprintf("%d", codeType), Exs1: fmt.Sprintf("%d", codeType),
Exi1: code, Exi1: code,
NeedBet: call.GetConfigCurrencyResourceNeedBet(common.CurrencyResourceBonus, reward), NeedBet: call.GetConfigCurrencyResourceNeedBet(common.CurrencyResourceBonus, reward),
@ -1465,7 +1470,7 @@ func ActivityWeekCardDraw(c *gin.Context) {
log.Info("maxAmount:%v", maxAmount) log.Info("maxAmount:%v", maxAmount)
ticket := call.GetConfigDiscountTicketByAmount(maxAmount) ticket := call.GetConfigDiscountTicketByAmount(maxAmount)
log.Info("ticket:%v", ticket) log.Info("ticket:%v", ticket)
if ticket.Id > 0 { if ticket.ID > 0 {
// 赠送优惠券 // 赠送优惠券
tickets := call.GetConfigDiscountTicket() tickets := call.GetConfigDiscountTicket()
sort.Slice(tickets, func(i, j int) bool { sort.Slice(tickets, func(i, j int) bool {
@ -1492,7 +1497,7 @@ func ActivityWeekCardDraw(c *gin.Context) {
call.SendMailWithContent(a.UID, call.SystemTitle, fmt.Sprintf(call.EmailDiscount, ticket.DiscountAmount/common.DecimalDigits, ticket.RechargeAmount/common.DecimalDigits)) call.SendMailWithContent(a.UID, call.SystemTitle, fmt.Sprintf(call.EmailDiscount, ticket.DiscountAmount/common.DecimalDigits, ticket.RechargeAmount/common.DecimalDigits))
resp.DiscountTicket = ticket.DiscountAmount resp.DiscountTicket = ticket.DiscountAmount
resp.Amount = ticket.RechargeAmount resp.Amount = ticket.RechargeAmount
} else if nextTicket.Id > 0 { } else if nextTicket.ID > 0 {
call.AddUserDiscountTicket(a.UID, nextTicket.DiscountAmount, nextTicket.RechargeAmount, -1, 1, false) call.AddUserDiscountTicket(a.UID, nextTicket.DiscountAmount, nextTicket.RechargeAmount, -1, 1, false)
call.SendMailWithContent(a.UID, call.SystemTitle, fmt.Sprintf(call.EmailDiscount, ticket.DiscountAmount/common.DecimalDigits, ticket.RechargeAmount/common.DecimalDigits)) call.SendMailWithContent(a.UID, call.SystemTitle, fmt.Sprintf(call.EmailDiscount, ticket.DiscountAmount/common.DecimalDigits, ticket.RechargeAmount/common.DecimalDigits))
resp.DiscountTicket = nextTicket.DiscountAmount resp.DiscountTicket = nextTicket.DiscountAmount

@ -95,10 +95,6 @@ func EnterGame(c *gin.Context) {
if game != nil && game.Open == 1 { if game != nil && game.Open == 1 {
req.Provider = providerId req.Provider = providerId
resp.Method = provider.Method resp.Method = provider.Method
} else {
a.Code = values.CodeParam
a.Msg = "Under Maintenance,please try later."
return
} }
} }

@ -4,7 +4,9 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"server/call" "server/call"
"server/common"
"server/config" "server/config"
"server/db"
"server/modules/web/providers/base" "server/modules/web/providers/base"
utils "server/util" utils "server/util"
"strconv" "strconv"
@ -42,6 +44,7 @@ func (s *Sub) EnterGame() string {
key := AgentMap.Key key := AgentMap.Key
rtp := call.GetRtpControl(uid) rtp := call.GetRtpControl(uid)
log.Info("uid:%v,rtp:%v", uid, rtp) log.Info("uid:%v,rtp:%v", uid, rtp)
db.Redis().SetData(common.GetRedisKeyPlayerRtp(uid), rtp)
headers := map[string]string{ headers := map[string]string{
"X-Atgame-Mchid": mchid, "X-Atgame-Mchid": mchid,
"X-Atgame-Timestamp": strconv.FormatInt(timestamp, 10), "X-Atgame-Timestamp": strconv.FormatInt(timestamp, 10),

@ -89,6 +89,7 @@ func GetPlayerBalance(c *gin.Context) {
resp.Data.Uname = req.Uname resp.Data.Uname = req.Uname
resp.Data.Balance = call.GetUserCurrencyFloat(uid, common.CurrencyType(currency), 2) resp.Data.Balance = call.GetUserCurrencyFloat(uid, common.CurrencyType(currency), 2)
a.Data = resp a.Data = resp
log.Debug("GetPlayerBalance resp:%+v", resp)
} }
func PlaceBet(c *gin.Context) { func PlaceBet(c *gin.Context) {

@ -1,10 +1,11 @@
package jili2 package jili2
const ( const (
APIRlease = "https://openapi-br.atgameapp.com/pub" APIRlease = "https://openapi.jfancygame.com"
APITest = "https://api.jgameworks.com" APITest = "https://api.jgameworks.com"
LaunchGameURL = "/api/usr/ingame" LaunchGameURL = "/api/usr/ingame"
GetGameListURL = "/api/game/loadlist" GetGameListURL = "/api/game/loadlist"
Lang = "en" Lang = "en"
) )
@ -20,5 +21,8 @@ var (
MchId: "10017", MchId: "10017",
Key: "C54E411A1B89C54BFB977EBAA7BB1D39", Key: "C54E411A1B89C54BFB977EBAA7BB1D39",
} }
AgentMapRelease = Agent{} AgentMapRelease = Agent{
MchId: "10009",
Key: "DAAD7363FB8FBD824FB9B765BBCEC186",
}
) )

@ -4,7 +4,9 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"server/call" "server/call"
"server/common"
"server/config" "server/config"
"server/db"
"server/modules/web/providers/base" "server/modules/web/providers/base"
utils "server/util" utils "server/util"
"strconv" "strconv"
@ -42,6 +44,7 @@ func (s *Sub) EnterGame() string {
key := AgentMap.Key key := AgentMap.Key
rtp := call.GetRtpControl(uid) rtp := call.GetRtpControl(uid)
log.Info("uid:%v,rtp:%v", uid, rtp) log.Info("uid:%v,rtp:%v", uid, rtp)
db.Redis().SetData(common.GetRedisKeyPlayerRtp(uid), rtp)
headers := map[string]string{ headers := map[string]string{
"X-Atgame-Mchid": mchid, "X-Atgame-Mchid": mchid,
"X-Atgame-Timestamp": strconv.FormatInt(timestamp, 10), "X-Atgame-Timestamp": strconv.FormatInt(timestamp, 10),

@ -89,6 +89,8 @@ func GetPlayerBalance(c *gin.Context) {
resp.Data.Uname = req.Uname resp.Data.Uname = req.Uname
resp.Data.Balance = call.GetUserCurrencyFloat(uid, common.CurrencyType(currency), 2) resp.Data.Balance = call.GetUserCurrencyFloat(uid, common.CurrencyType(currency), 2)
a.Data = resp a.Data = resp
log.Debug("GetPlayerBalance resp:%+v", resp)
} }
func PlaceBet(c *gin.Context) { func PlaceBet(c *gin.Context) {

@ -1,7 +1,7 @@
package pg2 package pg2
const ( const (
APIRlease = "https://openapi-br.atgameapp.com/pub" APIRlease = "https://openapi-ind.atgameapp.com/pub"
APITest = "https://openapi.windygame.net/demo" APITest = "https://openapi.windygame.net/demo"
LaunchGameURL = "/api/usr/ingame" LaunchGameURL = "/api/usr/ingame"
GetGameListURL = "/api/game/loadlist" GetGameListURL = "/api/game/loadlist"
@ -20,5 +20,8 @@ var (
"10071", "10071",
"E3D1A83FA82F04D9725ACB5A77578A65", "E3D1A83FA82F04D9725ACB5A77578A65",
} }
AgentMapRelease = Agent{} AgentMapRelease = Agent{
"10025",
"E21B1CFF68CD984C6ADB25554BAF16C3",
}
) )

Loading…
Cancel
Save