Commit Graph

56 Commits

Author SHA1 Message Date
tt2468
f37edbd71c EventHandler: Include required event intent in emit 2021-08-30 01:39:46 -07:00
tt2468
03e32c8b5e Base: Major protocol refactor
As discussed in the #development channel in discord
- Switch from using message types to integer op codes
- Consolidate op-specific keys into `d` sub-object
- Shorten low-level payload keys from `messageType` to `op`, add `d`

Other changes:
- The WebSocketCloseCode enum has been refactored. It's best to just
treat it like it's new
- Some performance benefits came along the way. Nothing gamechanging,
but notable
- Various bug fixes discovered while refactoring
2021-08-28 05:02:24 -07:00
tt2468
ade9653ed6 Base: Only include required util namespaces 2021-08-27 04:34:06 -07:00
tt2468
4d271da541 Base: Code cleanup and add some requests 2021-07-22 03:24:53 -07:00
tt2468
0a02015f7d Base: General code cleanup 2021-06-22 15:51:52 -07:00
tt2468
52204a9eec WebSocketServer: Log connects and disconnects 2021-06-14 20:50:50 -07:00
tt2468
fb699b0414 Base: Fix missing arguments for tray notifications 2021-06-13 04:16:22 -07:00
tt2468
c9619ce215 Base: Add system tray notifications
Final "UI" part of the plugin to be completed. I'm annoyed at how
many includes are required in order to implement this feature. It
breaks quite a bit of the modularity of the plugin because suddenly
everything has to include obs libraries (for translations)
2021-06-13 03:58:15 -07:00
tt2468
bbc504ce72 WebSocketServer: Remove unnecessary signals 2021-06-13 03:24:22 -07:00
tt2468
d3c7f4b3fd WebSocketProtocol: Remove availableRequests from Hello 2021-06-05 23:54:11 -07:00
tt2468
45d62e5ce0 EventHandler: General, Config, Scenes, Inputs 2021-05-14 01:13:27 -07:00
tt2468
f0d68f3eec WebSocketProtocol: Remove availableEvents from Hello
Not reasonably possible with the current structure of the `EventHandler`
2021-05-13 17:48:10 -07:00
tt2468
4d6901c075 WebSocketServer: Add RPC version support to events 2021-05-10 22:55:48 -07:00
tt2468
902c9dfdc5 WebSocketServer: Don't try to send events if the server is not listening 2021-05-10 18:26:28 -07:00
tt2468
ee751edf54 SettingsDialog: Mild refactor and add Connect Info dialog
Among lots of stuff:

- Generate a random password on first load

- Add `ConnectInfo` dialog including QR code display

- Add `Generate Password` button to generate a new random
password

- Delete `Copy Password to Clipboard` button

- Delete `GetConnectString` or whatever from WebSocketServer
(reimplemented the functionality directly into ConnectInfo)

- Added `GeneratePassword()` to Utils

Todo: Show warning when users specify their own passwords
2021-05-08 04:29:03 -07:00
tt2468
2aba810ce1 RequestHandler: Finish checks system and first request 2021-05-03 16:55:30 -07:00
tt2468
807a1501b7 base: Refactor request stuff and finish more logic 2021-05-03 13:31:22 -07:00
tt2468
36af7f6f58 base: Lots of stuff, including RequestHandler progress 2021-05-02 19:48:44 -07:00
tt2468
04f7b33755 SettingsDialog: Add Identified column to session table 2021-04-30 11:24:09 -07:00
tt2468
df8ef87dc5 WebSocketServer: Add parts for availableRequests/availableEvents 2021-04-30 10:13:42 -07:00
tt2468
ffaac93ba6 WebSocketSession: Add mutex for operations which change session parameters 2021-04-30 08:56:08 -07:00
tt2468
4be9b995fb base: Use shared_ptr instead of explicit ref counts
Took a night of sleep but I realized how I could solve the
concurrency issues in a good way. Uses shared_ptr, where the map
always accounts for one reference to a session.
2021-04-30 08:45:34 -07:00
tt2468
32758198ab WebSocketSession: Add refcount
Working towards fixing concurrency issues. Todo:

