tank-royale icon indicating copy to clipboard operation
tank-royale copied to clipboard

Schema inconsistencies 2

Open SirStone opened this issue 1 year ago โ€ข 8 comments

Sorry, I've stolen the title from the last closed bug, but the issue is on the same page of that one. I've found about this when I've completed a script that converts your yaml schemas to my nim needs.

The schema results-for-bot.yaml has id bot-results-for-bot.yaml <-- id is different from the file name The schema game-ended-event-for-bot.yaml references for the results to results-for-bot.yaml

I think that the id of the results-for-bot.yaml should be changed in results-for-bot.yaml

SirStone avatar Jun 16 '24 13:06 SirStone

Another one surfing the repo, bullet-hit-bot-event.yaml has a wrong id Schermata del 2024-06-16 16-01-13

SirStone avatar Jun 16 '24 14:06 SirStone

Third one, bot-hit-bot-event.yaml has different id Schermata del 2024-06-16 16-07-57

SirStone avatar Jun 16 '24 14:06 SirStone

@SirStone Thank you for reporting this. ๐Ÿ™‚๐Ÿ‘

I have fixed the issue with this commit: https://github.com/robocode-dev/tank-royale/commit/6acef2909f86daa306d223bb664799cf112fe752

flemming-n-larsen avatar Jun 17 '24 22:06 flemming-n-larsen

Thanks, I will wait for the next release to check on this.

I want to add that I think that the hit-by-bullet-event.yaml is missing but is an object used by the API

Maybe logically is not among the messages exchanged between the server and the API but for the sake of script automation without this file others are forced to add it manually in the same code logic

Explanation for all: This event is not sent directly by the server to the bot, the bot-api receives a generic bullet-hit-bot-event.yaml and internally checks if the victimId is equal to the bot assigned id, if the numbers are equals instead of calling a onBulletHit(bulletHitBotEvent) will call onHitByBullet(hitByBulletEvent)

SirStone avatar Jun 22 '24 11:06 SirStone

@SirStone Just released 0.24.1 where the schemas are updated.

flemming-n-larsen avatar Jul 13 '24 17:07 flemming-n-larsen

Thanks for the update I've tested the new schemas and now I think are ok but for a missing event: hit-by-bullet-event that is generated by the API and not from the Server.

@flemming-n-larsen I was trying to "pull request" but I ended up making a direct push to the main branch...I didnยดt know I had this permission...

I've just uploaded a single new file, hope is not an issue. 7db15b4

SirStone avatar Jul 14 '24 09:07 SirStone

@SirStone: The changes look good to me. You are right that I just generate the event on the server side. And I guess I do that for a few of the events. But this does not mean that we should leave out the schemas. So I think it is perfectly okay to add it like you did. Thanks. ๐Ÿ‘๐Ÿ™‚

If I disable the write permission, you will not be able to update the Wiki. But I will remove it now - at least temporarily to avoid accidental writes to main. ๐Ÿ˜‰ Then I will just grant you write permission again late, if needed.

I recommend that you create a fork of Robocode, or create (feature) branches instead of working on main. This also makes it possible to compare changes against the main branch etc. ๐Ÿ™‚

flemming-n-larsen avatar Jul 14 '24 15:07 flemming-n-larsen

@SirStone: I put you in the role: Triage. Let's see how this goes. ๐Ÿ˜Š

flemming-n-larsen avatar Jul 14 '24 15:07 flemming-n-larsen

Closing this issue now.

flemming-n-larsen avatar Aug 22 '24 20:08 flemming-n-larsen