Cuberite Forum
Dockercraft - A simple Minecraft Docker client, built using Cuberite ! - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Off Topic (https://forum.cuberite.org/forum-9.html)
+--- Forum: Off Topic Discussion (https://forum.cuberite.org/forum-10.html)
+--- Thread: Dockercraft - A simple Minecraft Docker client, built using Cuberite ! (/thread-2213.html)



Dockercraft - A simple Minecraft Docker client, built using Cuberite ! - nounoursheureux - 11-19-2015

I just stumbled upon this project made by the Docker team while browsing Github's "Explore" page, and I thought that it was a neat thing. It is a Docker client that uses Minecraft as an interface to manage the virtual machines. So I read the README and I found that it is built using Cuberite. Link: https://github.com/docker/dockercraft#how-it-works
I think it is pretty amazing that they managed to communicate with Docker from the server, even if they needed to use a hack with the WebTabs to communicate with the plugin


RE: Dockercraft - A simple Minecraft Docker client, built using Cuberite ! - jan64 - 11-19-2015

Actually, i do believe the hack isn't necessary anymore - we do have the network api.


RE: Dockercraft - A simple Minecraft Docker client, built using Cuberite ! - xoft - 11-19-2015

The webadmin has the added value that it provides HTTP parsing. If the Docker interface is using any form of HTTP, it would mean that they need to re-implement HTTP parsing on top of cNetwork API, which is not a simple task, the webadmin hack would make sense in such a case.


RE: Dockercraft - A simple Minecraft Docker client, built using Cuberite ! - sphinxc0re - 11-19-2015

We could build a cHTTPParser interface which could be used by the webadmin but also by any other plugin using the cNetworkAPI


RE: Dockercraft - A simple Minecraft Docker client, built using Cuberite ! - NiLSPACE - 11-19-2015

It shouldn't be too hard to do in Lua right?
--[[ Request header is something like this:
GET / HTTP/1.0
Host: cuberite.org
Other-Stuff: Info for other stuff
More-Stuff: Even more stuff
]]

local Headers = StringSplit(RawRequest:match("^.-\r\n\r\n"), "\n")
local PostInformation = StringSplit(Headers[#Headers], "&"):sub(2) -- Post starts with a question mark.



RE: Dockercraft - A simple Minecraft Docker client, built using Cuberite ! - xoft - 11-21-2015

Don't forget that the receive calls are asynchronous, you need to cache the response (or leftovers from it) between calls. And you need to know if you're still parsing the headers, or the body.