DarkCat09 / python-aternos

[UNMAINTAINED] Unofficial Aternos API written in Python
https://pypi.org/project/python-aternos/
Apache License 2.0
92 stars 13 forks source link

Passing commands to the console #65

Closed reka7490 closed 1 year ago

reka7490 commented 1 year ago

EN: Hi, I have a question is it possible to enter commands into the server console somehow? RU: И снова привет у меня есть вопросик а можно ли как то вводить команды в консоль сервера?

DarkCat09 commented 1 year ago

Duplicate of #20

DarkCat09 commented 1 year ago

Here is an example how to read and write to the server's console: https://github.com/DarkCat09/python-aternos/blob/main/examples/console_example.py
You have to use Websockets API. And rememeber to start the server before working with console.

DarkCat09 commented 1 year ago

По-русски:

Вот пример, как читать/записывать в консоль: https://github.com/DarkCat09/python-aternos/blob/main/examples/console_example.py
Это делается через Websockets API. И не забудьте запустить сервер перед тем, как отсылать запросы к консоли.

DarkCat09 commented 1 year ago

I hope I've answered the question.
Надеюсь, ответил на вопрос.

reka7490 commented 1 year ago

EN: not completely, but is it possible to do plug and play? (it is inconvenient to turn off and turn on the server so that commands go to the console) RU: так может я глупый но консоль работает только если сервер включен через неё но можно ли как то обойтись без перезапуска и просто подключиться к консоли?

DarkCat09 commented 1 year ago

@reka7490,

Да, команды можно отправлять только когда сервер запущен.
Использование wss.send() на остановленном сервере ничего не даст.

Yes, commands can be sent only when server is running.
Using wss.send() when server is stopped doesn't give any effect.

reka7490 commented 1 year ago

EN: ...uh Okay I'll just show you what I mean RU: ладно я просто покажу что имелось в виду image

reka7490 commented 1 year ago

да блин ладно просто на русском объясню короче в файле примере есть запуск сервера s.start() я его удалил вручную запустил сервер (полностью) потом запустил файл пример но консоль не заработала могу кинуть скрин кода если нужно

DarkCat09 commented 1 year ago

@reka7490,

Спасибо, я уже понял.
Будет время, проверю у себя. Такого быть не должно.

reka7490 commented 1 year ago

окк

DarkCat09 commented 1 year ago

1 more question. Which version of python-aternos do you have?
Ещё вопрос: какая у Вас версия модуля?

reka7490 commented 1 year ago

image

reka7490 commented 1 year ago

image EN: okay I updated all the modules using pip and checked the error again the error remained RU: я обновил все модули но ничего не изменилось

DarkCat09 commented 1 year ago

@reka7490,

У меня всё работает.
Вы нажали Y когда скрипт спросил "Show responses"?

It works for me.
Did you press Y when the script asked "Show responses"?

reka7490 commented 1 year ago

image EN: no I replaced this part of the code RU: у меня он залочен и да я знаю что у меня нет вкуса

reka7490 commented 1 year ago

image EN: here you can see everything is working if you run the server through the code, but if you first turn on the server yourself, wait for the load and only then start the console, then nothing will work RU: вот тут видно всё рабит если сервер запускать через код но если сначала самому включить сервер дождаться загрузки и лишь потом запустить консоль то ничего не сработает

reka7490 commented 1 year ago

шок контент чёрный кот стал коричневым 😱 ТАК ДЕРЖАТЬ

DarkCat09 commented 1 year ago

шок контент чёрный кот стал коричневым ТАК ДЕРЖАТЬ

Ага :)
На предыдущей аватарке, правда, кот был примерно такого же цвета.
А вообще, сообщения, не относящиеся к python-aternos, лучше в тг-канал, группу обсуждения или личный чат:

Скажите, когда прочитаете этот коммент, я удалю (ибо не по теме).

DarkCat09 commented 1 year ago

@reka7490,

Your last screenshots was moved to a new issue with title related to this bug. You can continue the discussion there: #68
This one will be closed.

Последние скрины перенёс в новый issue, с соответствующим заголовком. Обсуждение самого бага можно продолжить тут: #68
Этот issue закрою.