Closed iluvatyr closed 3 years ago
I was wondering how to add AI-Karts to the server so that there are always 2 AI Karts until 2 People joined so that there are gone.
Unfortunately there is no automated way of adding ai karts to the server. You can add them manually as described here.
Where and how can I use these commands?
I suppose this commands can be used when starting supertuxkart with the --network-console
command line option which is not used in this docker image.
Additionally. is it possible to have the stuff that goes into "Supertux/root/.config/supertuxkart/config-0.10/server_config.log" to also go to the output of docker logs ? Why is it going to that location?
This seems to be the default location for this log file. It would be possible to redirect these logs to stdout which would require modifying the docker-entrypoint.sh
. You could add this behaviour and submit a PR if you like.
And as last: it possible to download all the addons automatically?
This could also be done by modifying docker-entrypoint.sh
. Feel free to submit a PR.
Unfortunately there is no automated way of adding ai karts to the server. You can add them manually as described here.
I tried changing the docker-entrypoint.sh file by mounting it and then changing it to
#!/bin/bash
set -e
# Log in with username and password if given
if [ -n ${USERNAME} -a -n ${PASSWORD} ]
then
supertuxkart --init-user --login=${USERNAME} --password=${PASSWORD}
fi
# Start the server
supertuxkart --server-config=server_config.xml
supertuxkart --connect-now=127.0.0.1:2759 --network-ai=2
but that didnt work to add AI-Karts. I wonder why. When I ran the command manually after the server started already, I was able to add AI via
docker exec <supertuxcontainer> supertuxkart --connect-now=127.0.0.1:2759 --network-ai=2 &
I suppose this commands can be used when starting supertuxkart with the --network-console command line option which is not used in this docker image.
I found that it works by also using:
`docker exec -it
I will have to read about how exactly the entrypoint works and also where and how supertuxkart implements the download of addons automatically so it would be possible to add this to the entrypoint. Maybe Ill add the request some time.
When I ran the command manually after the server started already, I was able to add AI
I‘m glad you found a solution. 👍
Modifying the entry point that way did not work because the command supertuxkart --server-config=server_config.xml
never terminates as long as the server is running. So the following command is never executed. You could try starting the server in the background by adding a &
at the end of the line. I will also try if this works as expected.
I found that it works by also using:
docker exec -it supertuxkart --connect-now=127.0.0.1:2759 --network-console
Good to know, I will add that to the README.
Hi @Luca-Hummel,
ai karts can now be configured with the environment variable AI_KARTS
. See the updated README for details.
Sorry, this is a kind of nooby question. I was wondering how to add AI-Karts to the server so that there are always 2 AI Karts until 2 People joined so that there are gone. In the server_config.xml there is a following entry, which I set to true. But where do I set the number for the Bots?
Also, in the logs it shows following:
Where and how can I use these commands?
Additionally. is it possible to have the stuff that goes into "
Supertux/root/.config/supertuxkart/config-0.10/server_config.log
" to also go to the output of docker logs ? Why is it going to that location?And as last: it possible to download all the addons automatically? I just used the addon folder from my Windows Supertux game and copied it into the location I mounted the server in.
THANKS A LOT!