Commit Graph

150 Commits

Author SHA1 Message Date
CaitSith2 b1fe3d3e7b Insert key drop locations in alphabetical order. 2020-10-28 01:49:38 -07:00
CaitSith2 7e3e2134e0 Add option to client for actually forcing item sending safety off. 2020-10-27 16:27:39 -07:00
CaitSith2 66894dbd86 Add further safeties to sending of location checks.
This safety is able to be turned off, but has to be done so on EVERY connection explicitly.
2020-10-27 16:24:21 -07:00
CaitSith2 5c403086d9 Get server side missing list on connect.
This initial missing list does NOT report all of its missing locations into the console.  It is however used for a couple of things.
* Client now uses this to determine if it should send the location check to the server. No point in doing so if the server isn't going to register it anyways.
* Allows an easy view of previously visited locations in the case of a save wipe.
2020-10-27 12:08:35 -07:00
CaitSith2 83db79815a Make multiclient/multiserver/tracker keydropshuffle aware 2020-10-27 00:53:32 -07:00
Fabian Dill 1d58f54101 move ALTTP to its own world folder 2020-10-24 05:38:56 +02:00
Fabian Dill 4f8c737eec squashed commit of many breaking changes
Dropping Support for Python 3.7; adding support for Python 3.9
2020-10-19 08:26:31 +02:00
Fabian Dill add0762114 more compat removal 2020-10-18 23:18:54 +02:00
Fabian Dill 94dafa3c55 Open Breaking changes 2020-10-18 23:07:48 +02:00
Fabian Dill 70752d332f Delay consecutive reconnects 2020-09-01 21:45:01 +02:00
Fabian Dill d92c461ad3 open webui only after asking for repatching in text console, as it can otherwise be easily missed. 2020-08-11 21:59:43 +02:00
Fabian Dill 9445527249 Multiclient: use new romname for persistent storage 2020-07-17 15:50:00 +02:00
Fabian Dill d9e7248ebc fix multiclient trying to webhost on the same port it determined as web_ui socket 2020-07-15 23:10:08 +02:00
Fabian Dill 2338d25b39 expand rom auto_start to be customizable 2020-07-15 17:19:16 +02:00
Fabian Dill c5ece240c4 MultiClient: fix authenticating against older server 2020-07-14 16:19:04 +02:00
Fabian Dill ea9e103cb0 update rom name handling 2020-07-14 04:48:56 +02:00
Fabian Dill 38fe292acb allow aliases in tracker and prevent them from causing html/js/database "stuff"
Though technically they can still do unicode "stuff"
2020-06-24 13:29:40 +02:00
caitsith2 f6a7acad19 Send game finished state on connect 2020-06-23 06:03:21 -07:00
Fabian Dill 7353b489ce add available hint points to UI 2020-06-15 06:30:51 +02:00
Chris e11f33b589 Update WebUI to display server, check, and hint info. CURRENT HINT POINTS DO NOT WORK YET 2020-06-14 18:04:03 -04:00
Fabian Dill 9d067b6f00 improve gui 2020-06-10 19:57:01 +02:00
Fabian Dill 8a0bae0252
Merge pull request #103 from Berserker66/patch_changes
Allow patch.py to mass adjust roms. (It asks on first slot, and if yes is said, applies to ALL patches.)
Allow patch.py store target server address for patch.
2020-06-08 18:22:53 +02:00
Fabian Dill 9612e27531 correct webuidata log to debug level 2020-06-08 18:21:04 +02:00
Fabian Dill f9a29d3140 fix disable web ui 2020-06-07 23:14:07 +02:00
caitsith2 91cb0630fa changes
* Allow patch.py to mass adjust roms
* Allow patch.py store target server address for patch.
2020-06-07 12:04:33 -07:00
Chris 7d42137782 Fix bug preventing manual snes reconnect. Update WebUI to automatically connect if only one SNES device is detected. 2020-06-06 19:58:10 -04:00
Fabian Dill fbd00136e7 remove leftover log 2020-06-06 23:46:51 +02:00
Fabian Dill d3df96fcc5 move some client functions into their own functions
also break some stuff while I'm at it, so don't use this yet.
2020-06-06 23:46:28 +02:00
Fabian Dill 829c9c2045 restore python 3.7 client compat 2020-06-06 22:54:09 +02:00
Fabian Dill d25973989a 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:27:29 +02:00
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
Fabian Dill 18911a1490 use same version format on client and server 2020-02-16 16:20:00 +01:00
Fabian Dill b04db006e0 implement server-client handshake and move hint system to optional colorama support 2020-02-16 15:32:40 +01:00
Fabian Dill a4d8a3831e keep client window open if unexpected exceptions occur 2020-02-02 06:20:08 +01:00
Fabian Dill cc369c3631 add license command to client to have MIT compliant compiled client possible 2020-02-02 06:14:51 +01:00
Fabian Dill b58558eb75 move updater to own module 2020-01-18 15:45:52 +01:00
Fabian Dill 674cad07ea re-implement auto-updates 2020-01-18 15:04:39 +01:00
Fabian Dill 72c33a2348 Merge branch 'pull/5'
# Conflicts:
#	MultiClient.py
#	MultiServer.py
#	Mystery.py
2020-01-18 14:41:11 +01:00
Bonta-kun 7f800de8d0 MultiServer/Client: use logging instead of print and log time on the server 2020-01-18 12:21:57 +01:00
Bonta-kun f843c401c7 MultiClient: signal an event when receiving item data to improve responsiveness 2020-01-18 11:28:08 +01:00
Bonta-kun e941f738ba MultiClient: get rid of packages install hacks, use requirements.txt instead 2020-01-18 10:05:59 +01:00
Bonta-kun f988f7671b --remote_items toggle: items will no longer be stored in the rom, a connection to a multiworld server will be required to receive them 2020-01-18 09:50:12 +01:00
Fabian Dill 1c736f8afe check for websockets version 2020-01-17 20:23:48 +01:00
Bonta-kun 2d26d63cce MultiClient: fix roominfo sort 2020-01-15 03:00:30 +01:00
Bonta-kun ad278f91d6 Multiworld: clients will now be automatically be identified from the rom name and have their names and teams set by the host, meaning those need to be configured during seed gen
Player names will show up in spoiler log and hint tiles instead of player id
MultiClient: autoreconnect to mw server
2020-01-14 10:42:27 +01:00
Bonta-kun 3e99c3c9a3 MultiClient: auto reconnect to snes 2020-01-13 03:55:33 +01:00
Bonta-kun 82a6961777 MultiClient: default port to 38281 2020-01-10 22:43:01 +01:00
Bonta-kun 1be0d62d4f MultiClient: allow different protocols if a prefix is present 2020-01-05 20:22:19 +01:00
Bonta-kun 04f5f2fa84 Multi client/server: log fewer exceptions 2019-12-16 18:39:00 +01:00
Bonta-kun 1a60d263ff client: accept rom names smaller than 21b 2019-12-10 03:01:13 +01:00
Bonta-kun 55a30aa91f multiworld 2019-12-09 19:27:56 +01:00