Comments (8)
Ah! I got it working. You were right; Just had to convert the unsigned values into signed ones 🙂
I used this function to convert the number, if anyone else is having the same issue (Python).
def twos_comp_32(val):
val = int(val)
if (val & (1 << (32 - 1))) != 0:
val = val - (1 << 32)
return val
Thank you for your help!
from api.
Hmm, that's odd - I see it in there, look for index 925 (name = "Speed of Dark"). Oh, could it be that the hash is being converted to an int instead of a uint in your code? I know this has tripped people up before. Let me know!
from api.
I'm not quite sure where 925 is coming from. I'm still a bit confused.
If the hashes are all unsigned ints, how come I am seeing negative values in my sqlite viewer? Could it be displaying the numbers as signed values?
from api.
Ah, yeah - the index property of the contained item will be 925 when you pull it out of the database.
Indeed: sqlite viewer must be treating those as signed values. Convert your unsigned value into a signed one and make the query again in sqlite viewer, and you should find the result. It's the same limitation and trick that people had to pull in Destiny 1:
http://destinydevs.github.io/BungieNetPlatform/docs/Manifest
(take a look in here under "Entry IDs")
I still need to add a section to our wiki about the Manifest and these... er... quirks.
from api.
Sweet, no problem - and glad you got it working! That is definitely an extremely unintuitive problem with the Manifest, and warrants a new FAQ entry on my part (and eventual Wiki article about the manifest in general)
from api.
Hm...I don't understand how we can check signed or unsigned number?
from api.
If you're using unsigned, you'll never have negative numbers. Whereas with signed, you will (approximately half the time).
from api.
@artem-galas A good, quick formula you can use to convert is the following, that'll convert the values when needed for you: (or you can do the bitshifting jgayfer is doing above of course! That's arguably faster and truer to what's actually happening under the surface, but whatever floats your boat)
if (hash < 0)
{
hash = hash + 4294967296;
}
That will push it up to its unsigned equivalent value.
... indeed, this is a most inconvenient hack, and one that the community has had to endure for quite some time. When we get around to putting out JSON files directly, this won't be an issue anymore (though you will have to convert strings to unsigned ints... but you're already having to do that, so I imagine that's a more obvious problem than this signed/unsigned problem)
from api.
Related Issues (20)
- Contest Instances Missing HOT 3
- Prismatic subclasses `screenshot` fields missing HOT 2
- Text conversation is not active
- Text conversation does not change from disabled to enabled HOT 1
- Weapon property is wrong? HOT 1
- A means of seeing the total number of kills of each weapon used for a given character. HOT 1
- Question: Pathfinder quests via API HOT 2
- Missing Item after Transfer HOT 7
- typos in DestinyActivityDefinition manifest
- Inconsistent Paging Parameters HOT 2
- Adjust Hawthorne's reputation name - currently set to "Reputation Max Rank" 🙈
- Add engram balances for Hawthorne, Xur (Tower) and Rahool to CurrencyLookups [component 600]
- Competitive matches are mistagged.
- Iron Banner Milestone is missing HOT 1
- nothing manacles and ursa furiosa plugsets differ between implementation and manifest
- DestinyActivityInteractableDefinition is missing from sqlite definitions HOT 1
- Add all resettable-reputation vendors to currentRankProgressionHashes
- API does not report red border weapons in the season pass reward track
- Test interface status 302
- itemTypeDisplayName for Salvation's Edge raid mods is drastically different from every other mod
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 api.