Posts: 4,634
Threads: 115
Joined: Dec 2011
Thanks: 695
Given 495 thank(s) in 424 post(s)
01-03-2017, 11:54 PM
(This post was last modified: 01-04-2017, 12:43 AM by NiLSPACE.)
I really like the idea. Should we also allow hooks for programs that interface with libcuberite though? That way it should be easy for programs to know if a player joined or left or if something else happened. Is it even possible to do this properly? We're hesitant to implement C++ plugins because it's not easily done for multi-platform. If we don't do something like this all you can pretty much do is start and stop a server.
Posts: 681
Threads: 26
Joined: May 2014
Thanks: 112
Given 48 thank(s) in 37 post(s)
What I'm trying to do is putting together a todo list for the libcuberite migration. But I really don't know what is needed for that.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Some form of "hooks" would be beneficial and in fact even necessary. If the server is to be restarted using webadmin, libcuberite needs to notify the wrapper app about that; console output will be provided as a callback. So whatever API we implement for use between libcuberite and the wrapper app is up to us.
Note that this would benefit from de-singleton-izing the entire server (so that multiple cRoot instances are allowed) - the wrapper can then create a cRoot instance, initialize it with whatever settings and callbacks it wants and then run it. Not sure how to handle logging, though.
Posts: 108
Threads: 1
Joined: Aug 2016
Thanks: 22
Given 15 thank(s) in 11 post(s)
Now that I almost finished android app....... Although I don't like the jni for running cuberite on android (for the reasons, see our long discussions on github) separating the cli and a library seems good, although I don't know whether the benefits are greater than the drawbacks (especially for installing updates frequently it wouldn't be good to tighten cuberite with the respective app, bug reports would suffer too (you can handle a webinterface with ease by just running separate processes and you would have consistent code base and therefore the same bugreports. It's just easier than strange bugs appearing only on one platform). And a web app would be the next thing I would do after android.)
Posts: 3
Threads: 0
Joined: Jan 2017
Thanks: 0
Given 0 thank(s) in 0 post(s)
Hi - I just joined hoping to find some discussion about setting up Cuberite as a C++ library.
With such a library, would it be possible to integrate cuberite into another language?
I ask because I've developed a Common Lisp compiler that interoperates with C++ and I've always dreamed of tying it into Minecraft somehow. I'd like to teach my daughter to program and a Common Lisp repl that controls a Minecraft world and generates code that runs almost as fast as the C++ code that it is interoperating with was something that I've always wanted.
Interpreted Lua is fine for scripting but it is not going to be fast enough for the stuff I want to do and teaching C++ is... well - you know.
Posts: 681
Threads: 26
Joined: May 2014
Thanks: 112
Given 48 thank(s) in 37 post(s)
Sounds like a good project. I guess it is totally possible to write bindings for any other language.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Although possible, it would be an enormous amount of work to actually do that, and even more work to maintain.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
No, not that likely. Things are still too much coupled, and the UI / backend decoupling that we're discussing here is not nearly enough for a chunk server.