I'm trying to implement the console system and I was able to get to stream content from the server process to the web page (route /) in real time.
My problem now is the execution of commands. When using the terminal directly I can execute commands just by typing /command.
So I created a route /test which should execute the command /status on the minetest server console but it doesn't execute it. I also tried to execute the command /kick SonoMichele (which is my in game name) but it doesn't kick me so I'm sure the command doesn't get executed.
The problems are that the command doesn't get executed and that the connection with the process get closed after the line
Code: Select all
SERVER_PROCESS.stdin.write(b"/status")
Code: Select all
SERVER_PROCESS
Code: Select all
NoneType
I also tried using
Code: Select all
SERVER_PROCESS.communicate(input=b"/status")
Here is my code (it's a Flask web app which I run on start.py using
Code: Select all
app = create_app()
Code: Select all
app.run()
I don't know if it is relevant but when I run the command
Code: Select all
minetestserver —terminal
Here you can find the pypi page of the shelljob library.
Hope you can help me with my problems and thank you in advance.