From 89a736ecf87dfce2e06f33d58cc7e3c6a85a5541 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Thu, 3 Dec 2015 02:39:37 -0500 Subject: [PATCH] Ignore |N| and |n| in battles This brings battles more inline with chatrooms, in preparation for more code-sharing server-side --- .htaccess | 6 +++--- js/battle.js | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.htaccess b/.htaccess index 655897d37..ea05fa662 100644 --- a/.htaccess +++ b/.htaccess @@ -47,11 +47,11 @@ Header set Access-Control-Allow-Origin * env=SAFE_RESOURCE # Redirect old battles to their corresponding replay # RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] -# RewriteRule ^battle-([a-z0-9]+-1[0-9]{8})$ http%{ENV:P_SUFFIX}://replay.pokemonshowdown.com/$1 [R=302,L] +# RewriteRule ^battle-([a-z0-9]+-[12][0-9]{8})$ http%{ENV:P_SUFFIX}://replay.pokemonshowdown.com/$1 [R=302,L] RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] -RewriteRule ^battle-([a-z0-9]+-?[1-9][0-9]{7})$ http%{ENV:P_SUFFIX}://replay.pokemonshowdown.com/$1 [R=302,L] +RewriteRule ^battle-([a-z0-9]+-[0-9]{8})$ http%{ENV:P_SUFFIX}://replay.pokemonshowdown.com/$1 [R=302,L] RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] -RewriteRule ^battle-([a-z]+[0-9]{1,7})$ http%{ENV:P_SUFFIX}://replay.pokemonshowdown.com/$1 [R=302,L] +RewriteRule ^battle-([a-z0-9]+)$ http%{ENV:P_SUFFIX}://replay.pokemonshowdown.com/$1 [R=302,L] # TODO: fix bug where you can't join lobby directly RewriteRule ^lobby/?$ / [R=301,L] diff --git a/js/battle.js b/js/battle.js index b8cd0055e..357abff63 100644 --- a/js/battle.js +++ b/js/battle.js @@ -5738,6 +5738,8 @@ var Battle = (function () { break; case 'J': case 'L': + case 'N': + case 'n': case 'spectator': case 'spectatorleave': break;