Commit Graph

433 Commits

Author SHA1 Message Date
Bär Halberkamp
464768e7d8 Refactor both locks and punishments (#3698)
This both allows staff to lock users that are offline, given they have a previous punishment (globally or in any room)
This also will utilize existing punishment information for handling nameblacklists, making a nameblacklist of a user with a current punishment equivalent to having used /blacklist at the moment of that punishment
2017-07-27 18:36:34 -04:00
Charlie Kobayashi
542ae1507d Remove lastCommand check after the command goes through (#3808) 2017-07-21 01:10:41 -05:00
Guangcong Luo
04f10a5550 Add help for /bash
Fixes #3809
2017-07-21 00:30:23 -05:00
panpawn
24e2bff47d Add !code: a multi-line code broadcasting command (#3802) 2017-07-20 17:10:05 -05:00
panpawn
baaf38647b Hidetextalts: Make it actually hide alts' messages (#3788)
I guess I didn't realize the difference between prevNames and alts, now I do.
2017-07-16 10:21:19 -05:00
jumbowhales
62a80070f2 Help: add itemsearch as an information command 2017-07-16 15:25:44 +02:00
panpawn
72a5beb1ea Add /hidealtstext command (#3750)
When a user is spamming, often times they are doing so under several accounts.  When this happens, a staff member has to manually hide each alts messages in the room, which takes up one line of the chat for each alt.  This command makes these cases easier and less-spammy for the chat.
2017-07-13 11:04:37 -10:00
Quinton Lee
2643d0f34e Preserve custom formats in /hotpatch formats
Fixes https://github.com/Zarel/Pokemon-Showdown/issues/3720
2017-07-11 15:50:13 -05:00
asgdf
9e075f5736 Don't trigger CrisisMonitor for nameblacklists in secret rooms (#3700) 2017-06-27 17:44:56 -07:00
Guangcong Luo
0143ae28dd Replace fs module (#3686)
The new FS module is an abstraction layer over the built-in fs module.

The main reason it exists is because I need an abstraction layer I can
disable writing from. But that'll be in another commit.

Currently, mine is better because:
 - paths are always relative to PS's base directory
 - Promises (seriously wtf Node Core what are you thinking)
 - PS-style API: FS("foo.txt").write("bar") for easier argument order
 - mkdirp

This also increases the minimum supported Node version from v6.0 to
v7.7, because we now use async/await. Sorry for the inconvenience!

This also drops the mock-fs-require-fix dependency

mock-fs-require-fix was always kind of a huge hack. It's no longer
necessary, with an FS API that does everything it used to.

This removes a lot of other hacks from test/main.js, which is nice.
2017-06-24 13:42:54 -07:00
Bär Halberkamp
0b529e1d4d Fix user reasons in punishments 2017-06-23 01:20:50 -04:00
Guangcong Luo
dbea0875fb Fix Erika spelling in /avatar 2017-06-22 20:58:01 -07:00
panpawn
0bf26f0928 Fix lock/ban messages without a reason but proof (#3664)
I don't know what I was thinking with this line
2017-06-19 19:07:12 -07:00
panpawn
df979b8f89 Fix typo from #3661 (#3663) 2017-06-19 15:22:06 -07:00
panpawn
8e0b51d8b2 Some blacklist command changes (#3661)
- Allow /expiringblacklists to show the list of blacklists that are expiring within 3 months or less
- Add /nameblacklist as an alias to /blacklistname and document it
- Change /blacklist and /blacklistname modlog text to say "from room title" to mirror roombans modlog UI
2017-06-19 14:02:29 -07:00
Bär Halberkamp
961ffc3f9b Upgrade eslint to 4.x (#3657) 2017-06-18 22:37:43 -07:00
Bär Halberkamp
38556a5aa4 Further refactor punishments when it comes to checking alts 2017-06-18 13:52:34 -07:00
Bär Halberkamp
02347fde67 Don't punish other users on shared IPs 2017-06-18 13:52:34 -07:00
panpawn
e7dc3f5300 Fix lock/ban global modlog entries with proof (#3649) 2017-06-17 14:45:22 -07:00
VXN
8225881f93 Add a check for Room only ranks (#3647)
Normally when you do /owner it gives 'did you mean /roomowner or /globalowner?' However global room owner doesn't exist as owner is a room owner rank. This PR fixes this issue.

Sorry for the bad pr name, I'm still kinda new to contributing here.
2017-06-16 15:40:25 -05:00
Guangcong Luo
d0b44f0a9d Fix style error in #3635 2017-06-15 18:45:43 -04:00
Guangcong Luo
19a7107991 Improve proxy IP management commands
- Add /widendatacenters to support automatically widening IP ranges
- Support /hotpatch datacenters
2017-06-15 18:39:36 -04:00
panpawn
a45b79442b Hotpatch: Use Rooms.global.notifyRooms to notify (#3638)
And also slightly change the behavior of Rooms.global.notifyRooms
2017-06-14 14:49:58 -05:00
panpawn
103f4828ae Automatically kill server on 0 battles in lockdown (#3635)
This allows for when the server is in lockdown, and the final battle finishes, for the server to automatically kill itself.
- Setting Config.autolockdown to false will turn this off.
- This also adds a new command to toggle Config.autolockdown
- This also introduces Rooms.global.notifyRooms
2017-06-14 13:57:52 -05:00
Guangcong Luo
48a520ed4b Fix modjoin check in /auth
Fixes #3633
2017-06-14 00:45:11 -05:00
HoeenHero
093701eb40 Notify users when a declare is used (#3435) 2017-06-13 22:07:56 -05:00
panpawn
1919fd556a Support hidden lock/ban spoiler proof message (#3632)
This allows for staff to add a proof field that is hidden from the user but on the same line in the modlog for their lock/ban reason.
2017-06-13 15:17:31 -05:00
Lionyx
d8068d4a2c Showblacklisthelp: Fix command spelling error (#3627) 2017-06-12 10:46:11 -05:00
asgdf
c25d23a7f0 Refactor modlog (#3569) 2017-06-10 12:32:55 -05:00
panpawn
58935fe61e Avatars: Don't allow setting to constructor (#3570) 2017-06-05 06:10:32 +08:00
Lionyx
0ab29c0f4f Notify staff room when a user is globally unbanned outside of it (#3554) 2017-05-28 19:43:23 +09:00
Lionyx
61043f8346 /forcepromote: Prevent from promoting to Global Room Owner (#3544) 2017-05-25 10:23:35 +09:00
Guangcong Luo
6dd58b40d3 Refactor simulator into new sim/ directory
This is a surprisingly minor refactor considering how many files it
touches, but most of this is only renames.

In terms of file renames:
- `tools.js` is now `sim/dex.js`
- `battle-engine.js` is now `sim/index.js` and its three classes are
  in `sim/battle.js`, `sim/side.js`, and `sim/pokemon.js`
- `prng.js` is now `sim/prng.js`

In terms of variable renames:
- `Tools` is now `Dex`
- `BattleEngine` is now `Sim`
- `BattleEngine.Battle` is now `Sim.Battle`
- `BattleEngine.BattleSide` is now `Sim.Side`
- `BattleEngine.BattlePokemon` is now `Sim.Pokemon`
2017-05-05 16:48:38 -05:00
Hidden50
44ba2f2c5f Fix /timer: Only let players and auth turn on the timer (#3492) 2017-04-30 18:04:53 -07:00
Guangcong Luo
961e56f194 Fix crashes/bugs in /timer 2017-04-28 03:26:01 -04:00
Guangcong Luo
392c58bc39 Notify staff room for unlocks 2017-04-28 03:25:40 -04:00
The Immortal
51b876c0a6 Add missing period 2017-04-25 19:10:17 +04:00
Ben Davies
93968ce082 Commands: make /modlog compatible with OS X/BSD, fix silent error (#3480)
- tac isn't installed by default on OS X and flavours of BSD, which would
cause /modlog to fail in certain cases, so awk is used instead for them
- running /modlog all or /modlog public with a number of lines to
return rather than a string to query with now replies with an error
instead of treating "all" or "public" as literal rooms and trying to
read their modlog files
2017-04-24 22:10:35 -07:00
Guangcong Luo
72c4ae4cf9 Refactor timer
This commit removes all timer code from rooms.js, and adds a new
BattleTimer class to room-battle.js which handles timers. In theory,
the timer is able to be used in other roomgames, but several parts may
need to be rewritten for that.

The new BattleTimer has nicer code, and also fixes #3438
2017-04-23 17:58:48 -07:00
Ben Davies
8de4bdfecb Sockets: refactor to use maps (#3474) 2017-04-23 16:39:38 -07:00
Ben Davies
7d27efb817 Matchmaking: move battle logging back to Rooms.global (#3454)
* Matchmaking: move battle logging back to Rooms.global

For now, logging should be dealt by the global room until logging can be
abstracted away from it. This makes it simpler to refactor the logic in
Matchmaker#startBattle to be handled by Rooms.createBattle where it belongs.

* Matchmaking: use Matchmaker#cancelSearch format parametre

Optimizes cancelling searches if the format is known
2017-04-15 17:51:34 -04:00
Charlie Kobayashi
246ebde9c9 Room-games: dont rename players to their guest accounts (#3425) 2017-04-04 16:56:23 -04:00
Quinton Lee
68f10696a3 Fix spacing in /namelock message 2017-03-25 12:05:05 -05:00
Lionyx
38758b022f Fix typo in /globalpromote 2017-03-19 13:57:00 -05:00
Ben Davies
213b697d7c Rooms: move matchmaking logic to ladders-matchmaker.js (#3364)
This abstracts matchmaking logic from the global room away to its own
module, allowing the two to be decoupled from each other entirely with
some refactoring.

Related to #3361
2017-03-17 02:42:30 -05:00
Ben Davies
bc72bc42da Commands: prevent unintentionally adding aliases to the wrong room (#3360) 2017-03-15 17:39:31 -05:00
Lionyx
50dbe1e02d Fix /invite on inviting a non-global auth to Staff (#3359)
Before and after that change → https://puu.sh/uKnD3/0235163ed7.png
2017-03-15 15:05:58 -05:00
Charlie Kobayashi
9141cb8415 Fix permissions for pminfobox (#3295) 2017-02-25 21:14:00 -05:00
panpawn
8a4566a172 Markshared: Return help command on no target (#3290) 2017-02-25 01:43:44 -06:00
Guangcong Luo
d8d56163a6 Fix /savelearnsets
No one has reported its brokenness in ever! I guess I'm the only one
who scripts learnset changes with /eval...

Coming up next: A learnset change scripted using /eval!
2017-02-23 05:13:00 -06:00