diff --git a/README.md b/README.md index 0f4dce16c..814f022be 100644 --- a/README.md +++ b/README.md @@ -62,12 +62,13 @@ contents: const POKEMON_SHOWDOWN_TESTCLIENT_KEY = 'sid'; Replace `sid` with the contents of your actual PS `sid` cookie. You can quickly -access this on Chrome through the URL bar: +grab it from: -![image](https://user-images.githubusercontent.com/551184/53414680-def43480-3994-11e9-89d0-c06098c23fa0.png) -![image](https://user-images.githubusercontent.com/551184/53414760-119e2d00-3995-11e9-80f8-ecd17467310a.png) +> https://play.pokemonshowdown.com/testclient-key.php -(This is the only supported method of logging in on the beta Preact client.) +Make sure to put it in `config/` and not `play.pokemonshowdown.com/config/`. + +(This is the only supported method of logging in on the beta Preact testclient.) [5]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS diff --git a/play.pokemonshowdown.com/src/client-connection.ts b/play.pokemonshowdown.com/src/client-connection.ts index 9894529be..a4e14a588 100644 --- a/play.pokemonshowdown.com/src/client-connection.ts +++ b/play.pokemonshowdown.com/src/client-connection.ts @@ -62,6 +62,11 @@ PS.connection = new PSConnection(); export const PSLoginServer = new class { rawQuery(act: string, data: PostData): Promise { + // commenting out because for some reason this is working in Chrome???? + // if (location.protocol === 'file:') { + // alert("Sorry, login server queries don't work in the testclient. To log in, see README.md to set up testclient-key.js"); + // return Promise.resolve(null); + // } data.act = act; let url = '/~~' + PS.server.id + '/action.php'; if (location.pathname.endsWith('.html')) { diff --git a/play.pokemonshowdown.com/testclient-key.php b/play.pokemonshowdown.com/testclient-key.php new file mode 100644 index 000000000..dd373b828 --- /dev/null +++ b/play.pokemonshowdown.com/testclient-key.php @@ -0,0 +1,107 @@ + + + + + + + +

IF SOMEONE ASKS FOR THIS KEY, THEY ARE TRYING TO STEAL YOUR ACCOUNT. THEY ARE PHISHING.

+

Admins do not need this key to update your account. Do not give it to anyone who asks. You should ONLY use this to set up the testclient.

+ +
+ + + + + + + + + + +