Using a stream pipeline module
- [ ] 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
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.
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"
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?
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.
@deathcap Hiya! I'm still here and alive, just super busy with school.