Fix early failure in User#disconnectAll for multiple connections
The ascending loop over the connections array wasn't appropriate, given that Connection#destroy mutates that array.
Battle#resendRequest's argument is now a connection, rather than user
- The higher specificity saves bandwidth and suppresses a client crash when another user connection joins the battle.
Tweak Smeargle's Random Doubles Moves
Fix support for multiple connections in the same battle
The request would not be sent to the connection as it wasn't in the room.
Fix logs sent to the first connection of a user joining a room
The message reporting their join would be sent twice.
Prevent battles between offline users from starting
There is no reason to allow them, while doing so allows some race conditions where the first connection of a player joining a battle room doesn't receive their request.
Merge pull request #1378 from Audiosurfer/patch-1

Tweak to a Random Doubles Movepool
Merge pull request #1379 from Slayer95/users

Fix several issues with users's joining and leaving
Gen 2: Correct sandstorm damage

Sandstorm damage is the double in gen 2.
make /privateroom more general. allow different privateroom settings
Gens 1 & 2: Refactor secondary status effects.
After a review of the disassembled code of gens 1 and 2, we've come to realise some very important stuff regarding secondary status.
On gens 1 and 2, Fire-types are not inherently immune to burn.
Ice-types are neither inherently immune to ice.
On gen 1, secondary status effects for paralyse, burn, and freeze will be ignored if the target Pokémon shares a type with the move-type.
On gen 2, the same happens but only for burn and freeze.
Poison-types are actually immune to poisons.
On gen 2, tri-attack can burn fire-types and freeze ice-types.
On gen 1, body slam cannot paralyse normal-types.
Also, Lick cannot paralyse ghost-types.
And thunderbolt/thunder can't paralyse electric-types.
Gen 1: Update Psychic's secondary chance

It's closer to 33% than to 30%.
This is a temporary fix until I move all secondary effects to their chance over 255 like it is on the cartridge.
Merge pull request #1382 from codelegend/privaterooms

make /privateroom more general, allow multiple privateroom settings.
Gen 1: Fix faint mechanics with two turn moves
End events were not being called as queue was being emptied too soon.
Reverting with this commit part of commit 85994c45d8005164c3e26a083c047648759f2225, as turn is properly ended on gen 1 modded's faint function.
Turn still ends after a faint properly, statuses (like psn) do not drop health from surviving Explosion targets.
Gens 1 & 2: Fix bug with substitute on <25% hp

An improper check caused damage on substitutes when the user had <=25%hp to be lowered.
Update VGC 2015

Tornadus/Thundurus/Landorus with hidden ability can only be obtained
from gen 5 (BW2 Dream Radar) and thus can not have the pentagon.
Gen 1: Remove invulnerability glitches
Gen 2: Burn is dealt with on damage calculation
Gen 2: Fix phazing moves
Commit 15a0c241f5715d8547e62a6df2fc807def487751 forgot to revert the changes on 6e30b6a9ebbfab6562adefcd35d52865ff29e846.
Now they are implemented properly.
Gen 1: Update nomenclature
Update gen 1 code to use the same nomenclature as modern gen code.
This avoids confusion and makes it easier to read.