yuyuvn / KanColleViewer

Support both Horizontal & Vertical in one version
MIT License
109 stars 52 forks source link

Material logger only take logs at ship destruction. #64

Closed icylogic closed 9 years ago

icylogic commented 9 years ago

It seems that in these lines, material logger subcribes 3 events: api_get_member_material, api_req_hokyu_charge and api_req_kousyou_destroyship https://github.com/yuyuvn/KanColleViewer/blob/master/Grabacr07.KanColleWrapper/Logger.cs#L83-85 But in ver.3.8.2r556, it only take logs at ship destruction.

In addition, the counter of "resupply times" works properly

gakada commented 9 years ago

Are you sure?

https://github.com/yuyuvn/KanColleViewer/blob/v3.8.2r556/Grabacr07.KanColleWrapper/Logger.cs#L83-85

I downloaded and tried in ver.3.8.2r556 and it logs in MaterialsLog.csv on resupply (kcsapi_charge).

gakada commented 9 years ago

So kcsapi_charge and kcsapi_destroyship work, while kcsapi_material isn't (?), I guess it supposed to be called on ship construction, but

https://github.com/yuyuvn/KanColleViewer/blob/master/Grabacr07.KanColleWrapper/Logger.cs#L187

while I get source.Length == 8, so maybe this should be changed.

Also, we can subscribe to createitem.

Or not subscribe to any of these and subscribe to port instead, while tracking resource changes in Logger, that way it will log every time you go to the homeport and when resources had changed.

icylogic commented 9 years ago

@gakada

Thanks for your quick response.

Today I've resupplied 24 times. 2015-07-30_19-21-03 And there are only 3 material logs which immediately occurred as I destroyed ships. 2015-07-30_19-20-11

Is it possible that the new type of material ("改修", equipment improving) enlarge the materials list, so the length changes to 8? I've not check it yet. At least these usages of magic number is not a good style.

I agree that we could simply subscribe to port, since almost all events happen with changes of materials in fact.

gakada commented 9 years ago

I can't reproduce it, every time I scrap or resupply it appears in the file and in Log Viewer.

65 use subscribing to port (with 改修 logging).

icylogic commented 9 years ago

I've just tested that pr, it works for me, thanks!