开启游戏
为会员生成游戏启动 URL。
API 信息
- 端点:
POST /v2/opengame - 认证:Bearer Token
- 加密:请求使用 AES-256-GCM 加密,响应为明文 JSON
请求
请求标头
POST /v2/opengame HTTP/1.1
Host: api.example.com
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
x-agentid: integratorNBTest04
x-timestamp: 1769746894501
x-nonce: 56ffd5ecd8a3a4457863a0bd7c298fb2
x-signature: c25f8d23704373e8776cce6d9b10f1fde091c34db80d60523c7e04ff30e54633
请求参数
加密前的参数
{
"deviceType": 0,
"ipaddress": "35.200.72.205",
"lang": "en",
"lobbyUrl": "https://example.com",
"gameCode": "VP_230001_1",
"launchType": 1,
"username": "testaccount01"
}
加密后的请求体
{
"cipherText": "G0ZMDELeJwx+7JcIfIFOLJjkSzANPu6krGM2uw==..."
}
| 欄位 | 类型 | 必填 | 说明 |
|---|---|---|---|
deviceType | number | 是 | 设备类型:0 = PC,1 = 行动裝置 |
ipaddress | string | 是 | 玩家 IP 地址(僅能带入一个 IP 地址) |
lang | string | 是 | 游戏界面语言 |
gameCode | string | 是 | 游戏代码 |
launchType | number | 是 | 启动类型:0 = both,1 = demo,2 = real |
lobbyUrl | string | 否 | 游戏结束后返回的大厅 URL(必须使用 https) |
username | string | 否 | 会员账号(当 launchType 为 1 时允许为空或不带) |
响应
成功响应
{
"code": 0,
"message": "No error.",
"data": {
"gameLaunchHtml": null,
"gameLaunchUrl": "https://staggp.zzzstkk.com/game/230001/3.55.0?a=integratorNBTest04_VPSysDevTest010&g=230001&p=3UWzoOtmcKcdZbQnEiHwHbBn9i3w4y__R_DuvopsoYemrFfczHqZGciqR5YvDkTn...",
"mode": "real"
},
"logUUID": "23c50208-cd0f-4daa-be3c-f346da188107"
}
响应欄位说明
| 欄位 | 类型 | 说明 |
|---|---|---|
data.gameLaunchHtml | string | null | 游戏启动的 HTML 內容(部分游戏使用,通常为 null) |
data.gameLaunchUrl | string | 游戏启动 URL(在新窗口或 iframe 中打开) |
data.mode | string | 游戏模式:"real"(真钱模式)或 "demo"(试玩模式) |
错误响应
当请求失敗时,会返回对应的错误代码。
错误代码
| 状态码 | 说明 | 处理建议 |
|---|---|---|
| 5 | Game is not found | 游戏不存在、已下线或不支援该币别,请确认 gameCode 是否正确 |
| 7 | Internal server error | 系统內部错误,请稍后重试或聯繫技术支援 |
| 8 | The User is not exist | 会员不存在,请先創建会员 |
| 11 | Parameters error | 请确认请求参数完整且格式正确 |
| 19 | Invalid account | 账号无效,请检查会员账号 |
| 81 | Branch config not found | 分支配置未找到,请聯繫技术支援 |
| 82 | Please check siteId is for this player | 请确认 siteId 是否对应该玩家 |
错误响应范例
{
"code": 5,
"message": "Game is not found",
"logUUID": "24cdc3b9-9fe8-44de-8391-a96863e46954"
}
{
"code": 8,
"message": "The User is not exist",
"logUUID": "24cdc3b9-9fe8-44de-8391-a96863e46954"
}
注意事项
特别注意
-
ipaddress 使用限制:
- 僅能带入一个 IP 地址
- 若 launchType 为 1(demo 模式)时,可带入虛拟 IP
-
username 与 launchType 的关係:
- 当 launchType 为 1(demo 模式)时,username 才允许为空或不带
- 当 launchType 为 0(both)或 2(real)时,username 必须提供
-
lobbyUrl 格式要求:
- 若提供 lobbyUrl,网址必须使用 https 协议
一般注意事项
-
URL 有效期:
- 游戏 URL 通常在 5 分钟內有效
- 过期后需要重新获取
- 一个 URL 只能使用一次
-
返回处理:
- lobbyUrl 会在玩家关闭游戏时使用
- 建议设置为游戏大厅页面
-
模游玩式:
- 当 launchType 为 2(real)时,可选择游玩正式模式
- 当 launchType 为 1(demo)时,可选择游玩试玩模式
- 当 launchType 为 0(both)时,玩家可于游戏畫面选择游玩正式或是试玩模式
- 游玩试玩模式可不带入玩家账号,有带入可于游戏內跳转到正式模式中
-
并发限制:
- 同一会员同时只能开启一个游戏连结(不支援双开)
- 开启新游戏会自动关闭舊连结