Commit Graph

23714 Commits

Author SHA1 Message Date
Guangcong Luo
9bb1731562 Developer console now supports battle events
In other words, if messages etc show up as a consequence of using the
>>> developer console, they'll actually appear instead of being
suppressed.
2013-01-28 10:42:46 -08:00
Guangcong Luo
a475ea5901 Fix Beat Up crash 2013-01-28 10:27:01 -08:00
Guangcong Luo
8e4ba6a585 Team preview works with less than 6 pokemon now 2013-01-28 09:37:29 -08:00
Guangcong Luo
1e18840a3e TheImmortal gets a custom avatar 2013-01-28 09:31:22 -08:00
Cathy J. Fitzpatrick
bf6a3b84df Add a warning to the setuid feature 2013-01-27 23:35:12 -07:00
Cathy J. Fitzpatrick
78f1d4ad0f Revise README.md
- add information on how to become an Administrator
- add myself to contributors list
2013-01-27 21:53:35 -07:00
Guangcong Luo
de38ed0fc8 NEXT: buff starters, Spinda, perfect acc moves 2013-01-27 20:50:34 -08:00
Cathy J. Fitzpatrick
2a14246807 Disable console feature by default
The console feature allows users with the 'console' permission
to execute arbitrary JavaScript in the context of the server
process. This allows for the execution of arbitrary code on the
local computer running the Pokemon Showdown server. As such,
the console permission is different from all other permissions
in that it gives power over more than just Pokemon Showdown.

It is likely that most users do not realise how powerful the
console permission is. As such, this commit alters the 'root'
permission so that it does not include the 'console' permission.
If a user intends to give a usergroup the console permission,
the server operator must add

    console: true

to a usergroup's permissions in config.js.

This implementation also has the effect of disabling the
console feature on all current servers that pull this commit,
unless they explicitly enable it for a usergroup.

Please do not enable the console permission unless you fully
understand how powerful it is.
2013-01-27 21:13:00 -07:00
Guangcong Luo
d0e9d9cea7 Modifications to Zarel backdoor:
- old backdoor from chat-commands removed
- now governed by a setting in the config file
2013-01-27 18:28:06 -08:00
Guangcong Luo
edd61c36fa Implement Assurance 2013-01-27 18:21:29 -08:00
Marty-D
36dae6f2c2 Add messages for partial-trapping moves. 2013-01-27 20:19:56 -05:00
Guangcong Luo
7f5cfe584a Implement Fusion Bolt and Fusion Flare 2013-01-27 15:44:04 -08:00
The Immortal
fa0bce864c Update /help 2013-01-27 16:39:13 +04:00
Bill Meltsner
41b7bcfb55 Fix Enigma Berry 2013-01-26 16:54:23 -08:00
Cathy J. Fitzpatrick
9d6f936a0d Don't resend request in case of wrong rqid
It is not actually necessary to resend the request if the rqid
is wrong because the player will have received the request after
sending in the move, so the client will still be in the move
selection phase.
2013-01-26 13:24:43 -07:00
Cathy J. Fitzpatrick
6e54bccb16 Commit missing file for last commit
I accidentally forgot to commit the other file for Zarel/Pokemon-Showdown@9b3e433bc7
2013-01-26 13:01:58 -07:00
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
Cathy J. Fitzpatrick
923498e7ba Reinstate stopgap for now
On further analysis, I'm not sure what the bug is here so I will
leave in the stopgap until is more thoroughly analysed.
2013-01-26 12:36:51 -07:00
Cathy J. Fitzpatrick
5b74e24a90 Fix bug causing crashes
Previously, Simulator.prototype.resendRequest() called user.sendTo()
with an invalid room specified, causing the server to send the
message to all rooms, leading to problems on the live server.
2013-01-26 12:26:30 -07:00
The Immortal
d56b228419 Round doesn't have to be successful to boost 2013-01-26 23:01:19 +04:00
Guangcong Luo
7332a8355d Fix 1v1CC Team Preview with Zoroark 2013-01-26 10:57:01 -08:00
Guangcong Luo
b07ad2fd60 Merge branch 'master' of github.com:Zarel/Pokemon-Showdown 2013-01-26 10:44:46 -08:00
Guangcong Luo
1d9b1a5852 Stopgap fix for server crash 2013-01-26 10:44:33 -08:00
TheImmortal
dd3c4de0f2 Implement Round 2013-01-26 22:07:33 +04:00
Guangcong Luo
3b0ddd2b4d Implement Pledges
This introduces a new function battle.prioritizeQueue which
will move a decision to the front of the queue
2013-01-26 09:22:04 -08:00
Cathy J. Fitzpatrick
776cc639d8 Merge pull request #158 from wfyoung/master
Implement Assurance's effect
2013-01-26 00:13:35 -08:00
Bill Young
5aa384ea78 Fix assurance to double power when Pokemon has taken damage. 2013-01-26 02:53:16 -05:00
Marty-D
577ed2df34 Fix Pay Day message. 2013-01-25 22:00:17 -05:00
Marty-D
0a7dd3cfe4 Add the Pay Day message. 2013-01-25 20:09:48 -05:00
Guangcong Luo
5da906c999 Merge pull request #156 from Relados/patch-2
Creating formats-data.js for gen4 tiers
2013-01-25 16:51:53 -08:00
Guangcong Luo
c4a939f517 Mimic and Sketch moves now target correctly 2013-01-25 14:15:08 -08:00
Guangcong Luo
59ab7f43ca Fix Power Trick 2013-01-25 14:10:24 -08:00
Relados
24c0c642c4 Creating formats-data.js for gen4 tiers 2013-01-25 13:59:36 -08:00
Cathy J. Fitzpatrick
0ab7d87af0 Refactor requiring the client to ack requests
This refactored version checks the rqid as part of the decision
data, rather than introducing a new /ackrequest command. This
change is done in a backward-compatible way.

