Skip to content

Commit

Permalink
Support the ladder room in testclient.html
Browse files Browse the repository at this point in the history
  • Loading branch information
cathyjf committed May 25, 2013
1 parent 8b95302 commit 1414eaa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 4 additions & 1 deletion js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
};
Expand Down
5 changes: 4 additions & 1 deletion ladder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

$serverid = 'showdown';
$formatid = 'OU';
$output = @$_REQUEST['output'];

if (@$_REQUEST['format']) $formatid = $_REQUEST['format'];
if (@$_REQUEST['server']) $serverid = $_REQUEST['server'];
Expand All @@ -13,6 +12,10 @@
die('denied');
}

if (isset($_REQUEST['testclient'])) {
header('Content-Type: text/plain; charset=utf-8');
}

$ladder = new NTBBLadder($serverid, $formatid);
?>
<table>
Expand Down

0 comments on commit 1414eaa

Please sign in to comment.