Repository navigation
Add CLEARDATA to the RoboRumble client - #118
Conversation
Robots keep what they save in the robot data directory from one battle to the next. When enemy names are hidden, a file saved for robo-code#1 gets read in the next battle against a different robot. With CLEARDATA=YES the client deletes the robot data directory before each battle, so saved data lasts between rounds but not between battles. Data in a robot's jar is safe, because a robot gets it back when a battle starts. Uploads say cleardata=YES, so a server can refuse results from clients that keep data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Results can be incorrectly uploaded as cleardata=YES because uploads use the current configuration instead of each battle’s clearing status, and cleanup failures still allow battles to run with leftover data.
2 open issues
What changed in this PR
Adds an opt-in CLEARDATA setting to RoboRumble to prevent saved robot data from carrying across battles while preserving it between rounds.
Changes:
- Clears the robot data directory before each battle when enabled.
- Adds
cleardata=YESto uploads when configured. - Documents the setting in all four client configurations and adds cleanup unit tests.
| File | Description |
|---|---|
robocode.roborumble/src/test/java/net/sf/robocode/roborumble/battlesengine/BattlesRunnerTest.java |
Tests recursive cleanup and missing-directory handling. |
robocode.roborumble/src/main/java/net/sf/robocode/roborumble/netengine/ResultsUpload.java |
Adds the clearing flag to upload metadata. |
robocode.roborumble/src/main/java/net/sf/robocode/roborumble/battlesengine/BattlesRunner.java |
Implements optional data cleanup before battles. |
robocode.roborumble/build.gradle.kts |
Adds the JUnit test dependency. |
robocode.content/src/main/resources/roborumble/twinduel.txt |
Documents CLEARDATA, disabled by default. |
robocode.content/src/main/resources/roborumble/teamrumble.txt |
Documents CLEARDATA, disabled by default. |
robocode.content/src/main/resources/roborumble/roborumble.txt |
Documents CLEARDATA, disabled by default. |
robocode.content/src/main/resources/roborumble/meleerumble.txt |
Documents CLEARDATA, disabled by default. |
Review effort: Balanced
The upload read CLEARDATA from the configuration, but results can wait in the results file until a later upload. If the setting changed in between, those results were labelled with the new setting instead of the one they were played with. BattlesRunner now saves the setting in each battle's header, and the upload reads it from there. A header saved by an earlier client has no setting, which counts as NOT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, this is great work. Merged, with a small follow-up:
We've also proposed both as per-rumble settings in LiteRumble (robo-code/literumble#9), so its existing rumbles only take results with them off. This ships as 1.12.0, so AutoRumble's |
|
I don't yet currently have a public server set up for this, you can remove my name from the base documentation read me. I am not quite ready with the autorumble, it was being developed for AI robots and for open source only robots (hence openrumble and autorumble). I do plan to host it but I don't currently have that set up and it might not be until tomorrow. |
|
Update: I've now run the 1.12.0 client against AutoRumble itself (fa7b8d6), and it works once One small thing: the HTTP tests fail on Windows, because |
|
As for the batch stuff, I do have some code for that but it's mostly just written by Claude and I haven't had a chance to really review it yet. |
|
Done, your name is out of the README and ReadMe, and I've taken AutoRumble out of them too until it's ready. The 1.12.0 release notes credit you as Chase-san. Batch uploads can wait for a later version, so no rush on reviewing that code. Let me know when the server is up, and we'll add the link then. |
|
Ah, I meant like using it everywhere rather than using my real name. That's entirely fine. You can use my real name. I mean like having it in the main README. E.g. "Autorumble is made by Robert Maupin" and so on. That credit there felt like too much. Sorry for any confusion. |
|
As for autorumble I am testing 1.12.0 against my local copy now and working on figuring out modern vps services. |
|
Feel free to add an I think the steps would be:
|

Robots keep what they save in the robot data directory from one battle to the next. When enemy names are hidden, a file saved for
#1gets read in the next battle against a different robot.With CLEARDATA=YES the client deletes the robot data directory before each battle, so saved data lasts between rounds but not between battles. Data in a robot's jar is safe, because a robot gets it back when a battle starts. Uploads say cleardata=YES, so a server can refuse results from clients that keep data.