smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.77k stars 2.79k forks source link

Clauses undocumented #4778

Closed davidstone closed 6 years ago

davidstone commented 6 years ago

Reading https://github.com/Zarel/Pokemon-Showdown/blob/master/PROTOCOL.md#battle-initialization

There does not appear to be any documentation showing what elements I can expect to receive for clauses. At the very least, it would be nice to have a link to somewhere in the code where that list is maintained?

Zarel commented 6 years ago

Clauses are not intended to be a maintained list. They should be treated as opaque strings.

The code is mostly in https://github.com/Zarel/Pokemon-Showdown/blob/master/data/rulesets.js

On lines like

https://github.com/Zarel/Pokemon-Showdown/blob/68825cfbfd3f935125b21a6ecedfbf50c25bd5f2/data/rulesets.js#L420

But really, anything can send a clause message. The list is not maintained anywhere, in documentation or in code. Furthermore, even the code is not bounded in any meaningful sense: third-party and first-party servers can and do introduce custom formats with custom clauses named however they want. And this can be done with configuration changes without ever touching the repository.

You can grab examples from existing replays, but we in no way guarantee a bounded list of possible clause names. You should expect any string to be a valid clause name.