Pokémon battle simulator.
Go to file
Cathy J. Fitzpatrick 9b3e433bc7 Actually fix bug causing crashes on live server
The following sequence of events was causing a crash:

1) User sends in decision to server (with the wrong rqid specified).
2) Server receives decision and sends message M to simulator process.
3) User leaves battle and sends the server a message to inform of this.
4) Server removes the user from his or her battle in the main process,
   which sets the user's entry in simulator.player to null.
5) The simulator process processes message M and, since the rqid in
   the decision is wrong, send a resendrequest message back to the
   main process.
6) The main process in resendRequest() tries to access properties of
   the player, which are now null as of event (4), causing a crash.

This commit fixes the problem by making sure that user is not null
before accessing its properties.
2013-01-26 12:49:21 -07:00
config Change default jursidiction of bypassblocks 2013-01-22 06:38:12 -07:00
data Round doesn't have to be successful to boost 2013-01-26 23:01:19 +04:00
logs Convert logging.md to use CRLFs so Notepad can open it. 2012-02-11 02:16:25 -05:00
mods Creating formats-data.js for gen4 tiers 2013-01-25 13:59:36 -08:00
.gitignore .gitignore everything in /config/ 2012-07-28 15:04:02 -07:00
app.js Display helpful message for missing module 2013-01-21 21:15:20 -07:00
battles.js Actually fix bug causing crashes on live server 2013-01-26 12:49:21 -07:00
chat-commands.js Refactor requiring the client to ack requests 2013-01-25 12:22:34 -07:00
doc.txt Move braces to the same line as their control statements 2012-04-16 12:54:03 +10:00
LICENSE We are now officially MIT Licensed 2013-01-17 05:00:28 -08:00
old-doc.txt Fixed the fix 2012-04-16 14:29:07 +10:00
package.json Move socket.io to optionalDependencies 2013-01-23 23:25:07 -07:00
Procfile Make Procfile specify Heroku's desired port 2012-05-16 19:31:02 -05:00
README.md Consistently call the project 'Pokemon Showdown' in readme 2013-01-21 19:00:20 -08:00
rooms.js Refactor requiring the client to ack requests 2013-01-25 12:22:34 -07:00
simulator.js Reinstate stopgap for now 2013-01-26 12:36:51 -07:00
tools.js Hidden Power fix: 2013-01-24 15:03:04 -08:00
users.js Fix avatars 2013-01-21 11:54:32 -08:00
verifier.js Fixes to verifier 2012-07-29 14:23:05 -07:00

Pokemon Showdown

Pokemon Showdown is a simulator of Pokemon battles. It currently supports singles battles in Generations 4-5 (HGSS, BW, BW2).

Installing

Pokemon Showdown requires Node.js and npm (which is installed by default with Node.js since v0.6.3).

Run npm install to install all necessary dependencies.

Copy config/config-example.js into config/config.js, and edit as you please.

After this, start Node:

cd <location of PS>
node app.js

You can also specify a port:

node app.js 8000

Visit your server at http://play.pokemonshowdown.com/~~SERVER:PORT/

Replace SERVER with your server domain or IP, and PORT with the server's port. You can leave off :PORT if it is 8000 (the default).

Yes, you can test even if you are behind a NAT without port forwarding: http://play.pokemonshowdown.com/~~localhost/ will connect to your local machine. Some browser setups might prevent this sort of connection, however (NoScript, for instance). If you can't get connecting locally to work in Firefox, try Chrome.

The reason your server is visited through play.pokemonshowdown.com is to make it more difficult for servers to see a user's password in any form, by handling logins globally. I realize that you might want your own login server and client hosted outside the pokemonshowdown.com domain, and I'll look more deeply into how to facilitate that when we're closer to leaving beta.

Browser support

Showdown currently supports, in order of preference:

  • Chrome
  • Firefox
  • Safari
  • Chrome/Firefox/Safari for various mobile devices
  • Opera
  • Firefox for Android
  • IE9+

IE8 support can technically be added without too much difficulty, but it doesn't run PS fast enough to be usable.

As for older browsers (Firefox 3.6), I won't go out of my way to support them, but if there's a simple fix, you can suggest it to me and I'll implement it.

License

Pokemon Showdown's server is distributed under the terms of the MIT License.

Credits

Pokemon Showdown was created by Guangcong Luo [Zarel].

Developers

  • Guangcong Luo [Zarel]
  • Bill Meltsner [bmelts]

Contributors

  • [The Immortal]
  • [Marty-D]
  • Cody Thompson [Rising_Dusk]