Commit Graph

90 Commits

Author SHA1 Message Date
Guangcong Luo
c333cb8aad Add basic tag-matching validator to canHTML
This gives commands like !htmlbox and /roomintro a basic validator,
to warn about typoes related to mismatched HTML tags. This is NOT
intended to be secure (we have a separate sanitizer client-side for
that), but is intended to guard against user error only.
2015-04-29 00:07:25 -04:00
SolarisFox
336cbc462a Move config/commands.js to chat-plugins 2015-04-25 00:44:07 -07:00
Ivo Julca
b9b4196314 Command crash logs now report full message sent
Accounting for namespaces
2015-04-17 00:46:23 -05:00
Guangcong Luo
461303e466 Disallow 'click here' in roomintros
'Click here' as link text is heavily recommended against, but it's
easy to forget, which makes it a good thing to ban programmatically.
2015-04-17 00:36:17 -04:00
Morfent
ce1724e179 Replace all s.substr(x, 1) with s.charAt(x) 2015-04-06 21:20:43 -03:00
SolarisFox
b3a942aa71 Fix broadcast cooldown message checking.
Include characters that are important to the function of commands.
2015-03-25 22:59:53 -07:00
codelegend
916814de24 remove unused argument in Room#add calls 2015-03-18 22:11:19 +05:30
Guangcong Luo
c10498bcab Merge pull request #1312 from ascriptmaster/modbattle
Private Room refactor - Distinguish hidden and secret rooms
2014-12-23 16:40:52 -06:00
Guangcong Luo
0f2e92ede8 this.parse is global by default
this.parse in chat commands was changed to default to parsing
in-namespace, when namespaces were introduced. This commit changes
it back to parsing globally, with in-namespace parsing being
optional and defaulting to off.
2014-12-23 16:37:57 -05:00
ascriptmaster
fa79202649 Private Room refactor - Distinguish hidden and secret rooms
Seperated /privateroom command into /privateroom and /hiddenroom. In
hidden rooms, mostly set by battle players, global staff maintain their
ranks within the room, but the rank is not kept in secret/private rooms
(only set by users who can create chat rooms).

Created command /whoare to allow global staff to see the hidden rooms a
user is in.
2014-12-22 02:39:50 -08:00
小太
05b3327b91 Add namespace-like functionality to commands
where object command handlers represent a new namespace
2014-12-15 00:33:55 +11:00
Guangcong Luo
1cf90b54ae Update Config.chatfilter API 2014-12-01 16:52:00 -05:00
Guangcong Luo
db09d66039 Update zalgo filter 2014-12-01 16:49:29 -05:00
Guangcong Luo
4c32621593 Reintroduce command crashguard
If a crash happens during a command (which is around 99% of all
crashes), a bug in either Node or SockJS causes the user who issued
the command to be unable to do say or do anything (although they'll
still receive messages).

We used to have a crashguard to prevent this from happening, but
it was removed due to suspicions of being a significant lag source.
Later lag investigation has shown that it's not the biggest source
of lag, so we're reintroducing that crashguard for now.
2014-10-21 16:49:22 -04:00
小太
ae6da14ca0 Misc cleanup
The important fixes from pull request #865
2014-10-12 21:34:59 -05:00
Guangcong Luo
2fbb1d52a3 Optional 'global' for global promotion/demotion
Adds support for adding the word 'global' in front of global
promotion/demotion commands, for instance /globalmod username
to promote a user to global mod.

Also adds /roomdeauth.
2014-10-12 22:13:22 -04:00
小太
5027be79fb Add jscs as a style checker, and add some extra jshint options 2014-09-29 18:38:01 +10:00
Guangcong Luo
4a761b470d Update zalgo filter
Some users were using some zalgo not caught by the current filter.
The new filter fixes that.
2014-09-05 23:16:14 -04:00
Guangcong Luo
34f9137d69 Fix crash when sending '/ ' 2014-09-04 16:19:20 -04:00
Guangcong Luo
0570c0dbcb canTalk now supports returning /command
returning /command will parse the command returned. This is mainly
useful for Config.chatfilter.
2014-08-30 02:12:09 -04:00
Guangcong Luo
7bf6269813 Remove lobby spoiler filter
It belongs in the config chatfilter
2014-08-22 00:35:04 -04:00
Guangcong Luo
b1cd4e81dc New command API sendModCommand
Does the same thing as privateModCommand, but without logging it
2014-08-12 20:42:35 -04:00
Guangcong Luo
af2026436a More style fixes and Gulpfile updates
JSHint is now a fair bit stricter, and is now correctly checking
files in `mods/`.

The code has been fixed to match the new stricter standards.

