Comments (4)
Thanks for finding this, wuffie!
Analysis
Did some quick poking around. SNIClient selection among multiple devices is broken.
After adding a local log statement in snes_connect() (lines starting with devices[0] or [1]):
Connecting to SNI at ws://localhost:8080 ...
devices[0] = ra://127.0.0.1:5000
devices[1] = ra://127.0.0.1:6000
Found 2 SNES devices. Connect to one with /snes <address> <device number>. For example /snes localhost:8080 1
1: ra://127.0.0.1:5000
2: ra://127.0.0.1:6000
So far so good. But then when the user selects device N (array index N-1), SNIClient calls its snes_connect() function again, this time with the user's numerical choice (1 or 2). But SNI returns the devices in a different order:
devices[0] = ra://127.0.0.1:6000
devices[1] = ra://127.0.0.1:5000
SNIClient snes_connect() proceeds with the index it was given and ends up choosing the device the user didn't want to connect to. This reversal happens very often.
Additional difficulties
SNES takes precedence over LUA emulators
If SNI is started by SNIClient, as is typical, if a connected SNES (FxPak Pro) or RetroArch (emulator) is running a multiworld ROM, that ROM will take precedence over the user connecting SNIClient to a LUA-based emulator. This happens because the LUA script doesn't work until SNI (and therefore at least 1 SNIClient) is already running. So SNIClient's auto-connect behavior will connect to the wrong device. This means these steps should somehow work intuitively (hard to tell with the above bug):
- Run SNIClient (thus SNI starts)
- (SNIClient automatically connects to a SNES, if this design is kept)
- Run LUA script in emulator so SNI sees emulator
- Must be able to intuitively connect SNIClient to LUA emulator at this point. (But how? Current SNIClient might not listen for new SNI devices at this point)
from archipelago.
SNI treats device URIs as unique, and that's the extent of it. Order of devices in the detection response is not guaranteed.
It wouldn't make much sense to try to do so anyway since the device URIs can change between detections, devices can go missing or new ones pop up. So even if it were ordered somehow, it wouldn't solve the problem where SNIClient is using once-established device indexes and assuming those stick around for a long time, which there's no guarantee they do.
from archipelago.
SNI treats device URIs as unique, and that's the extent of it. Order of devices in the detection response is not guaranteed.
It wouldn't make much sense to try to do so anyway since the device URIs can change between detections, devices can go missing or new ones pop up. So even if it were ordered somehow, it wouldn't solve the problem where SNIClient is using once-established device indexes and assuming those stick around for a long time, which there's no guarantee they do.
We only retain it between offering the user a choice and getting the choice. This was consistent on qusb2snes, but with #624 this should now be guaranteed client-side.
from archipelago.
Solved in #624.
from archipelago.
Related Issues (20)
- Core: Add custom sfx for local when sending or receiving items HOT 3
- Bug: SC2 Graphical settings aren't saving; Settings aren't inherited from the install HOT 1
- Bug: Starcraft 2 client fails to connect to local server without internet HOT 1
- Bug: Zork Grand Inquisitor progression bug HOT 4
- Bug: FactorioClient does not respect --connect flag HOT 6
- Allow Zooming of the Applications
- New Feature Request: Starcraft 2; Nova color selection in options page HOT 1
- Bug: A Hat in Time difficulty doc has discord links HOT 5
- (Celeste 64) "Key Not Found Exception" when trying to get past file selection screen HOT 3
- Bug: SC2 vanilla mission order sometimes allows playing missions with their prerequisites unlocked but not completed HOT 2
- Bug: Hollow Knight: Missing Logic: Require Focus before entering Black Egg Temple and fighting HK. HOT 2
- Bug: Non-deterministic generation when combining SMZ3 and The Legend of Zelda HOT 5
- Port for further architectures? HOT 2
- Bug: CollectionState.sweep_for_events() semantics may have been accidentally changed in #361 HOT 4
- Bug: Generation refreshes site permanently for Subnautica room HOT 1
- Bug: In Starcraft 2, loading a save or restarting a mission crashes the game HOT 5
- Bug: Can no longer create an empty Archipelago game player yaml file for spectating, ect. HOT 5
- Bug: LTTP crashes/room data corruption with allow_collect
- Bug: OOT entrance shuffle checks if the game is beatable before setting its completion_condition
- Bug: MultiWorld.can_beat_game with no arguments initially checks if the wrong state is beatable HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from archipelago.