108 lines
1.9 KiB
Go
108 lines
1.9 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)
|
|
}
|