swift-project / pilotclient

Cross-platform cross-simulator pilot client for virtual air traffic networks
https://swift-project.org
GNU General Public License v3.0
89 stars 26 forks source link

Argument type mismatch in log messages about loaded VATSIM server file #259

Closed ltoenning closed 1 month ago

ltoenning commented 5 months ago

The log function for the server file expects the argument as number of lines:

https://github.com/swift-project/pilotclient/blob/7e6f3f0f0d8bda6ec082f0947a6cf69dae4fc7c3/src/blackcore/webdataservices.cpp#L1350-L1353

but the argument of the signal triggering this slot is kilobytes:

https://github.com/swift-project/pilotclient/blob/7e6f3f0f0d8bda6ec082f0947a6cf69dae4fc7c3/src/blackcore/vatsim/vatsimserverfilereader.h#L53-L55

As the input file is in JSON format, the number of lines also doesn't really make sense here. Further, as the server file is pretty small and the conversion to kilobytes is handled as an integer division, the result is always 0. Maybe the argument should be passed as double/float instead.