Before, the settings parser would automatically reset the ratelimit
times to the default if you set them to zero. You could get around
this by setting the ratelimits to -1, but then the parser would
immediately set them to zero and write to disk. On next launch,
the parser would read the zeros and then reset the values to
default, so you would have to modify your ratelimits every
launch.
A new setting has been added to change the address and port that the
RTMP server listens on. `RtmpListenAddress` in the settings json and
`-r` on the command line. Both options use the same format:
`host:port`.
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.
The -a flag has been added to allow specifying a new admin password on
the command line. This password will only be used for the current
session and will not be written to the configuration file. If the
password contains spaces, wrap it in quotes on the command line. The
quotes should be omitted with the /auth command.
Eg, starting the server with:
./MovieNight -a "the admin password"
the auth command in chat would be:
/auth the admin password
- Move mutex into Settings struct
- Replace sync.Mutex with a sync.RWMutex
- Move adding approved emotes into a Settings method
- Save settings after adding emotes
- Wrap saving in a lock
This should fix#65, although it may be expanded in the future.
Default settings for limits can be changed or disabled in the settings.
Default values:
- Chat: 1 second
- Duplicate chat: 30 seconds
- /nick: 5 minutes
- /auth: 5 seconds
- /color: 1 minute
Creation of the chat Client object has been moved from ChatRoom.Join()
to NewClient(). This function also handles setting the initial name.
Added this to the settings so it can be configured at runtime. If set
to true, a Cache-Control header will be sent with the wasm file as well
as the index html.
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.
- When the access mode changes, print the new mode (and pin, if
applicable) to the server console.
- Don't return an HTTP error when getting a session fails, just make a
new session.
- Save pins to the settings
So far only PIN and Open modes are implemented. It uses a session
cookie to store the validity of the pin/password.
The "Enter pin" page has some unreadable messages on it right now, but
it kinda works.
Stream statistics will now print when enabled in settings.json. There is messages in, messages out,
and total time running. The main function was changed so the server setups for the main and rtmp
are in separate functions, and both are started with their own goroutine. OS Interrupt catching was added,
and if stream stats is true, the stats will be printed.
Parse the X-Forwarded-For header if it exists in the connection. This
will allow bans to work if the server is sitting behind an Nginx
reverse proxy (that has been configured to add the header).
Also added a safe-guard to disallow bans for localhost so you cannot
accidentally ban everybody from connecting if the server is behind a
reverse proxy.
This should resolve#49
Added a limit to how long the title can be when set from the /playing
command. The default value is 50 if it is not in the settings file or
if the value in the settings is below zero.
Resolves#43
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