DFOnline / CodeClient

A DiamondFire utility client for advanced coding.
MIT License
12 stars 8 forks source link

Crash when using scan on an empty plot #72

Closed Amp63 closed 1 month ago

Amp63 commented 2 months ago

Describe the bug If you try to use the scan feature from the API on a plot with no templates, the game crashes.

To Reproduce

  1. Go to an empty plot on DF
  2. Run the 'scan' command through the api, I used the following script:
    import websocket
    ws = websocket.WebSocket()
    ws.connect('ws://localhost:31375')
    ws.recv()  # auth
    ws.send('scan')
    ws.recv()  # received templates (should be nothing)
    ws.close()

Expected behavior The response is an empty string or some other indicator that no templates were found.

Screenshots Here's the crash report: https://bytebin.lucko.me/bH1lOkgVdQ

Checks Please check all these for more infomation with the bug.

GeorgeRNG commented 1 month ago

A little late to commit this fix, it should now just respond with empty. (fixed in this commit)