bf1api

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package bf1api 战地相关api库

Index

Constants

View Source
const (
	ErrServerNotFound int64 = -34501
	ErrInvalidMapID   int64 = -32603
	ErrServerOutdate  int64 = -32851
	ErrPlayerIsAdmin  int64 = -32857
	ErrinvalidPlayer  int64 = -32856
	ErrServerNotStart int64 = -32858
)

error code

TODO: #7

Variables

This section is empty.

Functions

func Exception

func Exception(errcode int64) error

Exception 错误码转换

TODO: #7

func GetExchange

func GetExchange() (map[string][]string, error)

GetExchange 查询该周交换

func GetPersonalID

func GetPersonalID(name string) (string, error)

GetPersonalID 由name获取玩家pid

func GetServerFullInfo added in v1.0.2

func GetServerFullInfo(gameID string) (*gjson.Result, error)

GetServerFullInfo 获取服务器完整信息

func Login

func Login(username, password string) error

Login 获取 Session token cookies

func ReturnJSON

func ReturnJSON(url, method string, body interface{}) (*gjson.Result, error)

ReturnJSON NativeAPI 返回json

Types

type Pack

type Pack struct {
	RemainTime int64
	ResetTime  int64
	Name       string
	Desc       string
	Op1Name    string
	Op2Name    string
}

Pack unmarshal json

func GetCampaignPacks

func GetCampaignPacks() (*Pack, error)

GetCampaignPacks 查询本周行动包

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL