Closed alex-314214 closed 3 months ago
@alex-314214:
In order to see what is going on, we need to start the bot from a terminal window.
So you should cd
your way into the bots directory, e.g. the Corners bot, and write:
java -cp ../lib/* Corners.java
I expect that the Corners bot will run or write an error to standard out.
You can do the same thing for any Java bot, so if Corners works, but not your own, you should try out running your bot instead from the terminal the same way.
Please note that a server must be started in advantage.
Please note that you will run into this error:
Disconnected from: ws://localhost:7654, status code: 1008, reason: Invalid secret
This is because the server is protected with an server key that the bot needs to provide in order to connect to the server.
You can find the key in the generated server.properties
file located at the directory where the GUI is started from.
It will look similar to this:
bots-secrets=ZKfl1TOEvabzxqm6YRC0og
controller-secrets=QlgOL13TnWrdQoqnKcIEpA
Now, before calling the java -cp ../lib/* Corners.java
command, you should set the SERVER_SECRET
environment variable to the secret you find in the server.properties file under bots-secrets
.
if you use PowerShell:
$env:SERVER_SECRET="ZKfl1TOEvabzxqm6YRC0og"
if you instead use Command Prompt:
set SERVER_SECRET=ZKfl1TOEvabzxqm6YRC0og
(of course you need to use the server secret generated for your server instead of the one used above)
Now you should be able to connect to the server with java -cp ../lib/* Corners.java
.
What it written out to the console in your case, when you try to start the bot?
Thank you for your hints. But I found a solution on https://github.com/robo-code/robocode/releases that works.
Anybody else encountering this issue, and what are your findings written out by the bot(s)?
One observation on my side is, that this happens sometime when running on Linux. Hence, this needs more investigation.
Closing it for now.
What wents wrong?