Jericho1060 / DU-Industry-HUD

A simple HUD for monitoring and managing industry in Dual Universe
GNU General Public License v3.0
38 stars 19 forks source link

Data collector lua simply stops on line 33 (MyJson.parse) without error message #12

Closed DorianTheGrey closed 4 years ago

DorianTheGrey commented 4 years ago

Did exactly what was written in the installation instruction, but encountered a weird problem:

In unit.start() of the collector, lines 30+ the MyJson.parse command seems to stop the script without throwing an error. I verified by adding system.prints. The second one never gets displayed. Therefore, the collector doesn't save any data to the databank, so the master displays the devices (but of course the master thinks they are not connected).

[Lines 30+ ...]

if databank ~= nil then local refresh_id_list = {} system.print("DISPLAYED") if databank.hasKey("refresh_id_list") then refresh_id_list = MyJson.parse(databank.getStringValue("refresh_id_list")) end system.print("NEVER DISPLAYED") for i = 1, #industries, 1 do

[...]

Any ideas?

DorianTheGrey commented 4 years ago

The user was the problem. The DB was not connected properly. But I am surprised databank wasn't nil then.

Jericho1060 commented 4 years ago

Hi, i'm not sure to understand what heppened to you Just to let you know, the master program is sending to all datacollection program the list of machines currently displayed to make sure only theses ones a refresh to avoid any CPU Load error

this is not complettely blocking the data colection board, it is starting because i can't know where the machine are connected. It's just doing nothing.

DorianTheGrey commented 4 years ago

Hi mate, yes, I understand the concepts, it's a really nice lua, thanks a lot for it. 👍

What happened to me was that I forgot to link the databank, and still the statment "if databank ~= nil" is true, so the code afterwards got executed (my first system.print was firing up), but afterwards nothing happened. So I just was confused. Linking up the databank makes it work perfectly now. Thanks again!

Jericho1060 commented 4 years ago

tested, not happening to me. strange