Skip to content

Instantly share code, notes, and snippets.

@clonejo
Last active December 10, 2015 15:38
Show Gist options
  • Select an option

  • Save clonejo/4455426 to your computer and use it in GitHub Desktop.

Select an option

Save clonejo/4455426 to your computer and use it in GitHub Desktop.
Basic structure of mc-erl's plugin protocol
The server will start the plugin (Unix) process and connect to it's stdin and stdout.
basic format: [length: 4 Bytes] [Payload]
payload: [Token: 4 Bytes] [Opcode: 2 Bytes] <depends on packet type>
Token:
first bit sent by the server = 1 (event)
first bit sent by the plugin = 0 (request)
Opcodes:
standard events
custom events
requests
registering for events:
event type: 2 Bytes
handler-types:
w: can modify/cancel events
c: receives any events, also canceled ones
u: receives only uncancelled events (this mode should be sufficient for most plugins)
processing for w:
in the order plugins are loaded
can be configured explicitly by the admin
processing for c,u:
in parallel
Requests:
subscribe/unsubscribe to events
grundlegendes Format:
[Länge: 4 Bytes] [Payload]
[Token: 4 Bytes] [Opcode: 2 Bytes] <abhängig vom Paket-Typ>
Token:
vom Server ausgehend erstes bit 1 (Event)
vom Plugin ausgehend erstes bit 0 (Request)
Opcodes:
klassische Events
Custom-Events
Requests
Registrierung auf Events:
Event-Typ: 2 Bytes
Handler-Typ:
w: Kann Events verändern/canceln
c: Erhält alle Events, auch gecancelte
u: Erhält nur nicht gecancelte Events (sollte für die meisten Plugins ausreichen)
Abarbeitung bei w:
Ladereihenfolge der Plugins
ggf. explizit vom admin angegeben
Abarbeitung bei c,u:
Parallel
Requests:
subscribe/unsubscribe to events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment