Support the ladder room in testclient.html

This commit is contained in:
Cathy J. Fitzpatrick 2013-05-25 00:41:27 -06:00
parent 8b95302e97
commit 1414eaa994
3 changed files with 9 additions and 4 deletions

View File

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

View File

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

View File

@ -4,7 +4,6 @@ include 'lib/ntbb-ladder.lib.php';
$serverid = 'showdown';
$formatid = 'OU';
$output = @$_REQUEST['output'];
if (@$_REQUEST['format']) $formatid = $_REQUEST['format'];
if (@$_REQUEST['server']) $serverid = $_REQUEST['server'];
@ -13,6 +12,10 @@ if (!ctype_alnum($formatid)) {
die('denied');
}
if (isset($_REQUEST['testclient'])) {
header('Content-Type: text/plain; charset=utf-8');
}
$ladder = new NTBBLadder($serverid, $formatid);
?>
<table>