# gamematch.setMatchIdOpenState

本接口应在服务器端调用,详细说明参见服务端 API

修改 matchid 对应的打开状态。

每个 matchid 都有两种状态:打开(1)和关闭(0)

用户在调用加入匹配接口时,只能加入状态为打开的 matchid。状态为打开的 matchid 才会分配匹配池。

小程序通过updateMatchRule修改 matchid 对应的规则时,只能修改状态为关闭的 matchid

可以通过getAllMatchRule拉取小程序所有 matchid 的配置信息和打开状态。

将打开状态设置为关闭(0)时,匹配服务会释放掉 matchid 对应的匹配池。如果是线上正在使用的 matchid,请谨慎变更 matchid 的状态。

# 请求地址

POST https://api.weixin.qq.com/wxa/business/gamematch/setmatchopenstate?access_token=ACCESS_TOKEN

# 请求参数 - Query

属性 类型 默认值 必填 说明
access_token / cloudbase_access_token string 接口调用凭证

# 请求参数 - Body

属性 类型 默认值 必填 说明
match_id number 需要变更状态的 matchid,通过createMatchRule后台接口创建
open_state number matchid 的打开状态

open_state 的合法值

说明 最低版本
0 关闭
1 打开

# 返回值

# Object

返回的 JSON 数据包

属性 类型 说明
errcode number 错误码
errmsg string 错误提示信息
match_id string 匹配池对应的 id,加入匹配时需要携带 matchid 以加入对应的匹配池

errcode 的合法值

说明 最低版本
0 请求成功
-1 系统繁忙,此时请开发者稍候再试
1 matchid 不存在
200000 无效的请求数据
500005 无效的 matchid
500012 open_state 的值不合法

# 调用示例

curl -X POST -d '{"match_id":"FD0PT4rKguEdK-L83RaJgdbchUCW8wjhSwgCku4CLQk","open_state":1}' https://api.weixin.qq.com/wxa/business/gamematch/setmatchopenstate?access_token=ACCESS_TOKEN

# 返回结果示例

{
  "errcode": 0,
  "errmsg": "ok"
}

点击咨询小助手