Commit Graph

285 Commits

Author SHA1 Message Date
panpawn
62760c3836 Rename unclear variable in Chat#toDurationString (#2971)
This renames 'limit' -> 'precision'.
2016-11-30 19:56:19 -06:00
Marty-D
ed86f0bad4 Remove Contest categories from move details
They don't exist anymore.
2016-11-29 22:12:36 -05:00
Bär Halberkamp
8fce8c2633 Refactor /whois and /checkpunishment (#2967)
Also add a Punishment monitor
2016-11-29 19:18:24 -06:00
panpawn
62d6800eff Whois: Add hover room title to battle rooms (#2960)
This will tell a user who the battle is against (if it's a battle room) by hovering over it, kind of like how user-popups work.
2016-11-29 13:13:05 -06:00
Marty-D
1ddf9180b3 Add Z-Move info to /dt 2016-11-24 18:50:43 -05:00
InactiveUser
0a7689b6c9 Reword htmlbox help (#2910)
* Reword htmlbox help

I think the way it was before kind of confusing, especially with the not rank part, hopefully this helps?

* Removed *
2016-11-22 13:01:58 -06:00
The Immortal
e8cac27e55 Fix b137faf 2016-11-20 05:24:09 +04:00
Bär Halberkamp
b137faf5ed Make using 'max' in /statcalc also set boosting nature 2016-11-20 01:27:11 +01:00
Ivo Julca
4fa6c5499b Build: Fix issues reported by the latest Eslint version 2016-11-17 14:27:39 -05:00
Bär Halberkamp
61b03fff04 Fix /checkpunishment giving results for names with toId(target) === '' 2016-11-15 16:03:53 +01:00
Bär Halberkamp
ba7470f3eb Show the command that's actually being used when failing a permission check in /whois 2016-11-15 16:03:53 +01:00
panpawn
fae82aa78f Update a few help commands (#2877)
-Moves groupshelp up a line, and also slightly reword it
-Moves statcalchelp up a line
2016-11-07 23:17:29 -08:00
etienne maury
5eb4c4a42e add room rank and global rank on /groups (#2875) 2016-11-05 03:06:40 -07:00
panpawn
da7fbe031b Checkpunishment: Don't use target id in UI (#2863)
This makes it more streamlined to how `/whois` looks
2016-10-29 00:04:20 -05:00
Guangcong Luo
22c6342c00 Support offline users in /alts
/alts now delegates to a new command /checkpunishment, if passed an
unknown username. This allows mods to check offline users for active
punishments.
2016-10-23 22:00:49 -04:00
Nixola
a99992c14c Added third type to /weakness (#2851)
* Added third type to /weakness
In case of Trick-or-Treat or Forest's Curse, a pokémon can have three types. I updated the /weakness command to reflect that.

* Fixed Travis' warning and error
2016-10-22 18:36:41 -05:00
Guangcong Luo
87c41eb67c Rename simulator.js to room-battle.js
simulator.js doesn't actually contain the simulator, but is really just
an implementation of battles in the RoomGame interface.

Renames:
`Simulator.Battle` -> `Rooms.RoomBattle`
`Simulator.BattlePlayer` -> `Rooms.RoomBattlePlayer`
`Simulator.SimulatorManager` -> `Rooms.SimulatorManager`
`Simulator.SimulatorProcess` -> `Rooms.SimulatorProcess`
`Simulator.create` -> no longer exists, use `new Rooms.RoomBattle(...)`
2016-10-21 13:21:12 -05:00
Guangcong Luo
d84d06a8d2 Add !optionsbutton and !soundsbutton 2016-10-20 21:31:52 -04:00
The Immortal
7193860ac1 Analysis: Fix BH links 2016-10-16 05:24:12 +04:00
panpawn
8ab309ae74 Add missing linebreak in /opensource (#2833) 2016-10-10 03:21:54 +04:00
panpawn
76285471a0 Fix double errorReply while muted in some cases (#2830)
Due to the recent refactor that changed how `this.canTalk` works, if a user was muted in a room, and then tried to do a command that wasn't allowed to be used if they can't talk, it would send two replies: "You are muted and cannot talk in this room." AND "You cannot do this while unable to talk."

This makes it so that if you're using a command while muted that isn't allowed to be used if you can't talk, it will just use the "You are muted and cannot talk in this room." errorReply.
2016-10-08 20:58:16 -07:00
panpawn
420e28ce91 Chat: Tell locked users their lock duration (#2823)
This also adds `Punishments#checkLockExpiration` - mostly for this, but also to remove some repetitive code in the whois command as well.
2016-10-04 23:52:19 -07:00
panpawn
7022704bf8 Add Dex repository to /opensource (#2809)
Apparently, a lot of people still don't know this is a thing, so this might be a good way of making people know it's actually a thing.
2016-10-02 22:04:58 -07:00
Guangcong Luo
f95276573a Fix crash in /bugs 2016-10-02 13:35:38 -07:00
sirDonovan
fafb2c1099 Fix crashes in datasearch commands
Loading data on the main process was accidentally removed in
64fa2b9801
2016-10-02 15:08:03 -05:00
The Immortal
88a1961f86 Remove Other Metagame of the Month link from /om 2016-10-02 18:10:50 +04:00
Guangcong Luo
d6f5404e7e Rename CommandParser to Chat
We had a lot of discussion in Dev and a somewhat-close poll, but in
the end "Chat" was a better name than "Messages", and also has the
advantage of being shorter (which is nice for Chat.html and
Chat.plural which should be short).
2016-09-30 18:31:15 -07:00
Guangcong Luo
da1b318707 Move text processing from Tools to CommandParser
The following functions have been renamed:

- Tools.html to CommandParser.html
- Tools.plural to CommandParser.plural
- Tools.escapeHTML to CommandParser.escapeHTML
- Tools.toDurationString to CommandParser.toDurationString
- Tools.toTimeStamp to CommandParser.toTimestamp
  (notice the lowercase 's')

This is in preparation for a rename of Tools to Dex (by removing the
non-dex-related functions) and a rename of CommandParser to either
Messages or Chat.
2016-09-30 18:04:13 -07:00
Guangcong Luo
b4a511a1e6 Update /rules
- Fix crash in PMs
- Permission is now `editroom`
- Now tells other mods that room rules have been updated
2016-09-30 00:09:32 -07:00
panpawn
f5271bb753 Refactor confirmed status to trusted (#2798)
It should be noted that various user functions have been renamed as well to reflect this change as well.
2016-09-29 13:02:14 -07:00
Guangcong Luo
64fa2b9801 Replace CommandParser.globalPattern
I honestly don't know exactly why it exists (its commit didn't exactly
explain it), but Slayer95 thinks it's high-priority so this solution
should probably be sufficient?

?_?
2016-09-29 12:42:58 -07:00
Guangcong Luo
6b077d9453 Fix crash in /rules 2016-09-28 18:57:57 -04:00
Guangcong Luo
3763ef80ea Make !om search less spammy
This is the source of the infamous !om g issue.

The new design looks better, anyway, and allows !formatshelp to also
be braodcast since it's no longer spammy.

!om searching will also now only search OMs.
2016-09-26 17:25:53 -04:00
Quinton Lee
3822e0c96a Update guide links in /roomhelp 2016-09-26 15:44:20 -05:00
Guangcong Luo
ed08b145fc Update roomhelp permissions
Can now only be broadcast by ROs, leaders, and admins

Closes #2784
2016-09-25 23:47:00 -04:00
Guangcong Luo
3c5525c8b0 Fix more crashes in PM refactor 2016-09-25 16:22:28 -04:00
Guangcong Luo
5a16c884da Fix a variety of bugs in PM commands
Most of these were introduced in the PM refactor, but an honorable
mention goes to the global command regex.
2016-09-25 14:12:43 -04:00
Guangcong Luo
1427871a09 Refactor Messages
PMs no longer special-case commands. The implementation of /invite,
/me, etc in commands have been fully moved from messages.js back to
commands.js and the rest. This makes Messages command support a lot
closer to how CommandParser itself handles commands; the two files
should be mergeable soon.

/me has been refactored, and now supports /ME, /me's, etc in PMs and
regular chat exactly the same way.

context.pmTarget is now guaranteed to be `User|undefined`, rather than
its previous specification of `User|string|undefined`. The previous
use-case of putting a string in context.pmTarget was to support
errorReply when PMing a nonexistent user, but special-casing that
case is easier than having to support a possible string pmTarget
everywhere.
2016-09-24 23:14:16 -07:00
Guangcong Luo
398dcf93ad Update /roomhelp
Replace /modchat with /roomsettings, and rephrase Tours link, and bold
some headers.

Closes #2764

Closes #2640
2016-09-24 23:14:16 -07:00
Bär Halberkamp
c6814a384d Properly support custom room punishments 2016-09-24 22:49:51 +02:00
Ben Davies
a88825e55f CommandParser: register global command aliases, optimize TestPattern registration (#2777)
Aliases like /j used to not work when called from the global room while not in
lobby.

Using rest parameters for TestPattern#register instead of a
single array came out to be faster.

/roomtopic also isn't a command.
2016-09-23 19:50:56 -05:00
panpawn
eaadd1fd44 Fix broken permission with /htmlbox (#2766)
This now makes it so that if a user can broadcast but cannot declare in that room, and they attempt to broadcast it, it will now send them the error reply themselves instead of broadcasting the error reply to the room.

Credits to Slayer95 for this fix!
2016-09-22 20:56:07 -07:00
czn-PS
585d7422fd /htmlboxhelp: Update requirements (#2759) 2016-09-20 09:02:04 -07:00
Ivo Julca
ce9cdecafd Drop commands sent to rooms from outside 2016-09-17 19:42:15 -05:00
Guangcong Luo
6b4eaf9422 REALLY support commands in PMs
These changes were supposed to be in de524c1a26 but got lost in my
Git stash...

Once again, this is very experimental code; please don't base any
serious changes on it.
2016-09-17 01:16:56 -07:00
Guangcong Luo
8367425694 Fix bugs in roomban/blacklist refactor
- /ip would display "undefined" for rooms a user isn't banned/muted in
- CrisisMonitor would report private roombans/blacklists
- Roombans/blacklists would alert for rooms you're not in
- There were crashes in /mute and /hidetext
2016-09-16 20:20:32 -07:00
Guangcong Luo
05ae323fcd Refactor roombans/blacklists
Roombans/blacklists have been mostly rewritten from scratch.

The new code mostly uses the same patterns as global punishments.

In addition:
- /ban has been renamed /globalban
- globalbans and blacklists now require a reason
- bans and blacklists in public rooms now show up in global modlog
- blacklist syntax is different: /blacklist and /unblacklist
- ban/blacklist display in /whoare is now more detailed
2016-09-16 10:27:26 -07:00
Guangcong Luo
7a7b46bc1e High priority blacklists fixes
This isn't all the work that needs to be done on blacklists, but it's
the highest-priority changes.

- blacklists.tsv has been renamed room-punishments.tsv
- The format everywhere has changed to roomid:userid, rather than
  roomid|userid
- roompunishments.tsv's format is now `Room ID:User ID, IPs and alts`
  rather than `User ID, Room ID|IPs and alts`, which is more sane and
  also cuts down on repetition of room IDs

Those are the changes that affect storage format, which are highest
priority because I don't want to support the previous format.

Other changes include:
- Punishments.roombannedIps renamed to Punishments.roomIps
- Punishments.roombannedUserids renamed to Punishments.roomUserids
- Some refactoring for ES6 destructuring
- Various bugfixes
2016-09-15 06:10:54 -07:00
Bär Halberkamp
28c0a2a22c Rewrite roombans to be timed as well (#2545)
Also implement blacklists
2016-09-15 04:35:00 -07:00
Ben Davies
d9c6fe54b2 ProcessManager: subclass to extend ProcessManager, unit tests setup (#2739)
Before, an options object containing properties and values to be used
was how decorated instances of the class would be created. This meant
the constructor could assign anything you feel like to `this`. Rather
than that, the constructor now assigns a strict set of values, and
methods are redefined in subclasses.

Basic unit tests were added to test if they could be written for after
the final refactor to fix the other memory leak here.
2016-09-09 15:51:49 -05:00