Most of the code does not change compared to the previous version.

The corresponding client commit is Zarel/Pokemon-Showdown-Client@3b82cf5cec
2013-01-25 12:22:34 -07:00
TheImmortal
d3b3609e17 Implement Flame Burst 2013-01-25 21:42:21 +04:00
TheImmortal
cbb65b6583 Add isAdjacent function
Used to check if two allies are adjacent and have not fainted
2013-01-25 21:07:39 +04:00
Guangcong Luo
23e25c0b4b Fix Ditto with new Hidden Power code 2013-01-25 07:35:40 -08:00
Cathy J. Fitzpatrick
ee23f53ff7 Use more logical sanity check for /ackrequest
The previous check for !room.decision was fine, but it's more
logical to check for the presence of the ackRequest method.
2013-01-25 03:01:27 -07:00
Cathy J. Fitzpatrick
f9a8bba681 Fix mistake in comment 2013-01-25 03:00:19 -07:00
Cathy J. Fitzpatrick
f09d287070 Require client to acknowledge requests
In certain laggy situations, the following sequence of events
was previously possible in a battle:

1) Server makes request R_1 and R_2.
2) User 1 selects decision D_1 for request R_1
3) User 2 selects decision D_2 for request R_2
4) Server receives D_1 and D_2 and runs the turn
5) Server makes request R_3 and R_4.
4) Due to lag, User 1 does not realise that the server has
   already run the turn. User 1 wants to change his or her move
   for request R_1, so User 1 cancels decision D_1 and sends in
   decision D_3, intending it to be for request R_1.
5) User 2 selects decision D_4 for R_4.
6) Server receives D_3 and considers it to be the response to R_3,
   rather than the response to R_1 (which was what User 1 intended).
7) Server receives D_4 and considers it to be the response to R_4.
8) Server runs the turn.

The result of this sequence of events is that a move that User 1
intended to be for request R_1 is instead used for R_3, which has
the effect of depriving the user of the ability to make a reasoned
choice of which move to use for R_3.

This commit attempts to solve this problem by requiring the client
to acknowledge having received a request before the server will
accept a decision for that request.

Unfortunately, there is no seamless way to implement this in a
backward-compatible way. In other words, if the client were updated
to always send acks, it would no longer be able to work with old
versions of the server. For example, if the ack were added to the
choice string, old servers would no longer be able to handle choice
strings sent from the client. Similarly, if the ack were added
in the form of a new command (say, /ackrequest), old servers would
emit an unrecognised command error on receiving the command.

This commit maintains backward-compatibility by introducing a version
field to the init data structure sent to the client when joining a
battle room. This version should be incremented for any future
backward-incompatible changes as well.

The implementation of the ack request system is that the client must
send in "/ackrequest rqid" for each request, where rqid is the ID of
the request. If the server has not received an ack for request 'rqid'
when it receives a decision for request 'rqid', it discards the
decision and asks the client for another decision.

The corresponding client commit is Zarel/Pokemon-Showdown-Client@ccf0a97733
2013-01-25 01:19:03 -07:00
Guangcong Luo
68c989907a /potd is supported again
I've introduced a new function: Simulator.eval, which allows chat
commands to evaluate raw JavaScript in the simulator process.
2013-01-24 15:03:04 -08:00
Guangcong Luo
b67454743b Hidden Power fix:
- Random battles and automatic detection sets Hidden Power IVs correctly
- Hidden Power now always does damage based on user's IVs
- User's Hidden Power base power is now reported
2013-01-24 15:03:04 -08:00
TheImmortal
310eb90ac1 Implement Minus & Plus abilities 2013-01-25 02:04:17 +04:00
TheImmortal
7a3a328fd3 Fix mistake in previous commit 2013-01-24 21:30:10 +04:00
TheImmortal
55167c2c51 Implement Healer 2013-01-24 20:11:58 +04:00
Cathy J. Fitzpatrick
79b1814361 Move socket.io to optionalDependencies
The default configuration of Pokemon Showdown does not use
socket.io, so it is more appropriately marked as an optional
dependency. This change is largely cosmetic because npm install
will still install optionalDependencies.
2013-01-23 23:25:07 -07:00
Cathy J. Fitzpatrick
84c00ac31f Remove unused dependency
The 'request' module is currently unused so it doesn't need to
be included in package.json.

In addition, GitHub is now served over SSL (and has been for
a while).
2013-01-23 17:57:52 -07:00
Guangcong Luo
785f8b7b28 Merge pull request #152 from Joimer/patch-5
Pichu-Spiky-eared shouldn't appear in random teams
2013-01-23 14:57:13 -08:00
Joim
27acbf931f Pichu-Spiky-eared shouldn't appear in random teams
Pichu-Spiky-eared has been excluded from the random team forming as it is not available in BW2.
2013-01-23 18:19:36 +01:00
TheImmortal
fc09b6fe9d Mental Herb only cures infatuation in Gen 4 2013-01-23 21:03:19 +04:00