Commit Graph

27 Commits

Author SHA1 Message Date
joeyak
24b5152c38 Moving suggestion code to a separate file in prep for issue #9 2019-03-25 23:32:44 -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
b4ae3fa9f8 Fix non-chat empty messages
Only refuse to send empty message data to the server if it is chat
data.  All other data types can be sent with an empty message (eg,
ping).
2019-03-23 18:10:32 -04:00
Zorchenhimer
8e39585968 Prevent some zero length stuff
Don't send zero length messages to the server, and ignore the /me
command without any arguments.
2019-03-23 15:16:02 -04:00
joeyak
e770c0cb62 Remove vscode setup section and rename main_wasm.go back to main.go 2019-03-21 21:34:16 -04:00
joeyak
355f09bd48 Refactoring of ChatData
The processing of ChatData was changed so ChatData has a DataInterface object, which will be converted to a
ChatDataJSON that will have the DataInterface field converted to a json.RawMessage field. This change allows
greater customizability in the chat messages, since the Data field can still be read and modified.
2019-03-21 08:47:40 -04:00
joeyak
1cfa040f7b Added color names as possible arguements for /color
Did some linting fixing too.
Closes #45
2019-03-19 22:56:01 -04:00
Zorchenhimer
1c6c23da3e Add /nick command
Using this command will change the current user's nickname in chat.
It has an alias of /name.

An admin can force a name change by supplying the current name and a new
name.  If a name has been changed by an admin, that user can no longer
change their name (similar to forced color change).

Resolves #42
2019-03-19 17:13:20 -04:00
joeyak
7ce4c04942 Fixed autocomplete and positioning of suggestions
closes #41
2019-03-19 15:15:11 -04:00
Zorchenhimer
0b05a7aea6 Add the /purge command
This is a moderator command that clears chat for everybody.

Resolves #5
2019-03-17 22:30:00 -04:00
Zorchenhimer
01219fffa1 Fix help popup
Properly call the open() function in the web assembly to open a new
popup.
2019-03-16 16:40:39 -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
30d480d878 Change heartbeat to be send only when in chat 2019-03-16 15:47:48 -04:00
joeyak
b38542333a Add a debug message to print values 2019-03-16 14:59:30 -04:00
joeyak
f9fa44ea77 Add enter for keys to autocomplete name 2019-03-16 14:27:13 -04:00
Zorchenhimer
80be38128f Wasm client pings the server every second
This prevents disconnects when the server is behind Nignx.  Resolves
#35.
2019-03-16 14:12:25 -04:00
joeyak
ad4186a279 Added completion on tab for autocompleting name
closes  #7
2019-03-16 11:56:43 -04:00
joeyak
57e1f3863a Added popup box and arrow controls
When typing @ a div will show up with all the chat names that match.
When up or down arrow keys are pressed, the highlight changes.
Tab handling is currently incomplete but the event is prevented.

issue #7
2019-03-16 11:40:39 -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
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
60dd98a1e7 Add infrastructure for the client to send formatted data to the server 2019-03-14 15:21:53 -04:00
Zorchenhimer
653ff6fc9c Some performance tweaks to the wasm code
Removed two fmt.Sprintf() calls and a fmt.Printf() call.  The Printf()
was for debugging and isn't needed anymore.  Sprintf() apparently
isn't all that performant.
2019-03-14 10:12:21 -04:00
joeyak
2ef3684c14 Some linting fixes for the common package 2019-03-13 21:24:14 -04:00
joeyak
d83d5225c8 Remove the log function which is no longer needed 2019-03-13 15:28:21 -04:00
Zorchenhimer
bdd4e71261 Flesh out the JSON stuff a bit more
Implement some commands in the wasm client code:
  - /playing (setting and clearing)
  - /refreshplayer
Commands not yet implemented:
  - /purge (command doesn't exist yet on server)
  - /help (doesn't open window)
2019-03-13 13:42:38 -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
joeyak
5544ac817f Converted to code to using webassembly 2019-03-11 23:15:42 -04:00