Maco02 Posted December 31, 2015 Share Posted December 31, 2015 Is there any way to run commands from the server side? I don't want to use the in-game terminal. Link to comment https://forums.kleientertainment.com/forums/topic/61653-how-can-i-run-commands-from-the-server-shell/ Share on other sites More sharing options...
thasmo Posted December 31, 2015 Share Posted December 31, 2015 Was asking that myself too already. Would be cool to connect to the server from command-line and execute commands. Link to comment https://forums.kleientertainment.com/forums/topic/61653-how-can-i-run-commands-from-the-server-shell/#findComment-703877 Share on other sites More sharing options...
thasmo Posted January 1, 2016 Share Posted January 1, 2016 So far I wasn't able to find it out. All I've found is this:"Added “-console” command line argument for dedicated servers, allows users to input lua commands directly from the application window."http://forums.kleientertainment.com/topic/50615-update-126042-262015/Not sure what it means tho.And this:"EDIT: The next build will have an optional console, for directly inputting commands in the Dedicated Server window."http://forums.kleientertainment.com/topic/50262-admin-commands-not-working-on-dedicated-lan-only-server/?p=609568If we just could find out what this window is. Is there anybody who could provide a simple instruction how to run LUA commands directly from the host's shell/CLI *without* connecting to the server with the game-client? Link to comment https://forums.kleientertainment.com/forums/topic/61653-how-can-i-run-commands-from-the-server-shell/#findComment-704159 Share on other sites More sharing options...
thasmo Posted January 1, 2016 Share Posted January 1, 2016 So, I guess I figured it out. Actually it's not that difficult, although I don't know how to use it with `screen`, because I'm using it with Docker.First, you need to start the server on the CLI with the argument `-console` to enable this. Second, if you do so (without `screen`) you can simply input LUA code on the CLI, one command per line. Using docker-compose with a docker-compose.yml file, it's important so set both, `tty` and `stdin_open`, to true. This enables to send commands to the running docker process, when reattaching to the container with `docker attach <container>`.Unfortunately I don't know how to use this with `screen` but I guess it's also possible to attach back to the running process and enter commands. Link to comment https://forums.kleientertainment.com/forums/topic/61653-how-can-i-run-commands-from-the-server-shell/#findComment-704194 Share on other sites More sharing options...
Maco02 Posted January 2, 2016 Author Share Posted January 2, 2016 Great! Now I need to figured out how to redirect the standard input of a screen but I'm sure that there must be a way. Link to comment https://forums.kleientertainment.com/forums/topic/61653-how-can-i-run-commands-from-the-server-shell/#findComment-704456 Share on other sites More sharing options...
raikage Posted January 2, 2016 Share Posted January 2, 2016 You can send commands directly to the screen session. So, if you followed step 13 & 14 in the guide (titled, "[GUIDE] How to setup server dedicated cave on Linux"), dst_server1 is the name of the session used for the overworld, while dst_server2 is the screen session used for the cave. To give player 1 forty logs in the outerworld, on the server, for example, you'd enter at your server: screen -S dst_server1 -p 0 -X stuff "c_select(AllPlayers[1]) c_give(\"log\",40)$(printf "\r\n")" This may not be the best way, but it works in Ubuntu Linux. Link to comment https://forums.kleientertainment.com/forums/topic/61653-how-can-i-run-commands-from-the-server-shell/#findComment-704584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.