Minecraft-Console-Client
Minecraft-Console-Client copied to clipboard
Web acces
As the title said a simple password protected web acces can be really cool!
That's a good idea! However I don't have enough time myself to work on GUIs, but maybe someone else would be interested?
Although this is a 4 years old issue, I want to say that WebUI is definitely an interesting idea and I am already working a bit on it!
Looks nice! I don't have much time to work on MCC lately, but your work is amazing! 😉
I am using https://github.com/sta/websocket-sharp to create WebSocket server for communicating with the web client. What is the best way to add the project reference to MCC? Currently I am referencing to the .dll
file directly but it will break on other's machine since they don't have the file.
<Reference Include="websocket-sharp">
<HintPath>..\..\websocket-sharp\websocket-sharp\bin\Release\websocket-sharp.dll</HintPath>
</Reference>
Do I add the .dll
to MCC's project folder or get the that project from NuGet?
This will likely not work on .NET 4.0 but I'm not sure how to reference the DLL only if the user wants to enable the WebUI 🤔
I was able to embed the .dll
file to a resource file and load it only if the webUI is enabled. This way the .dll
is embedded in MinecraftClient.exe
and user doesn't need to download any extra file if they want to use the webUI.
About the development direction of the WebUI, do we integrate it into MCC for gaining full control from the webUI or just limit the scope to ChatBot API only? Which approach should we choose? Currently I am using the ChatBot API only.
As long as the WebUI has proper authentication and is fully optional, you can upgrade it to provide full remote control, that seems cool. You can also do a separate executable that runs MCC like the example GUI in the project. Both approaches are valid anyway.
I tried my best to make a working basic "remote shell" for sending and receiving messages. Honestly I am not very good at designing UI. Also I haven't considered the thread safe issue.
Now I am lacking of ideas what features is great to be added in the WebUI.
Pretty neat 👍 For thread safety just look at the built-in SendText() method in McClient.cs and look how it uses a lock. If you use this method or the one in ChatBot API you already are thread-safe.
The problem is not about the SendText()
but command execution. McClient.cs
is not fully thread safe and some command could crash the client. For example the /entity
command. (Translation: Collection was modified; enumeration operation may not execute.)
I am trying my best to fix them by adding locks.
On the other hand, I am thinking maybe I could introduce a "multi-instance" mode for MCC with web interface, which allows user to login to multiple server and manage them from web interface with single MCC running. I have already made a bare bone poc and it was working fine on local server. I guess that would require a huge change to the whole project if we take this idea. What is your view?
You could theoretically do it by creating multiple McClient instances, although I never tried.
Regarding thread safety, the CommandPrompt()
method runs in a separate thread so maybe you could look at it 🤔