Wingysam / Galaxy-Info-v2

Galaxy Info is the all-in-one solution to gathering and accessing information about Galaxy.
https://info.galaxy.casa
3 stars 2 forks source link

Websocket system #19

Open cswimr opened 4 months ago

cswimr commented 4 months ago

The developers of Ketchupbot have requested a websocket system, where they can connect to said websocket and get sent websocket messages whenever a ship is updated, containing the updated ship stats as well. This issue will track progress on adding this functionality. I'll go into more details on implementation after I get a feel for the codebase.

smallketchup82 commented 1 month ago

I'd like a progress check on this. If it's not being actively developed, then I may take it upon myself to do this. I've since stopped developing in typescript/javascript and am most comfortable with C#. So my implementation might be half baked.

Let me know what's up with this.

Wingysam commented 1 month ago

My suggestion for the implementation of this:

  1. Listen for WebSocket connections on /api/v2/ships/ws.
  2. When Celebrimbor POSTs ship data to Galaxy Info, iterate through every ship, and check if it was changed, and if so, send it to every connected socket.