Commit Graph

54 Commits

Author SHA1 Message Date
Guangcong Luo
6e47295f1c Improve HTTPS support for side servers 2017-11-21 07:50:32 -05:00
Guangcong Luo
5b7c55aaa3 Support HTTPS in third-party servers
I seriously doubt any third-party server will do the work of obtaining
an SSL cert, but...

Well, I guess it wouldn't be too hard to write a script to automate
getting a Let's Encrypt cert... We'll see. This will help with testing,
regardless.
2017-10-14 00:46:30 -04:00
Ivo Julca
f74584f365 Fix cross-origin postMessage usage in Chrome Canary 2016-03-19 00:22:37 -05:00
Guangcong Luo
84ff3db560 Fix crash in Safari Private Browsing 2015-12-31 12:27:50 -05:00
sirDonovan
dd24ed5489 Avoid crashes from disabled cookies
Accessing localStorage when cookies are disabled throws a SecurityError in some browsers.
2015-12-30 03:57:30 -06:00
Guangcong Luo
367314c81a Fix HTTPS support in IE11
Apparently IE11 doesn't support location.origin. I assumed it had
wider support than it actually had.
2015-12-16 01:25:07 -05:00
Guangcong Luo
d9faf3e7e6 Update crossdomain.php to support main server
This is a job currently done by crossprotocol.html, but this is in
case we add an update for which a static file isn't enough.
2015-12-15 05:49:44 -05:00
Guangcong Luo
cf8bb24e71 Refactor data storage
Data (teams and prefs) are now always stored in localStorage in the
`https://play.pokemonshowdown.com` origin. Data storage at a low
level has been mostly rewritten for this, and moved to storage.js.

