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. 18
      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
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

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

@ -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"`

@ -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)

@ -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[:]))
}

@ -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",
}
)

Loading…
Cancel
Save