frame

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package frame 帧同步

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGameRoom

func CreateGameRoom(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)

第三方后台创建帧同步游戏房间

See: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/lock-step/lock-step.createGameRoom.html

POST https://api.weixin.qq.com/wxa/createwxagameroom?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/minigame/apis/frame"
)

func main() {
	var ctx *miniprogram.Miniprogram

	payload := []byte("{}")
	resp, err := frame.CreateGameRoom(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func GetGameFrame

func GetGameFrame(ctx *miniprogram.Miniprogram, params url.Values) (resp []byte, err error)

分片拉取对局游戏帧

See: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/lock-step/lock-step.getGameFrame.html

GET https://api.weixin.qq.com/wxa/getwxagameframe?access_token=XXX&access_info=YYY&begin_frame_id=ZZZ&end_frame_id=TTT

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/minigame/apis/frame"
)

func main() {
	var ctx *miniprogram.Miniprogram

	params := url.Values{}
	resp, err := frame.GetGameFrame(ctx, params)

	fmt.Println(resp, err)
}
Output:

func GetGameIdentityInfo

func GetGameIdentityInfo(ctx *miniprogram.Miniprogram, params url.Values) (resp []byte, err error)

获取对局玩家位次信息

See: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/lock-step/lock-step.getGameIdentityInfo.html

GET https://api.weixin.qq.com/wxa/getwxagameidentityinfo?access_token=XXX&access_info=YYY

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/minigame/apis/frame"
)

func main() {
	var ctx *miniprogram.Miniprogram

	params := url.Values{}
	resp, err := frame.GetGameIdentityInfo(ctx, params)

	fmt.Println(resp, err)
}
Output:

func GetGameRoomInfo

func GetGameRoomInfo(ctx *miniprogram.Miniprogram, params url.Values) (resp []byte, err error)

获取指定房间信息

See: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/lock-step/lock-step.getGameRoomInfo.html

GET https://api.weixin.qq.com/wxa/getwxagameroominfo?access_token=XXX&access_info=YYY

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/minigame/apis/frame"
)

func main() {
	var ctx *miniprogram.Miniprogram

	params := url.Values{}
	resp, err := frame.GetGameRoomInfo(ctx, params)

	fmt.Println(resp, err)
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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