Comments (1)
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 GroupMessage
s. The Core sends BindingRequest
s 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.
UserEvent
s 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 GroupMessage
s 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)
- Whatsapp Service HOT 1
- Pushing BridgeMPP Message objects to provide more information to remote Endpoints HOT 1
- Encoding Enhancement HOT 2
- The BridgeMPP-Logo is not updated HOT 1
- BridgeMPP Skype Service HOT 4
- League of Legends XMPP Client Old SSL Fix HOT 1
- There is no default configuration file included HOT 2
- League of Legends Friend Request Listener HOT 1
- Add option to set default and current Device HOT 2
- Exchange xml saving of values with a database HOT 1
- Exchange xml configuration with Java's Properties-System (?) HOT 3
- BridgeMPPBotExample.java: Forbid foreign access -> open socket to localhost HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bridgempp.