JSHint has now caught its second actual bug: Gen 5 Pinap Berry
was Ice instead of Grass.
2014-08-10 20:43:53 -04:00
Guangcong Luo
12b673bb49 Fix style errors; update gulpfile
I used a hack to make the multiple declaration errors go away,
so all that remained in jsHint were actual errors, which I've
now mostly fixed.

All this linting ended up uncovering one actual bug: Uproar's
message not showing. It's a very minor bug in a move no one uses,
so I'm going to fold it into this commit.
2014-08-10 18:06:44 -04:00
Morfent
57482eb7f9 Only merge .js files from ./chat-plugins/ 2014-08-07 07:19:26 -03:00
小太
a2bfb57bfe Move chat plugins to their own directory 2014-08-04 18:33:52 +10:00
Guangcong Luo
21ec515844 nimp no longer needs to be hardcoded 2014-07-27 02:25:46 -04:00
Relados
965ec31d27 Add missing '/' in unrecognized command message
Using '//' would begin a message with '/' and the message should reflect that accurately.
2014-06-30 09:39:30 -05:00
Guangcong Luo
7474c79330 Fix bug in HTML validator 2014-06-28 09:12:00 -04:00
Guangcong Luo
73e3ffaf9a Roomintro feature 2014-06-26 22:53:37 -04:00
Guangcong Luo
3f862c4049 Roomauth can see private commands 2014-06-18 01:23:50 -04:00
TalkTakesTime
4d5f32fd4c Refactor unlinking code 2014-05-06 00:08:54 +12:00
小太
31d784cfd0 Fix previous fix... 2014-04-22 02:51:32 +10:00
小太
031127085d Fix missed quote in command-parser.js 2014-04-22 02:46:33 +10:00
小太
5c8fc7b982 Space after function for anonymous functions 2014-04-22 01:58:16 +10:00
小太
6fb3bc332a Spaces around operators and === instead of == 2014-04-22 01:56:11 +10:00
小太
071863d9f8 Use proper quotes for all the command related files and other minor cleanup
Proper quotes are " for strings that will eventually be read by a human and ' for everything else
2014-04-21 18:55:08 +10:00
Guangcong Luo
de3b4c4432 Introduce !htmlbox
Displays an HTML box. Can only be used by leaders+, or by
roomowners who are also globally drivers+.
2014-04-20 02:54:42 -04:00
Slayer95
05e7060474 Deprecate 'toUserid' global
Replaced by 'toId'.
2014-04-18 16:49:16 -05:00
Slayer95
4c18aa60f1 Remove global 'fs' 2014-04-17 14:37:32 -05:00
Slayer95
75559362b4 Rename global config to Config 2014-04-17 01:12:28 -04:00
Guangcong Luo
2bf7416bcc Refactor targetUserOrSelf
It now always fills out targetUsername, and passes the exactName
flag through to splitTarget. /whois will no longer follow through
name changes unless the /whois user has auth (voice counts).

This is not a secure way to hide from unvoiced users; other
commands such as PMing will still follow through.
2014-04-15 16:46:12 -04:00
Guangcong Luo
f3b698581a Drop support for server version hashing 2014-04-10 19:04:24 -04:00
Guangcong Luo
f6f6ece41f Battles all go into a single battle modlog 2014-02-26 15:13:50 -05:00
Tyler Stark
afb3dc0c09 First pass at code quality: adding semicolons. 2014-02-09 20:35:42 -06:00
Guangcong Luo
2ccac636a9 Global ranks can't bypass in modchat in private rooms 2014-01-02 21:19:33 -08:00
Joimer
ef7bbd182a Fix /modlog all
Modlog now uses synchronous fs directory reading to check all existing
modlogs.
Additionally, A new folder has been created to save all modlogs, since
battle modlogs are saved as well.
2013-12-05 16:03:22 +01:00
Joimer
52e50cb539 Update Scavenger Hunt plugin 2013-12-04 18:03:56 +01:00
Joimer
14fcfdc47e Implement chat plugins
Chat plugins are a set of functionalities and data that allows
users to implement in their server additional plugins less related
to the main purpose of the simulator.

The plugins are to be used with chat commands and are tightly
implemented with them. Plugins can be used for games or other
relevant interaction of users with the chat commands.
2013-12-04 17:59:31 +01:00
Joimer
056ad5194e Improve modlog
Modlog is now separated by rooms and each room has its own independent
modlog file to be searched into.
The new syntax allows to search directly into the room's modlog, but also
allows you to input a room and add then the criteria after a comma to
find about other rooms's modlogs.
You can also search in all rooms at once using 'all' as roomid.

Usage:
/modlog - Searchs for last 100 lines on current room's modlog.
/modlog lines or word - Searches for lines lines or word into room's
modlog.
/modlog roomid, lines or word - Searches for lines lines or word into
roomid's modlog.
/modlog all, word - Searches for word onto all modlogs.
2013-11-27 15:26:06 +01:00