Closed electricSoda closed 1 month ago
@electricSoda Thank you for reporting this as a bug and providing really good information for how to reproduce the issue you see. 😊👌
I will have a look into this issue.
I reproduced the problem :+1: So I will figure out how to fix that
@electricSoda When you start a local server, it will start up at localhost:
That said, I believe the local IP address and localhost
must be resolved equally, meaning that the GUI should be able to connect to the server. So it is still a bug, and a dialog should show up for sure.
Sounds good 👍
@electricSoda I just released 0.24.1 with fixes for this issue. I should like you to try out, if it works for you as well. ❓
Also notice, that I updated the check when entering/adding a new URL, so you don't need to do this manually via a text editor. 😉
Still doesn't work :(. If I select a LAN server like ws://192.168.1.28.:3000
(which is my machine's local LAN address), boot up some bots from the GUI, and some from the terminal, and then click start battle, the battle doesn't show up on the GUI...
@electricSoda I am sorry. I think I misunderstood you, and feel a bit embarrassed, as I did not fix at least the main issue with the GUI. My bad! And I think the GUI needs more work, so it is less confusing, and will be smarter to work with.
If I get you right, the main issue is that the GUI automatically starts up a server locally on the default (Robocode) port 7654. That is at ws://localhost:7654, where local IP addresses like e.g. 192.168.1.28 will work too, but only if you use the same port, i.e. ws://192.168.1.28:7654. The Select Server dialog only lets you select any server including your own (local server). And you can hit the Test button to check if the server is up and running. Note that this is useful, if you are trying to reach an external server outside your system, or if you have multiple servers running, e.g. started an independent server in the background on another port than 7654, e.g. 3000.
Then, when you add the server URL ws://192.168.1.28:3000 and try to start a battle nothing happens! Which is what this issue is about. This is caused by no server running on port 3000 unless you start one in the background, which is possible. Nevertheless, the GUI should alert you that no server is running on port 3000.
To fix this issue, I have some proposals I will start working on. If you have other suggestions, make sure to add those to this thread.
1) The GUI should alert the user when a selected server is not running, which is the main issue. The alert should provide the URL of the server, which is not running.
2) There should be a configuration for the server, where it is possible to set the default port so the default port can be changed from 7654 to e.g. 3000.
3) Perhaps I need to add something to the Select Server dialog to let people know that the dialog is not used for setting the possible local IP addresses and port(s) of the server, but only for choosing which server to use when starting battles.
4) I could improve the Select Server dialog so the list of servers indicates which servers are online and offline, e.g. by an icon beside the URL.
5) The Start Server (in the Server menu) should ask the user if the default port should be used, or if another port must be used. This could use the configuration from 2)
Hi I would like to give my 2 cents here, but first I want state that this is a not-issue to me; in case someone wants to boot a server in a remote machine, the server configuration can stay as "localhost" and still be able to connect with remote bots up until the firewall and network rules are set correctly.
Said so...I think I can reproduce the same issue with a single machine and without using the official GUI. I'm not 100% sure if this is exactly the same problem, as far as I understand the reported bug states that starting the server using the lan ip, for example 192.168.xxx.yyy, instead of the "localhost" or "127.0.0.1" the match doesn't start.
I'm going to use my alternative GUI project, so maybe I can easily see more some details than @electricSoda.
Green arrow are the messages sent from Controller to Server, red arrows the messages received from the Server.
Now repeating the point 1 to 5 but reverting the server ip as 127.0.0.1
What I observe is that when using the lan address instead of localhost or 127.0.0.1 the server is able to make Controllers and bots join correctly but as soon as the game starts the server is unable to communicate correctly with them, in particular I see that the bots are not receiving the "game-started-event-for-bot" and so the bots can't respond with a "bot-ready".
It's the same issue I've reported in https://github.com/robocode-dev/tank-royale/issues/97 but in that case the problem was related to my machine, if I use "localhost", it is translated in ip V6 "::1" instead of "127.0.0.1", and the bots could join but could not receive the "game-started-event-for-bot", as in this open issue.
Are you maybe switching the messaging system from direct to broadcast? Could be here that there's a translation issue of addresses?
@electricSoda I have just release version 0.24.4 which now shows an error message if a remote server is being used for starting the battles. Currently, only local server battles are supported.
@electricSoda I have made a version 0.26.0, which supports remote servers as well as local servers. Has the issue you saw been fixed by now?
I am closing the issue now. Please re-open it, if the original issue is still present or create a new issue.
The bug When you start a Robocode Tank Royale server from the GUI on any LAN Websocket address, boot up bots to connect to the server through the command line (e.g.
java -cp ../lib/* AvoidWall.java
), and then try and start up a match between these bots through the GUI, the match doesn't start.To Reproduce
Go to the
server.properties
file and add your computer's LAN address converted to a websocket address (e.g.ws://192.168.1.20:3000
) to theserver-urls
propertySelect the the IP address from Server > Select Server from the GUI
Start up a server on this new websocket address through the GUI (Server > Start Server)
On a separate computer (or on the same computer), change the SERVER_URL environment variable (by doing
set SERVER_URL=<url>
) to the same websocket address you did in theserver.properties
fileAlso make sure to configure the secret for the bots by doing
set SERVER_SECRET=<secret>
; you can find the bots-secrets in theserver.properties
fileThen go in command prompt or terminal and then boot up a bot e.g.
java -cp ../lib/* Corners.java
It should show that it's connected on the battle menu thingy on the GUI (in the Joined Bots (local/remote))
Add that remote bot for battle
Boot up another bot from a local directory through the GUI (not from command line)
Click start battle
You will see that the pop up for selecting bots disappears like it's going to start a match, but then nothing shows up on the main screen (the battle interface doesn't show up)
Desktop (please complete the following information):
Java info: