Giter VIP home page Giter VIP logo

godot-open-blive's Introduction

Godot OpenBlive 插件

MIT license

哔哩哔哩直播开放平台的 Godot 插件。

  • 长连 API
  • 互动玩法 API

用法

启用插件后即可在场景中使用 OpenBlive 节点。

该节点有四个属性:

名称 说明
Access Key Id 注册开放平台开发者获得。
Access Key Secret 注册开放平台开发者获得。
App Id 项目 ID,使用互动玩法必填。
Room Id Override 强制使用特定的直播间号。留空自动从命令行参数获取。
上架后从直播姬中运行时就会使用这种方式传递直播间号。

该节点有四个方法:

名称 说明
start_danmaku() 开启弹幕。成功开启后就可以通过信号收到事件通知。
开启的成功与否请以对应的信号为准。
stop_danmaku() 关闭弹幕。
start_game() 开启互动玩法。
开启的成功与否请以对应的信号为准。
stop_game() 关闭互动玩法。

该节点的信号如下:

名称 说明
danmaku_server_connected 弹幕服务器已连接。
danmaku_server_connection_failed 弹幕服务器连接失败。
danmaku_server_disconnected 弹幕服务器已断开。
danmaku_received(data) 收到弹幕。
data 为字典,字段说明见官方文档
gift_received(data) 收到礼物。
data 为字典,字段说明见官方文档
superchat_added(data) 添加付费留言。
data 为字典,字段说明见官方文档
superchat_removed(data) 删除付费留言。
data 为字典,字段说明见官方文档
guard_hired(data) 大航海。
data 为字典,字段说明见官方文档
game_started 互动玩法已开启。
结束互动玩法后有一段时间的冷却结算期,如果在此期间内调用 start_game(),节点会自动进行等待。
game_start_failed(code) 互动玩法开启失败。
code 为整数错误码。为 -1 时表示非服务器返回的错误,其余情况见官方文档。错误码为 7001 的情况已在内部处理自动重试,不会发生。
game_stopped 互动玩法已停止。

示例用法见 Demo。

godot-open-blive's People

Contributors

timothyqiu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.