Commit Graph

16 Commits

Author SHA1 Message Date
Zorchenhimer 7de20f6145 Allow unmodding yourself if you give your name
Don't deny unmodding yourself if you also provide your name to the
/unmod command.
2019-03-16 16:49:02 -04:00
Zorchenhimer d0cd90e7af Properly implement the help popup
Move the help html to a template and populate the lists dynamically.
This also splits out the base HTML stuff (eg, the <html> and <body>
tags) to a base template file.
2019-03-16 16:15:55 -04:00
joeyak a717c6ef38 Converting from conn.WriteMessage to conn.WriteJson
This takes away some of the work on the developers side to worry about parsing the object as a json string.
Backend work for issue #7
2019-03-15 17:28:29 -04:00
Zorchenhimer 28d43a726a Add Mod notice messages
These messages are only sent to mods and admins for certain events:
- User gains mod/admin privileges
- User attempts to gain mod/admin privileges unsuccessfully
- Mod/Admin uses the /sv command
- Mod/Admin uses the /playing command
- Mod unmods themselves
- Mod/Admin mods/unmods a user
- Mod/Admin uses the /reloademotes command
- Mod/Admin uses the /reloadplayer command

A separate message queue is used for these messages, and they are only
sent to clients that are either a mod or an admin.  They are sent
with the same call to ChatRoom.Broadcast(), but after all the normal
messages are sent.

Resolves #3
2019-03-15 16:03:31 -04:00
joeyak 678ccab95c Add some backend infrastructure
The server can now send the client objects with data for the client to process.
issue #7
2019-03-15 02:19:16 -04:00
joeyak bb0c3ea736 Fixed printing the combined commands 2019-03-14 15:09:55 -04:00
joeyak fc126d599e Fix broken multi alias commands
fixes #25
2019-03-14 00:21:41 -04:00
joeyak 2ef3684c14 Some linting fixes for the common package 2019-03-13 21:24:14 -04:00
Zorchenhimer 1cd490b04a Add single-use mod passwords
Single-use moderator passwords can only be generated by an admin with
the /modpass command.  To redeem the password and gain moderator
privileges, a user just needs to call /auth with the password.

The passwords are generated using the same function as the admin
password.  Additionally, generating passwords now uses crypto/rand
instead of math/rand.

Resolves #15
2019-03-13 16:51:07 -04:00
Zorchenhimer 568344a794 Fix /playing when one argument (title) is provided
If /playing was called with a single word (one-word title), it would
clear the title instead of setting the title.
2019-03-13 13:34:26 -04:00
Zorchenhimer 9c80269943 Start convert to JSON data b/t client and server
Chat and events should work.  Commands do not work yet.  Everything
also needs to be tested and cleaned up a bunch more.
2019-03-13 01:09:24 -04:00
Zorchenhimer 86ba07b4f7 Write the /help command
This still needs a bunch of work, but this should be OK until the UI is
rewritten.

The command injects a <script> tag to open up a new window.  Mod and
admin commands are only shown to mods and admins (no authentication
happens for this).

Resolves #8 for now.
2019-03-11 12:06:45 -04:00
Zorchenhimer 02400b667c Fix crash when trying to mod nobody
Fixes issue #12
2019-03-10 21:35:24 -04:00
Zorchenhimer 5b75615b90 Fixup the random color code
Don't allow the user to randomize their color if it was previously
changed by an mod.  And don't change to a random color if an incorrect
argument was given for the command.
2019-03-10 21:26:37 -04:00
joeyak 61643f579a Fixed bug where any mod could not change color 2019-03-10 20:47:59 -04:00
Zorchenhimer 3276295421 Initial commit
So far things work.  Needs lots of improvements.
2019-03-10 11:42:12 -04:00