Commit Graph

70 Commits

Author SHA1 Message Date
Fabian Dill
dac3c0ca29 Make clients identify themselves against server
prep for potential later async auth system. Wanted to get this into the 2.3 client update.
2020-06-04 21:19:57 +02:00
Fabian Dill
59a26e071c clean up 2020-06-04 21:12:05 +02:00
Fabian Dill
38cbcc662f WebUI (#100)
* Object-Oriented base changes for web-ui prep

* remove debug raise

* optimize broadcast to serialize once

* Implement WebUI socket, static assets, and classes

- Still need to wrap logging functions and send output to UI
- UI commands are successfully being sent to the server

* GUI operational. Wrap logging functions, implement server address selection on GUI, automatically launch web browser when client websocket is served

* Update MultiServer status when a user disconnects / reconnects

* Implement colored item and hint checks, improve GUI readability

* Fix improper formatting on received items

* Update SNES connection status on disconnect / reconnect. Implement itemFound, prevent accidentally printing JS objects

* Minor text change for itemFound

* Fixed a very wrong comment

* Fixed client commands not working, fixed un-helpful error messages appearing in GUI

* Fix a bug causing a failure to connect to a multiworld server if a previously existing cached address was present and the client was loaded without an address passed in

* Convert WebUI to React /w Redux. WebSocket communications not yet operational.

* WebUI fully converted to React / Redux.

- Websocket communication operational
- Added a button to connect to the multiserver which appears only when a SNES is connected and a server connection is not active

* Restore some features lost in WebUI

- Restore (found) notification on hints if the item has already been obtained
- Restore (x/y) indicator on received items, which indicates the number of items the client is waiting to receive from the client in a queue

* Fix a grammatical UI big causing player names to show only an apostrophe when possessive

* Add support for multiple SNES Devices, and switching between them

* freeze support for client

* make sure flask works when frozen

* UI Improvements

- Hint messages now actually show a found status via ✔ and  emoji
- Active player name is always a different color than other players (orange for now)
- Add a toggle to show only entries relevant to the active player
- Added a WidgetArea
- Added a notes widget

* Received items now marked as relevant

* Include production build for deployment

* Notes now survive a browser close. Minimum width applied to monitor to prevent CSS issues.

* include webUi folder in setup.py

* Bugfixes for Monitor

- Fix a bug causing the monitor window to grow beyond it's intended content limit
- Reduced monitor content limit to 200 items
- Ensured each monitor entry has a unique key

* Prevent eslint from yelling at me about stupid things

* Add button to collapse sidebar, press enter on empty server input to disconnect on purpose

* WebUI is now aware of client disconnect, message log limit increased to 350, fix !missing output

* Update WebUI to v2.2.1

- Added color to WebUI for entrance-span
- Make !missing show total count at bottom of list to match /missing behavior

* Fix a bug causing clients version <= 2.2.0 to crash when anyone asks for a hint

- Also fix a bug in the WebUI causing the entrance location to always show as "somewhere"

* Update WebUI color palette (this cost me $50)

* allow text console input alongside web-ui

* remove Flask
a bit overkill for what we're doing

* remove jinja2

* Update WebUI to work with new hosting mechanism

* with flask gone, we no longer need subprocess shenanigans

* If multiple web ui clients try to run, at least present a working console

* Update MultiClient and WebUI to handle multiple clients simultaneously.

- The port on which the websocket for the WebUI is hosted is not chosen randomly from 5000 - 5999. This port is passed to the browser so it knows which MultiClient to connect to

- Removed failure condition if a web server is already running, as there is no need to run more than one web server on a single system. If an exception is thrown while attempting to launch a web server, a check is made for the port being unavailable. If the port is unavailable, it probably means the user is launching a second MultiClient. A web browser is then opened with a connection to the correct webui_socket_port.

- Add a /web command to the MultiClient to repoen the appropriate browser window and get params in case a user accidentally closes the tab

* Use proper name for WebUI

* move webui into /data with other data files

* make web ui optional
This is mostly for laptop users wanting to preserve some battery, should not be needed outside of that.

* fix direct server start

* re-add connection timer

* fix indentation

Co-authored-by: Chris <chris@legendserver.info>
2020-06-03 21:29:43 +02:00
CaitSith2
e4c68fde60 Don't clear locally visited locations if rom is same as previous on /snes after /snes_close (#98) 2020-06-02 16:38:23 +02:00
Fabian Dill
117624d611 fix /snes <snes_interface> if interface contains spaces (which it shouldn't, but meh) 2020-05-31 14:55:37 +02:00
Fabian Dill
0cb80eadf1 add more room info 2020-05-30 11:36:59 +02:00
Fabian Dill
df79e570bb shorten hint text a bit, now that it got longer 2020-05-18 23:24:41 +02:00
Fabian Dill
947362aaa6 improve colors #2 2020-05-18 23:09:51 +02:00
Fabian Dill
2c8d127550 improve colors 2020-05-18 10:02:28 +02:00
Fabian Dill
b2e20be077 Hints now contain ER info 2020-05-18 05:40:36 +02:00
caitsith2
cc77b48146 Changes
* Cache server address for loaded rom, as well as default fallback.
* server address is only cached upon successful connection and authentication to the server.
2020-04-30 18:02:25 -07:00
Fabian Dill
47784d2632 name client tasks
and then realize that PyCharm's ConcurrencyDiagram is currently broken and doesn't show the names
2020-04-30 04:09:19 +02:00
Fabian Dill
56e57de574 store last used adjuster settings and use them for patching
might use them as gui defaults later
2020-04-26 15:14:30 +02:00
Fabian Dill
49770159fb small adjustments for game finished 2020-04-25 13:50:32 +02:00
caitsith2
b3c7789596 Changes
* Game end detection - Detect if the player finished their game, and announce it accordingly.
* Add a client side /slow_mode option. (allows to delay receiving items when a massive amount of them come in, like from a forfeit.)
2020-04-24 20:07:28 -07:00
Fabian Dill
37b79294be remember the last server address and ask to use it. 2020-04-25 04:10:30 +02:00
Fabian Dill
5d33b4b164 introduce persistent data storage, which for now just caches rom -> server pairs 2020-04-24 05:29:02 +02:00
Fabian Dill
7582767401 aliases 2020-04-23 06:16:54 +02:00
Fabian Dill
8ea342abe5 Add result flag to commands 2020-04-21 06:26:51 +02:00
Fabian Dill
3165c440e3 and forgot one instance of version 2020-04-20 19:50:13 +02:00
Fabian Dill
5a57519c32 Add count to missing command
Add a server's missing command
Fix password wasn't able to remove a set password
2020-04-20 11:47:50 +02:00
Fabian Dill
b676d4131f loudly fail on connection errors. 2020-04-19 13:44:22 +02:00
Fabian Dill
48e304a091 0 is not None 2020-04-19 13:41:01 +02:00
Fabian Dill
659bc0e177 no longer eat multiple spaces in commands 2020-04-19 03:24:27 +02:00
CaitSith2
6b47a69966 Actually close SNES connection on invalid rom. (#69)
This nicely makes it also attempt to reconnect in 5 seconds alongside the client to server.
2020-04-17 00:23:08 +02:00
Fabian Dill
11df6e5e7a Merge branch 'master' into owg_test 2020-04-15 21:27:41 +02:00
Fabian Dill
6ed317899e fix unknown Bonta Protocol text 2020-04-15 20:51:33 +02:00
Fabian Dill
d9e4bd1ab0 bumb network version for new command processing 2020-04-15 08:49:30 +02:00
Fabian Dill
af78914d22 mvoe client stuff to new command processor 2020-04-14 20:22:42 +02:00
Fabian Dill
1f8dc8d317 clean qusb2snes launch code a bit 2020-04-12 04:44:03 +02:00
Fabian Dill
90359b62e6 fix qusb2snes launch pathing 2020-04-12 04:38:57 +02:00
Fabian Dill
380b59ade2 the setup experience 2020-04-07 04:18:26 +02:00
CaitSith2
7b620e94f7 Add a way to show found items on client/server (#52)
* Add a way to show found items on client/server

* item show stuff:
use less ram and cpu, rename a few things

* Add UpdateTags server command.

Co-authored-by: Fabian Dill <fabian.dill@web.de>
2020-03-23 10:47:07 +01:00
Fabian Dill
c36cdf5546 reset snes state when resetting rom 2020-03-22 20:07:19 +01:00
CaitSith2
d31e54e5cd Force the rom to be reread on reconnect if rom... (#51)
... is not one of the expected player roms.  This is all that was preventing things from being 100% automatic, if an incorrect rom was already loaded in the connected snes state.
2020-03-22 18:56:38 +01:00
Fabian Dill
031d6823a1 mostly pathing improvements, mostly to benefit linux 2020-03-15 19:32:00 +01:00
Fabian Dill
2a05b9cd72 move to promp_toolkit 2020-03-13 03:53:20 +01:00
Fabian Dill
a29f93045e performance improvements and small adjustments 2020-03-10 00:38:29 +01:00
Fabian Dill
611f4d3fb2 no longer try patching if it's the wrong rom.
People ignore the warning.
2020-03-08 02:18:55 +01:00
Fabian Dill
b7814ca050 remove deprecated code 2020-03-07 17:08:50 +01:00
Fabian Dill
0fa896f8f6 Make Client wait for QUSB2SNES connection and devices, then auto-connect 2020-03-07 00:07:32 +01:00
Fabian Dill
128be8df89 don't set cwd on import 2020-03-06 04:52:21 +01:00
Fabian Dill
c6cd4a9681 make drag&drop work for binary patching if the file is outside the base folder 2020-03-06 01:27:02 +01:00
Fabian Dill
d44acfdaaf implement binary patching for multimystery (for now no gui/cli support) 2020-03-06 00:48:23 +01:00
Fabian Dill
aaa650e18b mention unknown ID codes in their text 2020-02-26 11:39:49 +01:00
Fabian Dill
857c318108 bump protocol version number in case I want to disallow old (in this case aka locally cheating) clients. 2020-02-22 19:45:55 +01:00
Fabian Dill
1fb7ed30eb move cheating to server, with option to turn it off
also, don't overwrite multisave if the resulting object is borked
2020-02-22 19:42:44 +01:00
Fabian Dill
09fba10a53 some QOL 2020-02-22 18:04:35 +01:00
Fabian Dill
e2ef84d6c9 add location checks to hint command 2020-02-17 08:16:17 +01:00
Fabian Dill
5c803e911c optimise the client a bit 2020-02-17 07:16:40 +01:00