oeed / CraftOS-Standards

Community standard file formats, communication systems, etc. for ComputerCraft and CraftOS 2.0
Other
20 stars 16 forks source link

Generic Remote Backend API Standards? #71

Open Merith-TK opened 1 year ago

Merith-TK commented 1 year ago

So looking at the code for several projects that allow remotely controlling computers/turtles, I noticed one major problem with all of them

they are a complete and total clusterfuck and barely work, like Ottomated's, when ran by others who are NOT him, its held together by moist chewing gum at best, Exabyte's panel caches everything to the panel with no way of resetting it outside of completely and totally wiping everything, and refuses to release the updated code which is less congested and more readable than the current public code despite the project being effectively dead

I personally feel like there should be a standard for the data an turtle provides to the backend and the method in which it should provide it.

Proposed Data is based off of my Ultron Control API,

{
  "name": "debug", // computer name
  "id": -1, // computer id
  "inventory": [ // only applicable if turtle, otherwise this will be empty
    {}, // contains table returned from 'turtle.getItemDetail()'
        // 16 total of these entries
  ],
  "selectedSlot": 1,
  "pos": { // preferably fetch from GPS, but if user wants to use their own GPS system in their turtle code, as long as they provide this data, sure
    "y": 0,
    "x": 0,
    "z": 0,
    "r": 0, // 0 north, 1 east, 2 south, 3, west
    "rname": "north"
  },
  "fuel": { //only applicable for turtle
    "current": 0,  // return -1 on both if fuel is infinite
    "max": 0
  },
  "cmdResult": {},
  "cmdQueue": [],
  "miscData": [] // This data would persist on Computer/Turtle, and would effectively be an storage area, could be used for storing notes, stuff to reference, scripts, etc between turtle reboots
}
EmmaKnijn commented 1 year ago

Could be cool, I'd suggest making a proposal for it

Merith-TK commented 1 year ago

I don't feel 100% confident in my ability to make an official proposal