Commit Graph

32 Commits

Author SHA1 Message Date
urkerab
5e9d04e0aa Change default /learn gen and add /oraslearn (#2902) 2016-11-18 09:16:29 -06:00
HoeenCoder
cf1f723fa6 A few fixes (#2893) 2016-11-17 13:39:40 -06:00
Ivo Julca
4fa6c5499b Build: Fix issues reported by the latest Eslint version 2016-11-17 14:27:39 -05:00
Guangcong Luo
2604780ec5 Refactor Tools
Tools will be renamed to Dex soon, which is why the code inside Tools
is calling itself "Dex" now, but right now we're just refactoring its
internal code and not officially renaming it yet.

In the meantime, Tools is now an ES6 Class.

A long-standing bug in learnset loading order (the one
test/chat-plugins/datasearch.js tests for) has finally been fixed, so
Tools.includeMods() is no longer necessary to accurately access modded
data.

Tools.mod has been split into Tools.mod(modid) and
Tools.format(format). The issue of Tools.mod being ambiguous about
whether it's passed a mod or a format hasn't been a _bug_ for a while,
but this is still more readable.

Other renames include:

Tools#isLoaded -> Tools#dataLoaded
Tools.includeMods() -> Tools.includeModData()
Tools.preloadMods() -> Tools.includeMods()
Tools.preloadedMods -> Tools.modsLoaded
Tools.moddedTools -> Tools.dexes

Do not just rename your calls of Tools.includeMods() to
Tools.includeModData(). With the learnset loading bug fixed, there's
no reason to use it unless you need direct access to
Tools.dexes[...].data for some reason (you don't, just use
Tools.mod(...).data)
2016-10-21 13:23:21 -05: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
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
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
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
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
Taylor Everding
1a1f64fe95 Remove .js extension from requires (#2725) 2016-08-30 00:04:40 -05: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
panpawn
737f19d67a Datasearch: fix error reply lag (#2621)
By having ``return`` in these instances, the line ``room.update();`` never happens, so it gives the illusion that the server is lagging when it's probably not.
2016-07-13 01:02:24 -04:00
Vacate
91d19f95d6 Minor wording fixes in /movesearch (#2551) 2016-05-08 03:05:26 +04: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
232785b1d1 DataSearch: handle exceptions in queries 2016-05-02 22:48:07 -05:00
Ivo Julca
22779102cc Lint: Add miscellaneous extra rules
Among the newly added rules, there are quite a few intended to enforce
compliance of CONTRIBUTING.md-blessed idioms, as well as ensure
safe usage of classes and constant bindings.

We are also now enforcing usage of early return in commands.js,
which has 100% compliance as of fd2c45c.
2016-04-25 21:52:21 -05:00
urkerab
7b292840aa Add contest conditions to move searches (#2519) 2016-04-17 06:37:09 -07:00
Caleb Young
4b50059d24 /dexsearch - Prevent LC Ubers being included in LC (#2506) 2016-04-14 04:30:14 +04:00
SolarisFox
e3b226f8f4 /dexsearch: improve tier seaches 2016-04-06 16:57:53 -07:00
Quinton Lee
0e12b8ae30 Dexsearch: fix input validation 2016-04-06 15:37:42 -05:00
SolarisFox
be8ab93e8a /dexsearch: improve input validation 2016-04-06 00:24:19 -07:00
SolarisFox
a9f67a3991 /dexsearch: add 'resists' parameter 2016-04-04 00:24:10 -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
84d6d328fc Fix another oversight in randpoke 2016-04-01 03:54:01 +02:00
Bär Halberkamp
a0caee2a07 Fix this.broadcasting not being set in the datasearch commands 2016-04-01 00:52:16 +02:00
Ivo Julca
87c982e2fe Fix misleading comment in datasearch header
The commands provided are never synchronous.
2016-03-31 16:53:09 -05:00
Ivo Julca
f901bfe31e Fix data load in informational plugins
- Single-process `datasearch` requires mods.
- `info` requires Gen 6 data.
2016-03-31 16:50:50 -05:00
Ivo Julca
bbb58d5a29 Add a test for old-gen /learn 2016-03-31 14:01:11 -05:00
Bär Halberkamp
4b326d75eb Fix /learn not working, and filter out more bogus input 2016-03-31 20:12:25 +02:00
Bär Halberkamp
0e206dcd42 Make /learn multiprocess using the same process as /ds 2016-03-31 15:59:36 +02:00