diff --git a/cmd/build.sh b/cmd/build.sh index 037ba5e..236d630 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 indiaprovider main.go && upx -9 indiaprovider #CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gameserver main.go \ No newline at end of file diff --git a/cmd/gener_code.sh b/cmd/gener_code.sh index e20ff91..7fc6051 100644 --- a/cmd/gener_code.sh +++ b/cmd/gener_code.sh @@ -27,6 +27,7 @@ func Load$input_value() (err error) { } return nil } + func GetConfig$input_value() []*common.Config$input_value { return config$input_value } diff --git a/modules/web/providers/pg3/api.go b/modules/web/providers/pg3/api.go index b77db1f..c61b1d6 100644 --- a/modules/web/providers/pg3/api.go +++ b/modules/web/providers/pg3/api.go @@ -38,14 +38,16 @@ type GameListItem struct { // EnterGameRequest 进入游戏 type EnterGameRequest struct { - Uname string `json:"uname"` - GameID string `json:"gameid"` - Token string `json:"token,omitempty"` - Lang string `json:"lang,omitempty"` - Nick string `json:"nick,omitempty"` - RtpPool int `json:"rtp_pool,omitempty"` + Uname string `json:"uname"` // 用户名,最长30个字节 + GameID string `json:"gameid"` // 所进游戏的编码 + Token string `json:"token,omitempty"` // 用户验证token,最长120个字节,用于单一钱包的身份验证接口 + Lang string `json:"lang,omitempty"` // 游戏语言,默认为en + Nick string `json:"nick,omitempty"` // 用户昵称,最长40个字节 + TotalRecharge int64 `json:"totalRecharge"` // 总充值 + TotalBet int64 `json:"totalBet"` // 总下注 + Balance int64 `json:"balance"` // 金额 + TotalWithdraw int64 `json:"totalWithdraw"` // 总提现(已提现+提现打款中+玩家审核) } - type EnterGameResponse struct { Code int `json:"code"` Msg string `json:"msg"` diff --git a/modules/web/providers/pg3/base.go b/modules/web/providers/pg3/base.go index c4d610b..2c6c0d0 100644 --- a/modules/web/providers/pg3/base.go +++ b/modules/web/providers/pg3/base.go @@ -50,18 +50,24 @@ func (s *Sub) EnterGame() string { "X-Game-Timestamp": strconv.FormatInt(timestamp, 10), "Content-Type": "application/json;charset=UTF-8", } + rechargeInfo := call.GetRechargeInfo(uid) + balance := call.GetUserCurrency(uid, common.CurrencyINR) + playerProfile := call.GetPlayerProfileByCurrency(uid, common.CurrencyINR) // Generate sign game := call.GetConfigGameListByID(providerID, gameID) if game == nil { return "" } request := EnterGameRequest{ - Uname: common.GetProviderUserName(fmt.Sprintf("%d", uid)), - GameID: game.GameCode, - Token: common.GetProviderUserToken(token), - Lang: "pt", - Nick: "", - RtpPool: rtp, + Uname: common.GetProviderUserName(fmt.Sprintf("%d", uid)), + GameID: game.GameCode, + Token: common.GetProviderUserToken(token), + Lang: "pt", + Nick: "", + TotalRecharge: rechargeInfo.TotalRecharge / common.DecimalDigits, + TotalWithdraw: (rechargeInfo.TotalWithdraw + rechargeInfo.TotalWithdrawing) / common.DecimalDigits, + TotalBet: playerProfile.TotalBet / common.DecimalDigits, + Balance: balance / common.DecimalDigits, } body, _ := json.Marshal(request) sign := GenerateSign(string(body), timestamp, key) diff --git a/modules/web/providers/pg3/sign.go b/modules/web/providers/pg3/sign.go index 405132d..df3aec0 100644 --- a/modules/web/providers/pg3/sign.go +++ b/modules/web/providers/pg3/sign.go @@ -5,10 +5,13 @@ import ( "encoding/hex" "strconv" "strings" + + "github.com/liangdas/mqant/log" ) func GenerateSign(body string, timestamp int64, key string) string { data := body + strconv.FormatInt(timestamp, 10) + key + log.Info("data:%v", data) hash := md5.Sum([]byte(data)) return strings.ToUpper(hex.EncodeToString(hash[:])) } diff --git a/modules/web/providers/pg3/values.go b/modules/web/providers/pg3/values.go index 1249dd8..de418e8 100644 --- a/modules/web/providers/pg3/values.go +++ b/modules/web/providers/pg3/values.go @@ -1,7 +1,7 @@ package pg3 const ( - APIRlease = "https://openapi-ind.atgameapp.com/pub" + APIRlease = "https://pggame.ux7k.com" APITest = "https://pggame.1iibet.com" LaunchGameURL = "/api/usr/ingame" GetGameListURL = "/api/game/loadlist" @@ -18,10 +18,10 @@ var ( AgentMap Agent AgentMapTest = Agent{ "10025", - "E21B1CFF68CD984C6ADB25554BAF16C3", + "12DD45A2758A9AEA0224DB8B7F8A36E3", } AgentMapRelease = Agent{ - "10025", + "10001", "E21B1CFF68CD984C6ADB25554BAF16C3", } )