Skip to content
TORNLIFE More

[SOLVED] Ranked war report

Started by YazanZed [3258052] on in API Development.

10 replies · 78 views · thread synced · 4 days ago · View on torn.com
About this thread

Posts archived: 11 / 11 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
11
Discussion span
→
People posting
2
Likes on archived posts
1
Authority score
51 / 100
Historical score
17 / 100
Story score
27 / 100
Engagement score
50 / 100
YazanZed [3258052]

How are the number of attacks counted in the War Report response?

For example, are attacks on a faction outside of the war counted in the report as well?

Comparing this to the result I get from the Faction/Attacks endpoint (filtered by the war start and end date timestamp), I see a slight difference in value.

YazanZed [3258052]

The report you see in torn only includes war targets

 

that what i know so far, but when i fetch the faction attacks logs from api v2. i notice missing logs from response and sometimes extra hits. is there a way to check which attack logs linked to war reports? 

Omanpx [1906686]

Api returns all faction attacks (100 for faction/attacks and 1000 for faction/attacksfull, you have to use from / to to get more). If you use faction/attacks, there is a war multi in the modifiers. 2 is war hit, 1 is non-war hit.

YazanZed [3258052]

i know all of this, and that is what i'm using right now (faction/attacks endpoint) to compare logs with ranked war report. for calculating war hit, i'm filtering result by checking "is_ranked_war" property value from api response 

Omanpx [1906686]

Check the war modifier instead / as well. I'm not sure is_ranked_war shows the correct value on stealth attacks (never used it personally).

YazanZed [3258052]

Checked right now, the results are the same as my method. and yes, it shows the corrected value with stealth attack, here is a sample:
"result": "Attacked",
      "respect_gain": 8.79,
      "respect_loss": 2.2,
      "chain": 1088,
      "is_interrupted": false,
      "is_stealthed": true,
      "is_raid": false,
      "is_ranked_war": true,
      "modifiers": {
        "fair_fight": 2.53,
        "war": 2,
        "retaliation": 1,
        "group": 1,
        "overseas": 1,
        "chain": 1.51,
        "warlord": 1
      },

YazanZed [3258052]

The difference is that there are missing records from faction/attacks response compared to the number of hits in the war report.

p.s: I included the possibility of a timestamp issue, meaning that an attack initiated before the war began and ended after it was declared. However, that did not resolve the issue.

Omanpx [1906686]

Have you tried the same approach with API v1? Also, have you tried adding +- 1 hour to the war start / end, and filtering the data afterwards? I believe the timestamps refer to attack start, not end, so keep that in mind as well.

YazanZed [3258052]

have you tried adding +- 1 hour to the war start / end, and filtering the data afterwards? I believe the timestamps refer to attack start

 

It's working now! Thanks so much for this.