Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This is a early PR for discussion / feedback)
2nd half of PR here: #126
This brings in the concept of a
BroadcastProxy
. If you notice it is heavily based on the discussion and work in #59. The major difference is the ability to completely delegate or "proxy" messages to a handler that can both a) apply it's own coloring/style (or strip existing) and b) control how the data is output.The
ranvier.json
setup looks something like this:Where a basic implementation of a proxy may look like the following:
If you notice above a
target
Player may be assigned abroadcastHandler
(or whatever property you like) method. In the real world I'm using this for turn based battle screens where chat and combat log information fall into a specific region of the layout while in this mode.Streams need to attach if they wish to play:
For now I left the existing Broadcast.XXXX methods mostly alone, but I agree with some of the statements in #59 in that using a
options{}
is easier to deal with.There is also the issue of some of the
formatter
's being hard coded tocolorify
which really just plays withsty
. I'm getting around this right now by using my ownchannels.js
implementation that skips the passed in formatter and instead just uses my own scheme.Feedback and thoughts welcome!