Ignoring bot using invalid secret: Corners, version: 1.0 #95
-
Hi, I've been trying to figure out how to get the Websocket functionality to work locally (between 2 computers). I'm using Java and I'm using the Java sample bots. My issue is when I start up a server on the GUI, then go to the terminal, and go to a sample bot's directory (e.g. Corners), and then run the command, I see in the Any help is appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@electricSoda You are right. Bots can only join the server by providing a bot secret that matches the one created by the server. This is a security constraint so bots cannot join a server without "permission", which is provided through the bot secret. The easiest way to provide the bot secret is to set the environment variable |
Beta Was this translation helpful? Give feedback.
-
I realised that the javadocs has been hiding protected members. Hence, I fixed that so the available constructors for the Bot can be seen: This constructor takes a server secret. This way it is possible to provide the Bot with a server secret programmatically: |
Beta Was this translation helpful? Give feedback.
@electricSoda
I realise that this information is missing in the documentation. Sorry for that. I will make sure that this information is included in the documentation soon so everybody knows what to do.
You are right. Bots can only join the server by providing a bot secret that matches the one created by the server. This is a security constraint so bots cannot join a server without "permission", which is provided through the bot secret.
The easiest way to provide the bot secret is to set the environment variable
BOT_SECRETS
to the bot-secret value from the server. It must be defined in the terminal/shell running the bot. The booter sets this in the terminal (behind the scene) when booting…