node-minecraft-protocol icon indicating copy to clipboard operation
node-minecraft-protocol copied to clipboard

Using a stream pipeline module

Open rom1504 opened this issue 10 years ago • 5 comments

  • [ ] using a pipeline module :
    • easily add/remove stream
    • each step is 2 transform stream
    • redirect the error event of streams to the pipeline
    • java inspiration : http://netty.io/5.0/api/index.html + ctrl+f ChannelPipeline
    • node module that does a part of that https://github.com/juliangruber/multipipe
  • [x] move createPacketBuffer and parsePacketData from protocol.js to serializer.js
  • [x] client.js should somehow be a class used by both client.js and server.js

rom1504 avatar May 22 '15 23:05 rom1504

After rereading what client.js and server.js do, I think it does make sense to use client.js in server.js : server.js is a Server class that handle Client instances. So I'm checking that third point as done.

rom1504 avatar Jul 27 '15 00:07 rom1504

What's remaining is now only the pipeline module. That has been started here https://github.com/wtfaremyinitials/stream-pipeline but isn't quite done. Renaming the issue as "Using a stream pipeline module"

rom1504 avatar Jul 27 '15 00:07 rom1504

https://github.com/wtfaremyinitials/stream-pipeline has been inactive 8 months and is not published to NPM, but there is another module on NPM of the same name: https://www.npmjs.com/package/stream-pipeline - "When you want to connect several disparate pipes in a configuration driven way use this tool"

but wtfaremyinitials/stream-pipeline under the hood uses the pipe and unpipe node.js Stream API calls why not just use those?

deathcap avatar Jan 19 '16 02:01 deathcap

To avoid doing that much piping and unpiping (and error relaying and all) in https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/src/client.js and to make it easy to add/remove a stream in the pipeline.

rom1504 avatar Jan 19 '16 02:01 rom1504

@deathcap Hiya! I'm still here and alive, just super busy with school.

wtfaremyinitials avatar Jan 19 '16 03:01 wtfaremyinitials