Commit Graph

424 Commits

Author SHA1 Message Date
Guangcong Luo
86707e6ef5 Add new FS module
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!
2017-06-23 14:29:13 -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
panpawn
66c38b7430 Change Player rank from ★ to ☆ (#3240)
There is a client-side counterpart to this.
2017-02-23 05:03:45 -06:00
panpawn
4b55306043 Promote: String standards (#3051) 2017-02-17 14:12:47 -06:00
Ben Davies
93357df2dc Add /man alias for /help (#3094) 2017-02-16 22:06:58 -06:00
Guangcong Luo
ede3cd5acc Add documenting comment to /adddatacenters 2017-02-10 17:10:15 -05:00
Guangcong Luo
e45b52a57b Fix DeprecationWarnings for lack of callback
Various standard library functions now warn for lack of callback, so
this commit adds those callbacks.
2017-02-10 17:10:15 -05:00
Guangcong Luo
ede94a16cf Rename /roomban to /ban
This was planned from the beginning, but I gave it a few months to make
sure people who accidentally used the wrong one wouldn't be confused in
the interim.

No one should have the reflex to use /ban for global bans by now, so
this should be a safe time to do the rename.
2017-02-10 17:10:15 -05:00
panpawn
53b232658c Namelock: Modlog IP & string standards (#2941) 2017-02-10 14:51:42 -06:00
HoeenHero
0099331935 Handle forced autojoin of lobby on side servers (#3198) 2017-01-30 21:38:40 -05:00
Bär Halberkamp
b0305eac66 Fix /markshared and /unmarkshared not checking for existing keys properly 2016-12-30 02:58:03 +01:00