mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-08-20 01:51:42 -05:00
Update Replays for new loginserver endpoints
This should drastically help with server performance, considering these are the URLs that keep getting hammered by scrapers.
This commit is contained in:
@@ -6,9 +6,14 @@ RewriteRule ^recent\.json$ /api/replays/search.json [L,QSA]
|
||||
RewriteRule ^download$ download.html [L,QSA]
|
||||
RewriteRule ^([A-Za-z0-9-]+)$ index.php?name=$1 [L,QSA]
|
||||
RewriteRule ^([A-Za-z0-9-]+)/manage$ replay-manage.php?name=$1&manage [L,QSA]
|
||||
RewriteRule ^([A-Za-z0-9-]+)\.log$ replay.log.php?name=$1 [L,QSA]
|
||||
RewriteRule ^([A-Za-z0-9-]+)\.inputlog$ replay.log.php?inputlog&name=$1 [L,QSA]
|
||||
RewriteRule ^([A-Za-z0-9-]+)\.json$ replay.log.php?json&name=$1 [L,QSA]
|
||||
|
||||
# RewriteRule ^([A-Za-z0-9-]+)\.log$ replay.log.php?name=$1 [L,QSA]
|
||||
# RewriteRule ^([A-Za-z0-9-]+)\.inputlog$ replay.log.php?inputlog&name=$1 [L,QSA]
|
||||
# RewriteRule ^([A-Za-z0-9-]+)\.json$ replay.log.php?json&name=$1 [L,QSA]
|
||||
|
||||
RewriteRule ^([A-Za-z0-9-]+)\.log$ /api/replays/get.log?id=$1 [L,QSA]
|
||||
RewriteRule ^([A-Za-z0-9-]+)\.inputlog$ /api/replays/get.inputlog?id=$1 [L,QSA]
|
||||
RewriteRule ^([A-Za-z0-9-]+)\.json$ /api/replays/get.json?id=$1 [L,QSA]
|
||||
|
||||
DirectoryIndex index.php index.html /dirindex/dirindex.php
|
||||
ErrorDocument 404 /dirindex/404.html
|
||||
|
||||
@@ -103,7 +103,7 @@ export class BattlePanel extends preact.Component<{ id: string }> {
|
||||
return;
|
||||
}
|
||||
|
||||
Net(`/${this.stripQuery(id)}.json`).get().then(result => {
|
||||
Net(`/${this.stripQuery(id)}.json?countview`).get().then(result => {
|
||||
this.loadResult(result, id);
|
||||
}).catch(err => {
|
||||
this.loadResult(err.statusCode === 404 ? '' : String(err?.body || ''), id);
|
||||
|
||||
Reference in New Issue
Block a user