Skip to content

Commit

Permalink
use key from url ?SID=...
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeinum committed Feb 4, 2022
1 parent 9b58e8f commit 23e6854
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ package-lock.json
/website/files/
/website/images/
/website/ads.txt

.vercel
6 changes: 6 additions & 0 deletions js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,12 @@ Storage.initTestClient = function () {
sid = POKEMON_SHOWDOWN_TESTCLIENT_KEY.replace(/\%2C/g, ',');
}

if (!!Config.key) {
console.log('Using test client key', Config.key);
sid = (Config.key).replace(/\%2C/g, ',');
console.log('Using test client id', sid);
}

Storage.whenAppLoaded(function (app) {
var get = $.get;
$.get = function (uri, data, callback, type) {
Expand Down
4 changes: 3 additions & 1 deletion testclient.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
Config.server = {
id: m[1],
host: m[2],
port: (m[3] && parseInt(m[3].substr(1))) || 8000
port: (m[3] && parseInt(m[3].substr(1))) || 8000,
};
} else if (m = /\?SID=(.+)/.exec(location.search)) {
Config.key = m[1];
} else {
alert('Unrecognised query string syntax: ' + location.search);
}
Expand Down

0 comments on commit 23e6854

Please sign in to comment.