Commit Graph

73 Commits

Author SHA1 Message Date
Zorglube afc9f19e36 Count the streams using the 'http' sessions instead of the 'IP'. 2021-03-16 22:48:18 +01:00
Zorchenhimer f76d184173 Don't hardcode emote size
Replaced the hardcoded height attribute in the emote img tags with a
class attribute.  This allows the emotes to be resized with the change
of a CSS value instead of recompiling the server.

Resolves #150
2021-01-16 15:36:44 -05:00
Zorglube 0fa99f7ab4 Templated the chat messages. 2020-11-11 20:51:29 +01:00
Zorglube a0b3e856c2 revert common/chatdata.go 2020-11-02 12:45:15 +01:00
Bertrand Moreau 2d1cd12fc0 Chat template 2020-10-26 14:27:14 +01:00
Zorglube 6b7e6cd083 Fixed the Emotes feature 2020-10-20 20:57:05 +02:00
Zorglube 7c33ba91d1 Factorize runPath() 2020-10-20 00:45:18 +02:00
Bertrand Moreau 5fe3036e03 Very little factorize around "func runPath()" 2020-10-20 00:45:18 +02:00
Bertrand Moreau b71db84b69 Run from anywhere
Get the runpath at runtime, in order to run MovieNight from whatever
position into the filesystem.
2020-10-20 00:45:18 +02:00
Alex Dunn 086d22a941 colors: remove colors that aren't AA accessible
per https://webaim.org/resources/contrastchecker/
2020-06-03 22:30:45 -07:00
Alex Dunn c8fba1dc5b colors: each on one line 2020-06-03 22:27:15 -07:00
Zorchenhimer fab56e39ea Rework emote parsing to properly handle wrapped emotes
Reworked the emote parsing to properly handle "wrapped" emotes.  A
wrapped emote is one that is wrapped in colons or square braces (eg,
:Kappa: or [Kappa]).  This allows emotes to be input without a space
between them, like is required with non-wrapped emotes.

A new configuration setting has been added to only allow parsing of
wrapped emotes: "WrappedEmotesOnly".  This defaults to False as to not
break current configurations.

The emote autocompletion will only insert non-wrapped emotes.  Setting
"WrappedEmotesOnly" configuration value to True will not change this.

Lastly, made the bare-word emote parsing a bit cleaner by removing a for
loop in favor of a map lookup with a check.  This should in theory be
more efficient.

This change is in response to #111.  The issue should not be considered
resolved until the autocompletion handles the new setting correctly.
2020-04-19 12:26:27 -04:00
Zorchenhimer 8fc3f86135 Add an emote list
It's ugly, but it get's the job done.  This list will need to be
improved a lot (ie, make it searchable and maybe even clickable
emotes?).  This is for #99, but should not be considered fixed yet.
2019-11-29 12:48:17 -05:00
Zorchenhimer a85c618e4a Use better name error; Tweak name requirements
- "Invalid name" was replaced with a description of a valid name.
  Fixes #100
- Tweaked the valid name regex to require at least one number or letter.
2019-11-28 20:06:15 -05:00
Zorchenhimer 6347065dd4 Fix duplicating emotes with /reloademotes
Don't reload emotes directly into the global common.Emotes variable.
Instead, load them into a new variable and write that to common.Emotes
after the search for new emotes completes.  Emotes should no longer
duplicate for each run of `/reloademotes`.

Also tweaked `/addemotes` to automatically reload emotes if nothing went
wrong downloading a new set.
2019-09-22 16:51:13 -04:00
Zorchenhimer a941e2815e Fix accidental removal of /pin and /changeaccess
These were accidentally removed from the command name list.
2019-09-22 16:15:59 -04:00
Zorchenhimer 7ac34c7d05 Fix name highlighting breaking emotes
Fix name highlighting when emotes are involved.  When the emotes were
moved to subfolders the channel name was put into the URL of the emote
image.  If a user with that name joined the chat, all of the emotes in
that folder highlighted the name in the URL, breaking the <img> tag.

This change removes the regex used to identify and replace the user's
name and instead works on whole words delimited by spaces.
2019-09-22 15:42:48 -04:00
Zorchenhimer a73375f152 Fix emotes
This reworks how emotes are cached in relation to their physical
location on disk.  Functionally, they should be the same from the user
perspective but it sets up some stuff that will make it easier to add
emotes from various sources.
2019-06-18 22:13:53 -04:00
joeyak 7962fad02e commiting so zorch can do my work 2019-06-01 19:41:28 -04:00
joeyak c3f2c20e4e Add rand seed so the colors aren't the same 2019-04-14 21:02:44 -04:00
joeyak 7b5f77a14a Get rid of dependency on go-colorful
closes #84
2019-04-14 01:46:24 -04:00
Zorchenhimer 607e61234c Add some more stats
Added a few more stats to keep track of:
- Max users in chat
- Stream start

Also added a `/stats` command to list the user count (current and max),
as well as uptime (sever and stream, separately).

Resolves #85
2019-04-14 00:25:49 -04:00
Zorchenhimer 83477dc0eb Start abstracting template stuff
This is for #32.

This adds a starting framework for loading, caching, and executing
templates on the server and the client.  Currently only the server uses
this functionality.
2019-04-13 17:29:30 -04:00
joeyak ad2579d59a Adding some hardening to user joining
Client sends the server a object to join instead of a message
server can send a message to notify the user

closes #57
2019-04-13 13:12:08 -04:00
Zorchenhimer 81e647c1c8 Handle command errors differently than responses
Make them red.
2019-04-11 22:01:10 -04:00
Zorchenhimer 5508dc3f1c Return errors from commands
Change the function signature for commands to return a string as well as
an error.  Currently, errors are handled no differently than normal
response messages.

