882 posts
Location
Behind you.
Posted 23 February 2014 - 03:27 PM
I'm editing a handful of the APIs to add some stuff that I think are helpful when programming my new OS, so I would like your opinion on anything I should add.
ADDED:
peripheral.all() returns a table containing all peripherals directly next to the computer.
PLANNED:
None currently.
1852 posts
Location
Sweden
Posted 23 February 2014 - 06:00 PM
Doesn't
peripheral.getNames() essentially do the same thing?
You could pretty much do this
peripheral.all = function()
local t = peripheral.getNames()
return peripheral.getNames()
end
And there's your function :P/>
Anyway.. Maybe a function in fs that lets you create/mount/unmount a virtual disk/folder/computer? :P/>
The only upside of this is that it wouldn't fill your HDD if you have limited size.
500 posts
Posted 23 February 2014 - 06:04 PM
peripheral.all = peripheral.getNames
^ Even better ^ :P/>
882 posts
Location
Behind you.
Posted 23 February 2014 - 06:13 PM
Didn't know they had that :P/>
Thanks for the feedback, now I can delete useless code.
Any other ideas?
995 posts
Location
Canada
Posted 24 February 2014 - 12:15 AM
I'm not gonna even start listing the things that are currently implemented in my OS, but here are a few off the top of my never-ending to-do list:
Mounting the storage on CC virtual machines (yes, you can make a CC virtual machine, in CC, to do regular VM stuff like test OS's, limit storage, etc.) to your regular storage EDIT: Derp. It already is, quite obviously. Just in a hidden (dot-prefixed) folder. I got up early to watch the Olympic Hockey Final, and I went to bed later then normal that same night, so I didn't get much sleep.- A call to wrap peripherals on other servers (provided they are all in loaded chunks and such) through the HTTP API. (I've got a basic concept going, but I need to make it more noob-friendly. Also, it currently requires you to host your own PHP script (which will be provided, but you have to host it.).)
- A call to mount the storage of other computers on other servers to your local storage. (Just like above, loaded chunks and hosting and blah blah blah…)
Edited on 23 February 2014 - 11:18 PM
882 posts
Location
Behind you.
Posted 24 February 2014 - 12:53 AM
1: What do you mean by mounting the storage?
2: I have no idea how I would possibly connect two computers - or peripheral to computer - through the HTTP API (sockets would be very helpful here).
3: Seriously, add sockets. It would be so much easier for a dev to just add sockets.
995 posts
Location
Canada
Posted 25 February 2014 - 09:58 AM
1. The first point in my list is strikethrough'ed
2. Through the PHP scripts. CC computer http.post's to a page with instructions, and after x (adjustable to stop spam) time has passed, CC computer 2 goes to a different URL which contains a page with instructions. Works with the CC HTTP API, no peripherals needed.
882 posts
Location
Behind you.
Posted 25 February 2014 - 10:19 AM
I will never use PHP, if anything I'll design my own light server.
995 posts
Location
Canada
Posted 26 February 2014 - 06:02 AM
Any reasons against PHP? I like listening to others' opinions on coding.
882 posts
Location
Behind you.
Posted 26 February 2014 - 07:41 AM
I just don't like the language. It would be easier for me to custom design a server for it than to use PHP for it.
169 posts
Posted 26 February 2014 - 09:20 PM
I don't have anything against PHP (but I do admit some parts of the language are badly designed), I even use it in my projects. However, I agree with you that for this type of project, it would probably be better to write a quick web server in node.js as opposed to using Apache/nginx.