From 1414eaa994228b459289c94c2d079d892ff93d8a Mon Sep 17 00:00:00 2001 From: "Cathy J. Fitzpatrick" Date: Sat, 25 May 2013 00:41:27 -0600 Subject: [PATCH] Support the ladder room in testclient.html --- README.md | 3 +-- js/client.js | 5 ++++- ladder.php | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bd04183d05..c9ce9a9be3 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,12 @@ You can connect to an arbitrary server by navigating to `testclient.html?~~host:port`. For example, to connect to a server running locally on port 8000, you can navigate to `testclient.html?~~localhost:8000`. -Certain things will fail: +The following things will fail in `testclient.html`: + Registering + Changing name to a registered name other than the one you are currently logged in with (however, changing to an unregistered name will work, and you can even change back to your original registered name afterward) -+ The ladder room (however, the `/ladder` command does work) Everything else can be tested, though. diff --git a/js/client.js b/js/client.js index 767058d962..06d0d13be0 100644 --- a/js/client.js +++ b/js/client.js @@ -402,7 +402,10 @@ }; $.get = function(uri, callback, type) { if (type === 'html') { - return showUnsupported(); + uri += '&testclient'; + } + if (uri[0] === '/') { // relative URI + uri = Tools.resourcePrefix + uri.substr(1); } self.addPopup(ProxyPopup, {uri: uri, callback: callback}); }; diff --git a/ladder.php b/ladder.php index 6e0403ce76..d7a70c7267 100644 --- a/ladder.php +++ b/ladder.php @@ -4,7 +4,6 @@ $serverid = 'showdown'; $formatid = 'OU'; -$output = @$_REQUEST['output']; if (@$_REQUEST['format']) $formatid = $_REQUEST['format']; if (@$_REQUEST['server']) $serverid = $_REQUEST['server']; @@ -13,6 +12,10 @@ die('denied'); } +if (isset($_REQUEST['testclient'])) { + header('Content-Type: text/plain; charset=utf-8'); +} + $ladder = new NTBBLadder($serverid, $formatid); ?>