Also removed the redundant `/setpin` command.
2019-04-11 21:10:04 -04:00
Zorchenhimer 34d8fbf20c Merge branch 'master' into room-access-restrictions
# Conflicts:
#	main.go
2019-03-30 17:45:39 -04:00
Zorchenhimer 2acf382f1f Add some tests for emote parsing 2019-03-30 17:19:14 -04:00
joeyak e5f1598cd0 Add color dropdown
issue #69
2019-03-30 17:01:44 -04:00
Zorchenhimer 4e35418a79 Merge branch 'master' into room-access-restrictions
# Conflicts:
#	common/chatcommands.go
#	main.go
#	settings.go
2019-03-30 16:04:06 -04:00
Zorchenhimer 0ff872065f Fix trimming characters on non-emote words
Don't trim anything from non-emote words when parsing emotes.
2019-03-30 15:41:33 -04:00
joeyak ca72dc28c0 Add autocomplete for emotes
closes #9
2019-03-30 15:23:54 -04:00
joeyak 10092e1dd5 Change wrappers to div so client can add to beginning and end of message
issue #66
2019-03-28 20:25:46 -04:00
joeyak 8e4ac4d600 Add color cookies
closes #6
2019-03-28 20:01:48 -04:00
Zorchenhimer fb2c25dc99 Add the /addemotes command
This command launches a goroutine that does the actual downloading of
the emotes so the client doesn't hang until the process is finished.

subscribers.json needs to be manually downloaded and added next to the
main executable for now.  Eventually, it will download and cache this
file (for 24 hours, at a minimum).

Issue #10 should not be considered finished yet.  This needs to be
tested a bit more with multiple channels.  Ideally, some that exist and
some that don't to verify that it fails gracefully (ie, adds the emotes
it was able to download).
2019-03-28 16:50:24 -04:00
Zorchenhimer 6f865b7a53 Start adding support to download twitch emotes
The code has been transferred over from the utility, and should work,
but it hasn't been tested nor has it been linked to the command.
2019-03-28 16:22:08 -04:00
Zorchenhimer d12434502e Put each CN- command constant on it's own line
This will help with merges that add/remove commands.
2019-03-28 16:21:23 -04:00
Zorchenhimer f5ea701127 Add colon to the emote trim cutset
This enables parsing emotes in the format :emote: as defined in #9.
This does not add auto-complete, just brings emote parsing up to date.
2019-03-26 12:27:18 -04:00
Zorchenhimer 857974aef3 Merge branch 'master' into room-access-restrictions
# Conflicts:
#	main.go
#	settings.go
2019-03-26 12:06:25 -04:00
Zorchenhimer 8e27ce9332 Add /iplist to admin commands
Lists all clients' UUID's, names, and IPs to console.

# Conflicts:
#	chatcommands.go
#	common/chatcommands.go
2019-03-26 11:58:46 -04:00
joeyak f60bd33011 Remove inits since it is startup code 2019-03-24 23:54:24 -04:00
joeyak 86207ecd48 Added spoilers in chat
If a user clicks the spoiler, it will change color and the background will revert.
closes #62
2019-03-24 23:43:30 -04:00
Zorchenhimer fdbf39f00c Add some logging
Functions added:
- LogErrorf()
- LogErrorln()
- LogChatf()
- LogChatln()
- LogInfof()
- LogInfoln()
- LogDebugf()
- LogDebugln()
- LogDevf()
- LogDevln()

New settings configure the logging: LogLevel and LogFile.  LogLevel can
be set to one of: error, chat, info, or debug and will default to
error.  LogFile is an optional file to write to.  Providing a file will
not prevent output in the console.

LogDevf() and LogDevln() only compile when the "dev" flag passed to
build.  This will cause Travis-CI to fail the build if it finds any
calls to either function.
2019-03-24 18:58:59 -04:00
joeyak cd34480bba Change auth level checking to be on command level
The server sends new auth level to user when modded
closes #60
2019-03-24 17:27:04 -04:00
Zorchenhimer 2f252d5ae8 Strip @ prefix on names in commands
Names can be passed to commands with @ prefixed to them.

When forcing a color change on another user the @ explicitly defines
the name, instead of simply being stripped off.  This will allow the
a user named "red" to have their color changed: `/color @red blue`

A bunch of the color command code has changed with this to make things
less ambiguous and to add some other checks.  `/color red #FF0000` and
`/color @red red` will change the color of the user "red" to the color
red while `/color red red`will return with an error.  Note that the
color an name arguments can be in any order.

Resolves #64
2019-03-24 15:16:01 -04:00
Zorchenhimer f5f95efbcd Merge in some fixes from master 2019-03-23 18:14:57 -04:00
Zorchenhimer 37cf2f7811 Fix auto-scrolling with emotes
All emotes are set to have a height of 28px.  This fixes the
auto-scroll on message when the message has emotes, but it also forces
all emotes to be 28px high.
2019-03-23 18:13:55 -04:00
Zorchenhimer 7448876299 Merge branch 'master' into room-access-restrictions
# Conflicts:
#	chatcommands.go
#	common/chatcommands.go
#	connection.go
#	static/css/site.css
#	static/main.html
2019-03-23 17:03:28 -04:00
Zorchenhimer 88365b6df5 Add /iplist to admin commands
Lists all clients' UUID's, names, and IPs to console.
2019-03-23 16:53:36 -04:00
joeyak 4864669df6 Add color checking and removed autoreconnect
closes issue #44
2019-03-23 15:37:48 -04:00