You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.6 KiB
60 lines
2.6 KiB
|
1 year ago
|
package gs
|
||
|
|
|
||
|
|
import (
|
||
|
|
"server/util"
|
||
|
|
"time"
|
||
|
|
|
||
|
|
"github.com/liangdas/mqant/log"
|
||
|
|
)
|
||
|
|
|
||
|
|
type GameListReq struct {
|
||
|
|
OperatorCode string `json:"OperatorCode"` // Seamless运算符的唯一标识符
|
||
|
|
MemberName string `json:"MemberName"` // 操作员的玩家唯一标识符
|
||
|
|
DisplayName string `json:"DisplayName,omitempty"` // 玩家的显示名称 (可选)
|
||
|
|
Password string `json:"Password,omitempty"` // 操作员中的玩家密码 (可选)
|
||
|
|
GameID string `json:"GameID,omitempty"` // 独特的提供商游戏代码 (可选)
|
||
|
|
ProductID int `json:"ProductID"` // Seamless产品的唯一标识符
|
||
|
|
GameType int `json:"GameType"` // 游戏类型
|
||
|
|
LanguageCode int `json:"LanguageCode"` // 语言代码
|
||
|
|
Platform int `json:"Platform"` // 平台
|
||
|
|
IPAddress string `json:"IPAddress"` // 客户端的 IP 地址
|
||
|
|
Sign string `json:"Sign"` // 请求的签名
|
||
|
|
RequestTime string `json:"RequestTime"` // Request DateTime 格式为 yyyMDDHHMMSS
|
||
|
|
}
|
||
|
|
|
||
|
|
type ProviderGame struct {
|
||
|
|
GameCode string `json:"GameCode"` // 独特的提供商游戏 ID
|
||
|
|
GameName string `json:"GameName"` // 提供者的游戏名称
|
||
|
|
GameType int `json:"GameType,omitempty"` // 游戏类型 (可选)
|
||
|
|
Category string `json:"Category,omitempty"` // UI 显示的游戏类别 (可选,默认为 "游戏")
|
||
|
|
ImageURL string `json:"ImageURL,omitempty"` // 获取游戏图像的路径 (可选)
|
||
|
|
ProviderGameType string `json:"ProviderGameType,omitempty"` // 提供商的分类游戏类型 (可选,默认为 "null")
|
||
|
|
}
|
||
|
|
|
||
|
|
type GameListResp struct {
|
||
|
|
ErrorCode int `json:"ErrorCode"` // 响应的状态代码 (Yes)
|
||
|
|
ErrorMessage string `json:"ErrorMessage"` // 响应消息 (Yes)
|
||
|
|
ProviderGames []ProviderGame `json:"ProviderGames,omitempty"` // 供应商游戏列表 (No)
|
||
|
|
}
|
||
|
|
|
||
|
|
func GetGameList(provider int) {
|
||
|
|
opCode := AgentMap["E386"].OperatorCode
|
||
|
|
sk := AgentMap["E386"].SecretKey
|
||
|
|
req := &GameListReq{
|
||
|
|
OperatorCode: opCode,
|
||
|
|
MemberName: "user2144",
|
||
|
|
ProductID: ProductIDMap[provider],
|
||
|
|
GameType: 1,
|
||
|
|
LanguageCode: LangMap["en"],
|
||
|
|
Platform: 0,
|
||
|
|
IPAddress: "1.1.1.1",
|
||
|
|
RequestTime: time.Now().UTC().Format("20060102150405"),
|
||
|
|
}
|
||
|
|
req.Sign = util.CalculateMD5(opCode + req.RequestTime + "getgamelist" + sk)
|
||
|
|
url := API + GetGameListURL
|
||
|
|
log.Debug("%d GetGameList:%+v,url:%s", provider, *req, url)
|
||
|
|
ret := new(GameListResp)
|
||
|
|
util.HttpPost(url, req, &ret, nil)
|
||
|
|
log.Debug("%d GetGameList resp:%+v", provider, ret)
|
||
|
|
}
|