Commit Graph

43 Commits

Author SHA1 Message Date
SolarisFox
29b961ff69 Style fix: indexOf() comparisons 2015-05-18 15:55:57 -07:00
Morfent
882e9369f2 Chat plugins: AotD and Trivia bug fixes
- Remove question sorting on loading the Trivia plugin, since it is no
  longer required
- Trivia game winners are chosen based on who answers first, not who
  signs up first
- The Artist of the Day is no longer always the first artist to be
  submitted
- Replace instances of foo > -1 with foo >= 0
2015-05-18 18:38:29 -03:00
Morfent
062f56ddd2 Chat plugins: mute/lock checks, add remaining help docs...
Letting users that can't talk use the more important commands is fine
and all, until they find a way to spam with them.

- Remove redundant this.canBroadcast call in /aotd
- The response after changing the Quote of the Day uses the proper
  broadcast style
- /aotd viewnoms sorts the prenomination list
- /trivia qs acknowledges that Video Games is a category
- Change suggestions to use the deprecated /trivia help command to /help
  trivia
- Add style fixes used in the Trivia to the The Happy Place and The Studio
  plugins
2015-05-05 22:43:33 -03:00
Morfent
69be1d638b Trivia plugin: add /help docs, more style fixes
- Fix style on multiline strings
- Use double quotes for HTML
- Fix remaining bugs in trivia submission from bee3a73
2015-04-28 19:41:05 -03:00
sirDonovan
c80d541dcc Trivia plugin: fix /trivia help
Fix typos and line breaks
2015-04-22 04:31:41 -05:00
Morfent
bee3a73559 Trivia plugin: optimize question handling...
Binary searches are now used instead of linear ones when splicing
questions in and slicing all the questions in a category from the
questions arrays. Stalemates are now handled after scoring answers
instead of just before asking a question.
2015-04-17 07:23:01 -03:00
Morfent
3aada3608b Trivia plugin: fix crashes from question submission 2015-04-16 22:35:18 -03:00
Joimer
b480deb2d2 Fix typo in Trivia ladder function 2015-04-15 00:49:55 +02:00
Morfent
41b4c3cbc1 Trivia plugin: optimize ladder updates, bug fixes
- the ladder is now saved in triviadata.json, and gets updated at the
  same time ranks do instead of needing to loop through the leaderboard
  once more
- Trivia.inactivityCounter clears properly on answer
- number and timer modes accept multiple answers again
- added question and intermission timeout consts
- Trivia property names are more specific
2015-04-12 17:40:12 -03:00
Morfent
89ccdd5203 Trivia plugin: fix rank sorting, levenshtein answers 2015-04-07 07:47:59 -03:00
Morfent
9c7cae1aea Trivia plugin: score ladder and ranking, bug fixes
- /trivia rank now shows the user's rank for each of the three score
  types
- Add /trivia ladder
- Fix crash in timer mode scoring
- Fix /trivia submit excluding all but the first answer in certain cases
- Fix /trivia accept and reject
- Consistent object notation
2015-04-02 10:10:25 -03:00
Morfent
36817bedf9 Trivia plugin: fix crash in timer mode scoring
Theoretically it's possible to get over 5 points from answering if the
answer was sent before the current question's askedAt was reassigned.
2015-03-30 23:04:14 -03:00
Morfent
b5455d1bf5 Trivia plugin: fix crash in /trivia kick 2015-03-30 04:43:01 -03:00
Quinton Lee
8e0a50dc97 Trivia plugin: fix crash in /trivia kick 2015-03-30 01:25:45 -05:00
Morfent
d166d06fb2 Trivia plugin: fix crash in /trivia accept and /trivia reject 2015-03-24 05:44:06 -03:00
Juanma Serrano
b525928731 Fix crash in Trivia plugin
Target is being splitted and saved on var indices, but target itself is still a string.
2015-03-23 17:33:47 +01:00
Morfent
cf25f0afa9 Trivia plugin: scoring bug fixes 2015-03-20 03:04:14 -03:00
Morfent
57c106862d Trivia plugin: fix crash in /trivia join 2015-03-19 21:15:58 -03:00
Morfent
252a56e3a6 Trivia plugin: optimize, question statistics...
- participants are now stored in a map
- part of the score calculations are now handled on answer, rather than
  all of them being done when the answering period ends
- the responders object has been removed in favour of storing more
  information in participants
- /trivia qs with no argument returns question statistics
- some slight optimizations in the question commands
- /trivia help is now less verbose
- the code is now much more legible
2015-03-14 17:24:38 -03:00
Kris Johnson
cc6fb8e8d7 Add aliases
``/trivia ranking`` is pretty much like /ranking on the ladder
`/trivia create`` is just like when using ``/tour create``
2015-03-06 15:55:04 -07:00
Morfent
ab0a5fdae2 Trivia plugin: actually fix /trivia add permissions 2015-01-28 17:34:46 -04:00
Morfent
c4b2c6fad4 Trivia plugin: fix /trivia add permissions 2015-01-26 01:41:50 -04:00
Morfent
7c305c01d6 Trivia plugin: preserve state over /hotpatch chat
Export triviaData, writeTriviaData, and trivia to a cache in the Trivia and
Question Workshop room objects, if they exist, and if they have already been
exported (i.e. /hotpatch chat reloaded the plugin), reassign their cached
values so games are no longer broken.
2015-01-20 20:53:36 -04:00
Morfent
179debc922 Trivia plugin: instantiate Trivia for each game
...over using an unreliable singleton to handle them.

Export triviaData to CommandParser imstead of the trivia room when the
first Trivia instance is created.
2015-01-16 12:15:11 -04:00
Morfent
94458778da Trivia plugin: use command namespacing, fix typos
...which would've ruined participants' leaderboard rankings, stop
binding the Trivia object's context to timeouts now that they're no
longer needed, make question database commands exclusive to Question
Workshop
2015-01-07 03:26:38 -04:00
Morfent
eda1783a9c Trivia plugin: export triviaData 2015-01-05 17:02:43 -04:00
Morfent
2e6022220b Trivia plugin: fix endless games...
Fix number and timer modes' question timeouts looping until no questions
are left, refactor Trivia object to only make methods the commands use
public, optimize /triviaaccept and /triviareject
2015-01-04 20:21:01 -04:00
Morfent
4986a81832 Trivia plugin: refactor game commands, bug fixes
Stop the Q/A loop from clearing timeouts constantly so games can be
ended in case it still loops endlessly, refactor game commands and
config vars, minor bug fixes in /triviasubmit and /triviastatus
2014-12-14 23:26:02 -04:00
Morfent
2ea45413b9 Trivia plugin: fix crash in timer mode (again)
This whole time I thought negative values were falsey. At least I caught it before it could crash anything again.
Also fix /triviarank picking up the wrong alt's rank
2014-12-13 22:44:20 -04:00
Morfent
e4516d17c0 Trivia plugin: move curA, responders, and phase to Trivia properties 2014-12-12 23:00:24 -04:00
Morfent
de576e9b12 Trivia plugin: fix crash in Trivia.timeAnswers() 2014-12-08 02:36:33 -04:00
Morfent
e7ec00f5e2 Trivia plugin: modify timer mode, refactor /ta
Timer mode now gives points to all who answer within the time limit
instead of the first, and /ta works more straightforwardly. sleep should
no longer cause the Q/A loop to ignore any commands until it runs out of
questions.
2014-12-06 00:20:23 -04:00
Morfent
53433b2e20 Trivia plugin: correct scores with the wrong type
Fix scores broken from commit 6d7a3cf333,
remove unused curQ variable, remove unused parameters in the
commands, and lower the rank required to edit questions to %.
2014-11-25 03:35:47 -04:00
Morfent
698fd694fc Trivia plugin: fix crash in number mode
Also fix styling of the tables in /triviaqs and /triviareview
2014-11-22 17:22:43 -04:00
Morfent
6d7a3cf333 Trivia plugin: revert refactor, keep working updates 2014-11-17 11:19:33 -04:00
Morfent
46ffa07212 Trivia plugin: refactor Trivia object and values
Fix bug in the question/answer loop that would assign undefined to
either curQ, curA, or phase, preventing anyone from answering any
questions until this.curQs was empty, by changing all of the game
variables from global variables to Trivia properties. Created a
constructor for Trivia so its methods could be kept in its prototype
object to reduce property lookup times and later to allow me to refactor
parts of the commands that deal with these properties as prototype
methods.

Fix room.addRaw not updating chat.
2014-11-13 10:15:54 -04:00
Morfent
d9f26b4c07 Voices can start/end trivia games 2014-10-27 19:09:59 -03:00
Morfent
1b6127c7d9 Fix /triviaend and /triviakick 2014-10-21 20:53:53 -03:00
Morfent
3b0a651978 Fix crash in /triviaplayers 2014-10-17 15:19:12 -03:00
Morfent
2a438048ce Add chat plugin config directory 2014-10-12 23:27:38 -03:00
Morfent
56fc5ca0e6 Update trivia plugin 2014-10-12 18:18:57 -03:00
Morfent
eea20673ff Fix possible crash in /triviaanswer 2014-10-09 17:37:01 -03:00
Morfent
cd6ce3d0a4 Trivia plugin 2014-10-09 08:54:13 -03:00