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:
Guangcong Luo
2026-07-18 02:34:58 +00:00
parent d663b732e7
commit 082b834351
2 changed files with 9 additions and 4 deletions

View File

@@ -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

View File

@@ -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);