Giter VIP home page Giter VIP logo

Comments (1)

main-- avatar main-- commented on August 22, 2024

Thanks, but the protocol doesn't exactly work like that. Sorry, I really should have documented it.

The module (so the BridgeChat service in this case) has to send a ModuleIntro message first. The server will use the information in there to identify the module. After that, both just keep sending GroupMessages. The Core sends BindingRequests to notify a module that it should try to bind to a group. The Module answers with a BindingResponse. The binding stays until the Core sends an UnbindRequest. Then the module must leave the group.

UserEvents are special: Those sent by the Core include a plugin_id, to identify the plugin that generated them. However, those sent by modules to the Core must not include a plugin_id, because they already sent that in their ModuleIntro. The online_status field is only sent if it just changed, so true indicates that somebody just joined while false means that someone just left the group. Group IDs are set by the Core and modules must not send GroupMessages to a group ID unless there's a binding for it.

You're correctly building messages and serializing them to byte[], but you have to send the packet's length first (as 32 bit integer). Obviously the same applies when you receive.


That being said, we should consider just patching the BotWrapper, so it connects as a BridgeChat module, and building something similar for Services. Why? With the fixes described above BridgeMPP's BridgeChat service is a bridge between BridgeMPP and BridgeChat, both of which do basically the same. Unifying them would be much more efficient, both in terms of performance and - more importantly - development time.

from bridgempp.

Related Issues (13)

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.