-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stand-alone client #5
Conversation
Oooh awesome! Yes, we definitely need a standalone client. The relay was put up as a way to start figuring the protocol out without having to mess with packet captures. |
var pipboylib = require('pipboylib') | ||
var relay = require('pipboylib/lib/relay') | ||
var pipboylib = require('pipboylib'); | ||
var relay = require('pipboylib/lib/relay'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amusingly, a friend of mine lambasted me for going the no-semicolon route while another praised it.. I actually prefer them in, so I welcome this. There's even a linter for this style with a presidential seal of approval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent so much time removing semicolons :P I use them at work, it will take some time :P
Before obama there was semistandard (part of the same group of projects as standard)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I come from a C++ background and semicolons are the way of my people, though I am prepared to accept defeat and write w/o the semicolons if that's the majority decision 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bring on the semi-colons!
I'm a bigger fan of them existing since that's how people tend to learn JavaScript and folks don't need to understand automatic semicolon insertion. Sorry about starting us off on a polar topic. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, obama is all semistandard under the covers. I made it in frustration of dueling linter wars.
var dbTypes = {}; | ||
|
||
var dbEntryType = ['Bool', 'Int8', 'UInt8', 'Int32', 'UInt32', 'Float', 'String', 'List', 'Dictionary']; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually have these setup in pipboylib as a parser thanks to @nelix. Can we bring more of this type of functionality there, supplementing where possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure how you'd prefer to split up the functionality between the two projects. Feel free to split this up and move it around however you deem necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, always happy to git cherry pick
.
Perhaps I should have outlined it in each. My intention was that bits that would be useful by any node application would go to pipboylib
while pipboyrelay
is one cli tool that uses them.
I've started a repo for a browser-based client to the socket.io server - https://github.com/AlexanderDzhoganov/pipboyclient Got real-time world map working - screenshot here |
This is very cool, I am stuck at work so I can't play with it yet. |
@@ -0,0 +1,32 @@ | |||
require('buffertools').extend(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you seen https://github.com/rgbkrk/pipboylib/blob/master/lib/parser.js
You seem to have implemented way more protocol though!
The api I would eventually like to have would allow piping the relay into the parser into websocket/filters/whatever into serialiser into relay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to merge my code with the pipboylib parser and make a PR to the other repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you like, I am happy to explore a few different directions.
We could try a few different angles on the parser and the cli.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Hot damn. Well done. |
Looking through both this PR and your really excellent client @AlexanderDzhoganov - it would make a lot of sense to make it be an Electron app. You wouldn't have to use socket.io (direct node-to-browser just fine in Electron) and user's won't be running servers on their machines, just a full native app they can download. |
I have done some clean-up and moved most of the code to a separate PR in pipboylib. I have removed all of my changes to |
io.listen(SOCKETIO_PORT); | ||
console.log('Socket.io server listening on port ' + SOCKETIO_PORT); | ||
|
||
pipDecode.on('db_update', function(data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This looks much easier to manage. Nice work! 👍
Wow I finally looked at that JSON dump. Definitely huge. 😄 |
Ok, yeah this is looking really nice. I went through and reimplemented this locally using pipdb and pipdecode and it made me realize where the relay fell short. If I connect, disconnect, connect, I end up putting the state of the last |
Awesome. I think this is ready to at the very least be part of the current relay right now. |
Definitely wondering if we should be doing some post processing of the db to turn all the arrays of Tradeoffs are that we're currently mirroring the actual format vs. something friendly to reach into programmatically in JavaScript (assuming order may change). |
@rgbkrk If you implement it as some kind of mapping, I could see that being nice. Flipside though, if this ends up being used by other services expecting parity with the wire protocol, it could cause some divergence. Maybe once there's specific needs? |
Yeah, that's definitely the tradeoff. You'd think that if folks expect true parity with the wire protocol that we would just saw the raw bytes at that point. Way more compressed, certainly. |
Since the work for implementing 🚲 |
If you change the order or style of the Tree, you should remember that updates always have an index in the db. So you must always trace back how you changed ist. Better is a type of overlay to the db. |
Now that rgbkrk/pipboylib#14 is merged, think this is ready? |
Yes, we should probably merge this now. |
I've managed to parse the game database thanks to this document by NimVek (Huge thanks for writing that!). The JSON blob is pretty large and contains a lot of info. Here is an example JSON dump.
Also I've started work on a standalone client (
standalone.js
) as the mobile app makes my device get quite hot after a while and running the app for hours on end is painful.Depends on https://github.com/rgbkrk/pipboylib/pull/10Depends on https://github.com/rgbkrk/pipboylib/pull/14