liamcottle / rustplus.js

Unofficial NodeJS library for controlling Smart Switches in the PC game Rust
224 stars 46 forks source link

Camera Subscriptions #57

Closed Electric131 closed 1 year ago

Electric131 commented 1 year ago

Issue when subscribing with a camera results in error code "ERR_UNHANDLED_REJECTION"

Copied code from the example for rendering, the code works when camera.subscribe line is removed.

liamcottle commented 1 year ago

You'll need to catch the error from the subscribe promise, but my assumption is that the camera id you have supplied is not valid.

Note: Rust+ devs made changes to prevent watching static cameras on oil rig etc.

Electric131 commented 1 year ago

After adding a catch to it, no error seems to even be logged but now it works. I just feel it is annoying the example doesn't seem to work out of the box.