A battle's inputLog is now stored separately from the output log. It's
not an exact log of inputs, but rather just a collection of the inputs
that resulted in the battle: a default choice expands to the choice
that was actually used, and the starting seed is logged whether or not
it was explicitly passed into the battle stream.
Fixes#4348Fixes#3201
This contains a lot of minor refactors, but the main thing that's going
on here is that battle stream writes have been streamlined to be a lot
easier for others to use.
We even support:
./pokemon-showdown simulate-battle
which provides a stdio interface for anyone using any programming
language to simulate a battle.
./pokemon-showdown help
will now display all the possible ways to use PS on the command-line,
of which there are several new ones:
./pokemon-showdown validate-team
./pokemon-showdown unpack-team
./pokemon-showdown pack-team
The previous complement of way too many message types:
- update, winupdate, sideupdate, request, score, log
are now only:
- update, sideupdate, end
`score` was removed in the previous commit, and this commit adds a new
message type `end`. `end` replaces the previous `log`, and also
contains the data for `winupdate` and `score`.
`request` was also folded into `sideupdate`.
`Sim.construct` no longer exists. Battles are now constructed directly
with `new Battle()`. Parameters other than formatid are now passed as
`options`.
This is specifically made to fix Nasty Plot + Surf Raichu.
Specifically, prevo moves are no longer compatible with evo event
moves.
Other incompatibilities (specifically, modern prevo moves with old-gen
evo moves) will be harder to fix, unfortunately.
To avoid deleting the wrong room by accident, deleteroom requires typing out the full room name.
This PR removes that requirement for personal rooms. It also addresses the following issues with the permission check:
(1) The auth check looks at ``room.isPersonal`` instead of ``targetRoom.isPersonal``.
This should allow any room owner to delete their room if they do it from a groupchat, even if they do not have the makeroom permission.
(2) The room is searched for before permissions are checked. That creates an information leak. Any user can do the following:
- Use on an existing room: /deleteroom - Access denied.
- Use on a non-existing room: The room 'yxxyxyxyxxyy' doesn't exist.