This is the code for the replay server I built at staraptorshowdown.com/replays
You will need to make some edits detailed below, but it should be pretty close to working out of the box
Ping me on discord (staraptorop) if you have any questions!
Everything assumes this folder is at the same level at the server and client
├── pokemon-showdown
│ ├── logs
├── pokemon-showdown-client
│ ├── play.pokemonshowdown.com
│ | └── replays
├── replay-server
│ ├── replay_runner.sh
│ └── README.md
- I would highly recommend setting
exports.logchallenges = trueinpokemon-showdown/config/config.js - Next, play a game and then ensure there is at least 1 log file in
pokemon-showdown/logs - Optional but highly recommended:
- Check Lines 840 - 864 of server/room-battle.js
- This ensures any privated game will not generate a replay
- It also pastes the link in the chat immediately at the end of the game
Ensure your nginx config has this inside it
location / {
root /var/www/pokemon-showdown-client/play.pokemonshowdown.com/;
index index.html;
autoindex on;
}NOTE: This assumes your main server is hosted at index.html.
If your server is hosted at testclient.html (noted by index testclient.html) in the above config, you can rename index.html in this folder to testclient.html
Then add this these lines to your vite.config.ts:11
input: {
client: 'testclient.html',
},- Change
replay_embed_locationingenerate_replays.py:7- Using
"https://play.pokemonshowdown.com/js/replay-embed.js"will work but will not use your new sprites or stats - I'd recommend using your own server's
js/replay-embed.js- Ensure your link is in the
linkStyleandrequireScriptinstead ofplay.pokemonshowdown.com
- Ensure your link is in the
- If you do not have custom sprites, you only need to overwrite certain lines like staraptorshowdown.com/js/replay-embed.js
- Using
- Change
server_locationingenerate_csv.py:6 - Change the Title in
App.tsx:49
- Typescript webpage built with React/Mui based on csv created from above
npm ci
npm run build- If all above is set correctly, you should be able to go to
https://{your_server_name}/replaysand a blank page should show up saying Loading replays...
- Scripts that generate replays from log files
pip install pokemon-showdown-replays
python generate_replays.py
python generate_csv.py- If this is done correctly replays should show up on the above link
- Note that this only generates replays for files that don't exist, so if you mess up your setup, delete the old replays for it to regenerate
- Watches
pokemon-showdown/logsfolder and runs the above 2 python files - Run with
bash replay_runner.sh - I recommend leaving this running in a tmux window or some other way to keep in running even after you close out
Export to clipboard
Replay Scouter