- Wait for refcount to be 0 before deleting object
- Use .at() instead of operator[] to prevent recreating deleted
sessions
- There was a third thing. Dont remember what it was
2021-04-29 22:11:24 -07:00
tt2468
e151a9a8db base: Use Unix EOL 2021-04-29 21:13:34 -07:00
tt2468
09bfea0628 WebSocketProtocol: Add Identify logic (not tested well) 2021-04-29 20:37:28 -07:00
tt2468
f57d03e4bb WebSocketProtocol: Rename Process to ProcessMessage 2021-04-29 19:14:23 -07:00
tt2468
e0183d2f85 WebSocketServer: This *should* complete the functionality of WebSocketServer. 2021-04-29 19:03:32 -07:00
tt2468
ad8b13606f Base: Add WebSocketProtocol
Will be used to handle incoming websocket messages. Initially I was
going to handle messages within WebSocketServer, but the file is
starting to get very large and so it's only fair to split it up.
2021-04-29 10:52:29 -07:00
tt2468
44c5683ec4 WebSocketServer: Fix some bugs 2021-04-29 10:11:19 -07:00
tt2468
7c80a5d050 WebSocketServer: Add incoming and outgoing message logging and incrementing 2021-04-29 09:56:21 -07:00
tt2468
190d42fdf2 WebSocketServer: Initial onMessage handling 2021-04-29 09:42:22 -07:00
tt2468
724a63f1c8 WebSocketServer: Catch and ignore errors in Hello sending. 2021-04-29 09:14:35 -07:00
tt2468
561ba907d4 WebSocketServer: Ignore send errors 2021-04-29 09:09:20 -07:00
tt2468
ba710efe09 WebSocketServer: Include password in changed GetConnectString()
New format is `obswebsocket|ip:port|password`
2021-04-29 09:06:12 -07:00
tt2468
4028d42931 WebSocketServer: Only encode event once and when it's required 2021-04-29 08:52:40 -07:00
tt2468
d8e84321b1 WebSocketServer: Clarify logging 2021-04-29 08:34:50 -07:00
tt2468
1cee256cb3 WebSocketServer: Store debug setting 2021-04-29 08:24:27 -07:00
tt2468
fa259b43a9 WebSocketServer: Finish BroadcastEvent() 2021-04-28 22:52:19 -07:00
tt2468
b43fc4fec6 WebSocketServer: Make QObject again 2021-04-28 22:13:02 -07:00
tt2468
0370b5882d WebSocketServer: Finish GetConnectUrl() 2021-04-28 22:07:52 -07:00
tt2468
d1d5dd74ea WebSocketServer: Send hello in onOpen 2021-04-28 22:03:23 -07:00
tt2468
c73f6608b9 Config: Add command line parameters to override port and password 2021-04-28 15:59:29 -07:00
tt2468
1dcf6460f1 Utils: Add Platform helpers 2021-04-28 14:24:05 -07:00
tt2468
af46271b27 WebSocketServer: Add some onOpen and onClose logic, make websocketpp logging mirror debug setting 2021-04-28 13:26:22 -07:00
tt2468
0be9174bb1 WebSocketServer: Don't call stop() on the server
For some reason I thought I was supposed to call it /shrug
2021-04-28 12:36:15 -07:00
tt2468
af7a539e84 Only stop server if its running 2021-04-28 12:20:56 -07:00
tt2468
a70e18a2bf WebSocketServer: Add some error handling 2021-04-28 12:09:12 -07:00
tt2468
b53b40d9c8 base: Improve logging 2021-04-28 11:43:39 -07:00
tt2468
e2d837958f WebSocketServer: Fix shutdown order 2021-04-28 11:40:07 -07:00
tt2468
5348c80aa8 WebSocketServer: Add GetWebSocketSessions() logic 2021-04-28 11:28:07 -07:00