Comments (3)
Node seems to be able to handle it. It's probably something in the coding.. time to dive. :/
$ node
> s = 130990020780514880;
130990020780514880
> o = { s: 130990020780514880 }
{ s: 130990020780514880 }
> new Date(s / 10000 - 11644473600000);
Wed Feb 03 2016 14:41:18 GMT-0500 (EST)
> new Date(o.s / 10000 - 11644473600000);
Wed Feb 03 2016 14:41:18 GMT-0500 (EST)
> console.log(s);
130990020780514880
undefined
> console.log(o.s);
130990020780514880
undefined
> console.log(o);
{ s: 130990020780514880 }
undefined
> console.log(JSON.stringify(o));
{"s":130990020780514880}
undefined
> JSON.parse(JSON.stringify(o));
{ s: 130990020780514880 }
> j = JSON.parse(JSON.stringify(o));
{ s: 130990020780514880 }
> j
{ s: 130990020780514880 }
> new Date(j.s / 10000 - 11644473600000);
Wed Feb 03 2016 14:41:18 GMT-0500 (EST)
from heroprotocoljs.
The number is passing through VersionDecoder.prototype._vint
in decoders.js
, my guess is incorrectly, despite the function being exactly the same as the python version.
Python 2 (I have ZERO experience in Python) says "int" is a signed 32-bit, so that doesn't make much sense that it's a 64-bit number, unless Python does some magic that auto-converts it.
It looks like the VersionDecoder.prototype._vint
function in decoders.js
will need a shim.
from heroprotocoljs.
Fix is in jnovack/heroprotocoljs#long branch and can be applied once #37 is accepted.
from heroprotocoljs.
Related Issues (20)
- Replays from newer patch uses older protocol HOT 1
- Code commenting HOT 1
- Prettying up and modernizing the code HOT 4
- Tests HOT 1
- Write initial replay.game.events reference HOT 1
- Grunt HOT 1
- extract.js - add options to only extract certain files HOT 2
- extract.js - add option to skip existing files HOT 2
- extract.js - keep directory structure when extracting directories recursively
- Write initial replay.attributes.events reference
- Query tool HOT 6
- Spread operator not supported in Node v4 HOT 2
- extract.js - pretty mode should sort properties alphabetically HOT 3
- TypeError: decoder.CorruptedError is not a function HOT 2
- One less abstraction layer... HOT 2
- _gameLoop in tracker and game events is null HOT 2
- Post-Install Download of Original Repo HOT 2
- Not working HOT 5
- Matching BNet account HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heroprotocoljs.