Skip to content
TORNLIFE More

OC results

Started by cockroach [1338804] on in API Development.

14 replies · 214 views · thread synced · 8 days ago · View on torn.com
About this thread

Posts archived: 15 / 15 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
15
Discussion span
→
People posting
6
Likes on archived posts
0
Posts by staff, officers and moderators
3
Authority score
72 / 100
Historical score
24 / 100
Story score
28 / 100
Engagement score
53 / 100
cockroach [1338804]

I'm quite often not getting the results of OCs in faction crimes data after they are executed.  I'm storing the data I do get so i know I haven't downloaded a new state of the OC having been executed.



H_1527029101_1:Storing new OC 5432540 
H_1527336565_1:OC from api is 5432540 Political Assassination 0 

...

H_1527405302_1:OC from api is 5432540 Political Assassination 0   

and never saw it again  - anyone else had this?
cockroach [1338804]

I think I've figured it out - crime data queried from faction returns only 100 OC which is mostly the blackmails from the last 2 days (if most players are doing blackmail) and older crimes including today's planned robbery can be missing from data returned by the API.
Bug [1455582] Committee Committee

Best thing to do is pull data once an hour and store it locally. Although keep in mind if an OC is cancelled, it simply stops being listed and you have yo manually remove it from your list or write a clean up tool to remove then. :)

Edit: New phone, still breaking in the auto correct :/
tos [1976582]

Unless there is some reason you need planned crimes stored not just initiated easy solution is to only log if initiated is 1
cockroach [1338804]

I do pull the crimes and store in a db but the API only gives me 100 at once and may not show some recently executed.   I can't tell from that whether they are succeded, failed, cancelled or still waiting. 
Bug [1455582] Committee Committee

There's a initiated and success values for these, you can figure from time_left if it's still planning and it simply won't show if it's been cancelled.
cockroach [1338804]

I can do that - what I can't tell is what if the crime doesn't show at all (not because it's cancelled but because only 100 crimes are returned in a single api call).
Mafia [610357]

this case is like attacksfull that returned up to 10,000 results in a single api call

you have to think your own way how to keep previous records before incoming next 100(crimes)

you may interested to know how to solve your problem or get some idea by refferring to thread Attacksfull
cockroach [1338804]

I do keep the previous results.    Imagine a faction (100 players) plans a PA (4 players, 192 hours) and 48 blackmails (2 players, 24 hours). .  Next day they repat the blackmails while the PA is waiting.  The 3rd day they repeat the blackmails.  Now the PA is 48*3=144 crimes ago ans we will never see the outcome in the API.  It does not appear in teh top 100 even when executed.
Bug [1455582] Committee Committee

Are you sure? That sounds like a bug if so, I'm in a 100 man faction and I haven't missed any results other than cancelled crimes. We don't do PAs though but we have had a few very delayed crimes.
cockroach [1338804]

I agree its a bug - the 100 OCs returned seem to be the last 100 planned and not affected by the last change to the OC (being executed and getting a result is a change I would expect to see put them back at the top of the list.   I have a bunch of data to demonstrate how this is happening.
Jox [1714547]

OCs are sorted by id and that is practically order of creation. Because some OCs have lot less time to plan then others you can end up losing data. Ofbyou have lot of 1 and 2 day planing crime then you need to considter to update it often. Whenbyou store data make sure you are updating allbold data wit new one... they have same id...
cockroach [1338804]

That doesn't help.  I'm collecting data every half hour when I'm expecting an OC to be due and it can still be out of teh top 100 and completely out of sight.