Commit Graph

35 Commits

Author SHA1 Message Date
Ivo Julca
4fa6c5499b Build: Fix issues reported by the latest Eslint version 2016-11-17 14:27:39 -05: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
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
panpawn
36d7728b06 Update help commands to reflect new bot rank (#2634)
Also, give the bot rank the new addhtml permission in config/config-example.js

... And, we are going to fix promoting locked users to rank bot.
2016-07-20 19:50:47 -06:00
Guangcong Luo
4a995350bb Shim Array#includes
This also refactors everything to use Array#includes except data
and mods, which are large enough that I'll refactor them later
probably.
2016-05-04 02:55:18 -07:00
Ivo Julca
10bb83bf3c Improvements to command broadcast API
- Method `this.runBroadcast()` has been split from `this.canBroadcast()`.
It's now the only method handling command-usage and intended as the main API
for synchronous commands. Async commands will execute both separately.
Note that the `suppressMessage` parameter is now passed to `runBroadcast`.

- The semantics of `broadcasting` have been similarly split.
`this,broadcastMessage` will be set to a truthy value when `this.canBroadcast` is run.
`this,broadcasting` will only be set to `true` once `this.runBroadcast` is executed.
2016-04-02 15:46:13 -05:00
Bär Halberkamp
3465829e22 Add permissions for roomgames 2016-02-26 22:19:19 +01:00
Bär Halberkamp
f5a4e28205 Specify which game is in progress 2016-02-17 21:09:44 +01:00
Guangcong Luo
b665660608 Refactor for more ES6 features
Now that nodejs/node#3072 is mostly fixed, we can finally start using
Node 4+ features.

This refactor:

- uses arrow functions where appropriate

  Note that arrow functions still aren't used in Mocha, where `this`
  is sometimes meaningful.

  This also removes the need for .bind() nearly everywhere, as well
  as the `self = this` trick.

- refactors Validator and Connection into ES6 classes

- no longer uses Array#forEach for iterating arrays

  We strongly prefer for (let i = 0; i < arr.length; i++) because of
  performance reasons. Most forEaches have been replaced with for..of,
  though, which is 5x slower than the long-form loop but 2x faster
  than forEach, which is good enough outside of most inner loops.

  The only exception is tournaments, which is due for a more invasive
  refactor soon anyway.
2016-02-10 17:40:21 -06:00
Guangcong Luo
2d052a300c Merge pull request #2330 from urkerab/hangman-simplify-html-wordsofar
Simplify generating the HTML for the word so far
2016-01-02 03:47:42 +00:00
urkerab
6daa3cd93d Simplify the HTML generated for the word so far 2016-01-01 20:23:55 +00:00
Konrad Borowski
81f602b8d8 Always use trailing comma for multiline objects 2016-01-01 00:20:07 +01:00
Bär Halberkamp
79451c1843 Hangman: Use the images in the client 2015-12-14 06:54:39 +01:00
Bär Halberkamp
6741db3ad4 Add a 'gameid' field to room games 2015-12-09 10:44:47 +01:00
Bär Halberkamp
3672c360ab Hangman: Convert hangman to the game system 2015-12-09 10:44:47 +01:00
Ridaz
fd4e35800c Hangman: Add missing comma 2015-11-26 06:46:44 +00:00
Guangcong Luo
9d2ca9986f Make /hangman display hangman help
Original `/hangman` functionality has been relocated to
`/hangman display`.
2015-11-25 21:24:24 -05:00
Caleb Young
3135f9d689 Hangman: Add enable and disable to help message 2015-11-25 17:32:30 -08:00
Guangcong Luo
d35eeca44e Hangman: Redesign
- font sizes and stuff tweaked
- letter guesses no longer appear in chat log
- etc
2015-11-24 23:53:55 -05:00
Guangcong Luo
1e1205fbf8 Hangman: Support ' and - in words 2015-11-24 14:45:35 -05:00
Bär Halberkamp
39aa93c9c0 Hangman: credit Zarel and crobat
Zarel vastly improved the design, and crobat made the hitmonchan sprites
2015-11-24 19:22:39 +01:00
Bär Halberkamp
6deee7bfda Hangman: Make the results also show up when joining a room 2015-11-24 17:01:51 +01:00
Bär Halberkamp
bfa5aa7733 Hangman: Disallowed guessing in your own game 2015-11-24 17:00:57 +01:00
Bär Halberkamp
7d107cb592 Hangman: Add new graphics for the hanging man 2015-11-24 16:57:27 +01:00
Bär Halberkamp
b480d213b4 Hangman: Allow disabling and enabling hangman 2015-11-24 16:45:07 +01:00
Guangcong Luo
65738057a5 Hangman updates
- Do not bring hangman closer to hanging for invalid-length guesses
- Raise max length to 30
- Show help when using /guess with no guess
- More terse header
2015-11-24 10:04:39 -05:00
Bär Halberkamp
047e1376e7 Hangman: Remove screen clutter by hiding old hangman windows
This already happened when the game was ended, but it didn't do that when the man was either hanged or saved before
2015-11-24 03:07:21 +01:00
Bär Halberkamp
2462077d01 Hangman: Also show the last guess when the word is guessed 2015-11-24 03:07:17 +01:00
Bär Halberkamp
dbaf9d73e0 Hangman: Disallow whitespaces characters that aren't spaces 2015-11-24 03:07:08 +01:00
Bär Halberkamp
4b8dc1664b Hangman: Check for words with only spaces 2015-11-24 03:07:01 +01:00
Bär Halberkamp
24e44bc501 Fix hangman windows being broadcasted to the entire room 2015-11-23 21:15:15 +01:00
panpawn
6727d87808 Standardize canTalk() permission in chat-plugins 2015-11-23 16:06:12 +00:00
Bär Halberkamp
f8530e5ab5 Improved the hangman help and commands 2015-11-23 01:54:33 +01:00
Bär Halberkamp
21d9051436 Add a chat plugin for hangman 2015-11-19 20:20:53 +01:00