Tools.prefs has been renamed Storage.prefs, although the API
Tools.prefs(prefName) is still available, and recommended for
battle.js (because storage.js isn't available in replays). All
other pref functionality, such as setting prefs and saving prefs,
should only be used in Storage.prefs.

If the browser blocks third-party cookies in a detectable way,
data is instead stored in the local origin.

As a final safety measure, prefs/teams are mirrored in the local origin
in case third-party cookies are blocked in an undetectable way.

This refactor also replaces the 'init:loadprefs' and 'init:loadteams'
events with a new load tracking system that's basically a simplified
implementation of Promises, documented in the comments for
Tools.makeLoadTracker().
2015-11-28 04:36:41 -05:00
Guangcong Luo
3f8ffa684f Support new challstr protocol
See Zarel/Pokemon-Showdown@d5c622b493

New system is backwards-compatible with old one. This also slightly
refactors some other stuff, for an overall simpler system.
2015-06-28 00:50:17 -04:00
Guangcong Luo
a6e56e969a Update jQuery to 2.1.4 2015-06-28 00:50:16 -04:00
Guangcong Luo
f1ed3a2deb Merge pull request #327 from kotarou3/virtualhost
Only check if an address is already registered by hostname, not by IP
2015-02-11 13:17:47 -06:00
Morfent
d2bc6dd260 Update jQuery to version 2.1.3 2015-02-06 05:07:58 -04:00
小太
9a9d236093 Only check if an address is already registered by hostname, not by IP
When attempting to go on an unregistered server when there is already
another registered server sharing the same IP/Port pair (such as in
virtual hosting), you get redirected to the registered server, which
is undesirable
2015-02-02 23:53:26 +08:00
Guangcong Luo
9fe270859b Support banning servers 2014-10-05 17:09:39 -05:00
Guangcong Luo
a39c1078c4 Update links to jQuery and SockJS 2014-03-26 12:31:28 -05:00
Guangcong Luo
a2c160c220 Allow access outside of CloudFlare 2013-11-20 18:15:13 -06:00
Guangcong Luo
333275e3f7 Support bad routers that can't route to their own IP
So in theory, a user hosting PS on their own computer should be able
to visit their server with their IP. For some reason, certain routers
don't allow this, and force them to use localhost or 127.0.0.1.

This commit makes it so we do this for them, so they can still use
their server's official address [serverid].psim.us to connect to
their server.
2013-10-03 19:32:17 -05:00
Cathy J. Fitzpatrick
2119e15e69 Don't hardcode server port in crossdomain.php 2013-06-02 21:49:54 -05:00
Cathy J. Fitzpatrick
e0dbc1ecc5 Don't try to find the serverid of localhost servers 2013-05-22 20:00:08 -05:00
Cathy J. Fitzpatrick
ff8efd6638 Remove now-unnecessary code from crossdomain.php 2013-05-21 08:49:23 -05:00
Cathy J. Fitzpatrick
41ebe843d6 Fix critical bug in crossdomain.php 2013-05-21 02:35:11 -05:00
Cathy J. Fitzpatrick
c46c6f935f Fix crossdomain support for Internet Explorer 2013-05-20 14:33:20 -06:00
Cathy J. Fitzpatrick
71141438e3 Add dev.pokemonshowdown.com to authorised domains 2013-05-06 16:45:28 -07:00
Cathy J. Fitzpatrick
bed397b591 New URI scheme for beta client 2013-05-02 20:25:16 -07:00
Cathy J. Fitzpatrick
ca6f0a1e84 Long expiry of showdown_ssl cookie to avoid a potential issue 2013-05-01 19:18:38 -06:00
Cathy J. Fitzpatrick
31804eb51a Make HTTP the default for now 2013-05-01 16:52:01 -07:00
Cathy J. Fitzpatrick
1d9ed1a859 Deploy crossprotocol code 2013-05-01 15:07:27 -07:00
Cathy J. Fitzpatrick
2f4450f047 Crossprotocol fixes 2013-05-01 09:07:29 -07:00
Cathy J. Fitzpatrick
57a5af3f61 Initial stub of some crossprotocol stuff 2013-05-01 09:52:01 -06:00
Cathy J. Fitzpatrick
af992bd86a Add SSL support (not yet usable) 2013-05-01 07:41:47 -07:00
Cathy J. Fitzpatrick
e9cb6c984e crossdomain.php changes for dev.pokemonshowdown.com stuff 2013-04-26 20:07:19 -06:00
Cathy J. Fitzpatrick
c7a02a9031 Rename some fields of the Config object 2013-04-26 18:37:37 -06:00
Cathy J. Fitzpatrick
53b9d015c6 Remove legacy code for old protocols 2013-04-26 04:15:09 -06:00
Cathy J. Fitzpatrick
de5661d842 Config.customcss is no longer necessary 2013-04-25 06:16:57 -06:00
Cathy J. Fitzpatrick
8042343f4b Correct referrer when canonicalising URIs 2013-04-24 06:32:25 -06:00
Cathy J. Fitzpatrick
13027095d2 Preserve pathname when canonicalising URIs 2013-04-24 05:21:39 -07:00
Cathy J. Fitzpatrick
23245306ac Redirect *.psim.us URIs to the canonical URI 2013-04-24 04:50:13 -07:00
Cathy J. Fitzpatrick
bc7b79d9e7 Revise custom avatar feature 2013-04-24 02:43:15 -06:00
Cathy J. Fitzpatrick
c52a0e261b Upgrade to jQuery 2.0.0 2013-04-20 05:42:59 -06:00
Cathy J. Fitzpatrick
096aafc9fa logs.psim.us is not permitted to use crossdomain.php 2013-04-15 22:48:25 -06:00
Cathy J. Fitzpatrick
e911c955dd Eliminate almost all PHP from index.php 2013-04-15 06:57:18 -06:00
Cathy J. Fitzpatrick
bc451f5777 crossdomain.php is now crossdomain.html 2013-04-07 03:22:41 -06:00
Cathy J. Fitzpatrick
735edfb55a Fix for third-party servers 2013-04-07 02:30:02 -06:00
Cathy J. Fitzpatrick
b09e853b3d Refactor authentication code and drop support for old scheme
This drops support for the pre-challenge-response authentication scheme
(i.e. the scheme in use before Zarel/Pokemon-Showdown@7dbd8cfec5 on
February 8, 2013), and, by doing so, simplifies quite a bit of the
authentication code.

In particular, it is no longer necessary to make any database queries in
index.php, which reduces our database use significantly and also moves us
closer to the goal of the index page being static HTML.
2013-04-07 02:26:30 -06:00
Cathy J. Fitzpatrick
1cbfbad269 Sending the sid across domains is no longer necessary 2013-04-06 23:42:48 -06:00
Cathy J. Fitzpatrick
21fb40ccbf Show helpful message if user has third-party cookies disabled 2013-04-06 19:16:23 -07:00
Cathy J. Fitzpatrick
3334f95615 Don't throw an exception if third-party cookies are disabled 2013-04-06 18:21:40 -07:00
Cathy J. Fitzpatrick
3d5f2a1a8b Make crossdomain ajax requests in crossdomain.php 2013-04-06 04:36:08 -06:00
Cathy J. Fitzpatrick
11c931efa9 Fix an issue with last commit 2013-04-06 13:54:21 +04:00
Cathy J. Fitzpatrick
ae71d29140 Wider browser support in crossdomain code 2013-04-06 03:47:39 -06:00