Skip to content
TORNLIFE More

[APIv2] Attacks returning wrong values

Started by Lee-Everett [423369] on in Bugs & Issues.

8 replies · 65 views · thread synced · 6 days ago · View on torn.com
About this thread

Posts archived: 9 / 9 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
9
Discussion span
→
People posting
3
Likes on archived posts
1
Posts by staff, officers and moderators
5
Authority score
56 / 100
Historical score
44 / 100
Story score
43 / 100
Engagement score
48 / 100
Lee-Everett [423369]

Recently I've started using APIv2.

 

Before on APIv1 i looked for modifiers.war != 1 to verify if the hit was a war hit or not.

 

After moving to APIv2 i noticed that losts, interrupts or assist no longer have this field at 2. 

Moreover the field 'is_ranked_war' = False

I don't believe this is expected, the value war == 1 is understandable but the is_ranked_war should be set to True in these cases.

splent [2088243] Admin Staff

Hey, 

Apologies for the delay in getting back to you on this. 

Do you have any examples of this that I could compare between v1 and v2? 

I can't really find anything which would indicate interrupts/assists/losts as war hits in API v1 either (v1 and v2 have the same source)?

 

It would probably make sense for these hits to be marked as war hits, so I'll see if I can add that somehow.

Thanks!

Lee-Everett [423369]

Looking back now, I don't seem to find this. Weird as it is. Anyway if is_ranked_war could be true in these cases would be awesome to track what was or not a war hit

splent [2088243] Admin Staff

I can somewhat easily do it for faction attacks, however it is a little bit harder to do it for 'user' -> 'attacks', but I'll see what can I do. 

splent [2088243] Admin Staff

Hey, 

 

This should be fixed now in the 'faction' -> 'attacks' selection in API v2. 

If the attack was made against a ranked war faction (even if it was a loss/stalemate/interrupted or something else), the 'is_ranked_war' will appear as 'true'. 

Please let me know if you find any discrepancies again.

Thank you!

Lee-Everett [423369]

Hey splent, 

I've just reran this and apparently it is still not happening. Attached a json response as an example


"id": 396844571, "code": "62c5c6113454072437a2e98a8254b160", "started": 1757940808, "ended": 1757940828, "attacker": {"id": 3623374, "name": "Pholder", "level": 40, "faction": {"id": 20303, "name": "The Saviors"}}, "defender": {"id": 633872, "name": "Bmista", "level": 50, "faction": {"id": 8802, "name": "Luscious Incarnation"}}, "result": "Assist", "respect_gain": 0, "respect_loss": 0, "chain": 0, "is_interrupted": false, "is_stealthed": false, "is_raid": false, "is_ranked_war": false, "modifiers": {"fair_fight": 1, "war": 1, "retaliation": 1, "group": 1, "overseas": 1, "chain": 1, "warlord": 1}, "finishing_hit_effects": []}