137 lines
2.5 KiB
Go
137 lines
2.5 KiB
Go
package game
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestGetGameOsInfo(t *testing.T) {
|
|
client, err := NewClient()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
req := CreateGetGameOsInfoReq()
|
|
|
|
resp, err := client.GetGameOsInfo(req)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
fmt.Println(resp.Code, resp.Msg, resp.Data.OsList, resp.Data.OsRelList2)
|
|
}
|
|
|
|
func TestGetGameInfo(t *testing.T) {
|
|
client, err := NewClient()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
resp, err := client.GetGameInfo(CreateGetGameInfoByIdReq(8362, 1))
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(resp.Code, resp.Msg, resp.Data)
|
|
}
|
|
|
|
func TestChannelInfo(t *testing.T) {
|
|
client, err := NewClient()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
req := CreateChannelInfoReq()
|
|
req.ChannelKey = "GRSDK"
|
|
resp, err := client.GetChannelInfo(req)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(resp)
|
|
}
|
|
|
|
func TestLoginInfoById(t *testing.T) {
|
|
client, err := NewClient()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
req := CreateGetLoginInfoByIdReq(7349, "1.0.0")
|
|
info, err := client.GetLoginInfoById(req)
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
fmt.Println(info)
|
|
}
|
|
|
|
func TestGetProtocolByGameId(t *testing.T) {
|
|
client, err := NewClient()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
req := CreateGetProtocolByGameIdRep()
|
|
req.GameId = 8088
|
|
req.GameVersion = "1.1.0"
|
|
req.Type = 1
|
|
info, err := client.GetProtocolByGameId(req)
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
fmt.Println(info)
|
|
}
|
|
|
|
func TestGetGameSimpleList(t *testing.T) {
|
|
client, err := NewClient()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
req := CreateGetGameSimpleListReq("8071,8062", "")
|
|
info, err := client.GetGameSimpleList(req)
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
fmt.Println(info)
|
|
}
|
|
|
|
func TestGetGameServerV2(t *testing.T) {
|
|
client, newErr := NewClient()
|
|
if newErr != nil {
|
|
panic(newErr)
|
|
}
|
|
req := CreateGetServerV2Request("n2", "", "")
|
|
info, err := client.GetGameServerV2(req)
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
fmt.Println(info)
|
|
}
|
|
|
|
func TestGetGameCompany(t *testing.T) {
|
|
client, err := NewClient()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
req := CreateGetGameCompanyReq("ascq")
|
|
gameCompany, err := client.GetGameCompany(req)
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
fmt.Println(gameCompany)
|
|
fmt.Println(gameCompany.Data.System)
|
|
}
|
|
|
|
func TestIsBlockOutIos(t *testing.T) {
|
|
client, err := NewClient()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
isBlockOutIosReq := CreateIsBlockOutIosReq("ec63860282", 4570, "116.26.129.38", "", 0, 0)
|
|
isBlockOutIos, err := client.GetIsBlockOutIos(isBlockOutIosReq)
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
t.Log(isBlockOutIos)
|
|
}
|