pg3请求结构更新

dev
mofangmin 11 months ago
parent 9d9ef8f699
commit f2f7db7709
  1. 2
      cmd/build.sh
  2. 1
      cmd/gener_code.sh
  3. 16
      modules/web/providers/pg3/api.go
  4. 8
      modules/web/providers/pg3/base.go
  5. 3
      modules/web/providers/pg3/sign.go
  6. 6
      modules/web/providers/pg3/values.go

@ -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 && upx -9 indiaprovider
#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

@ -27,6 +27,7 @@ func Load$input_value() (err error) {
} }
return nil return nil
} }
func GetConfig$input_value() []*common.Config$input_value { func GetConfig$input_value() []*common.Config$input_value {
return config$input_value return config$input_value
} }

@ -38,14 +38,16 @@ type GameListItem struct {
// EnterGameRequest 进入游戏 // EnterGameRequest 进入游戏
type EnterGameRequest struct { type EnterGameRequest struct {
Uname string `json:"uname"` Uname string `json:"uname"` // 用户名,最长30个字节
GameID string `json:"gameid"` GameID string `json:"gameid"` // 所进游戏的编码
Token string `json:"token,omitempty"` Token string `json:"token,omitempty"` // 用户验证token,最长120个字节,用于单一钱包的身份验证接口
Lang string `json:"lang,omitempty"` Lang string `json:"lang,omitempty"` // 游戏语言,默认为en
Nick string `json:"nick,omitempty"` Nick string `json:"nick,omitempty"` // 用户昵称,最长40个字节
RtpPool int `json:"rtp_pool,omitempty"` TotalRecharge int64 `json:"totalRecharge"` // 总充值
TotalBet int64 `json:"totalBet"` // 总下注
Balance int64 `json:"balance"` // 金额
TotalWithdraw int64 `json:"totalWithdraw"` // 总提现(已提现+提现打款中+玩家审核)
} }
type EnterGameResponse struct { type EnterGameResponse struct {
Code int `json:"code"` Code int `json:"code"`
Msg string `json:"msg"` Msg string `json:"msg"`

@ -50,6 +50,9 @@ func (s *Sub) EnterGame() string {
"X-Game-Timestamp": strconv.FormatInt(timestamp, 10), "X-Game-Timestamp": strconv.FormatInt(timestamp, 10),
"Content-Type": "application/json;charset=UTF-8", "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 // Generate sign
game := call.GetConfigGameListByID(providerID, gameID) game := call.GetConfigGameListByID(providerID, gameID)
if game == nil { if game == nil {
@ -61,7 +64,10 @@ func (s *Sub) EnterGame() string {
Token: common.GetProviderUserToken(token), Token: common.GetProviderUserToken(token),
Lang: "pt", Lang: "pt",
Nick: "", Nick: "",
RtpPool: rtp, 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) body, _ := json.Marshal(request)
sign := GenerateSign(string(body), timestamp, key) sign := GenerateSign(string(body), timestamp, key)

@ -5,10 +5,13 @@ import (
"encoding/hex" "encoding/hex"
"strconv" "strconv"
"strings" "strings"
"github.com/liangdas/mqant/log"
) )
func GenerateSign(body string, timestamp int64, key string) string { func GenerateSign(body string, timestamp int64, key string) string {
data := body + strconv.FormatInt(timestamp, 10) + key data := body + strconv.FormatInt(timestamp, 10) + key
log.Info("data:%v", data)
hash := md5.Sum([]byte(data)) hash := md5.Sum([]byte(data))
return strings.ToUpper(hex.EncodeToString(hash[:])) return strings.ToUpper(hex.EncodeToString(hash[:]))
} }

@ -1,7 +1,7 @@
package pg3 package pg3
const ( const (
APIRlease = "https://openapi-ind.atgameapp.com/pub" APIRlease = "https://pggame.ux7k.com"
APITest = "https://pggame.1iibet.com" APITest = "https://pggame.1iibet.com"
LaunchGameURL = "/api/usr/ingame" LaunchGameURL = "/api/usr/ingame"
GetGameListURL = "/api/game/loadlist" GetGameListURL = "/api/game/loadlist"
@ -18,10 +18,10 @@ var (
AgentMap Agent AgentMap Agent
AgentMapTest = Agent{ AgentMapTest = Agent{
"10025", "10025",
"E21B1CFF68CD984C6ADB25554BAF16C3", "12DD45A2758A9AEA0224DB8B7F8A36E3",
} }
AgentMapRelease = Agent{ AgentMapRelease = Agent{
"10025", "10001",
"E21B1CFF68CD984C6ADB25554BAF16C3", "E21B1CFF68CD984C6ADB25554BAF16C3",
} }
) )

Loading…
Cancel
Save