joshuaauerbachwatson / anyCards

Multi-person card game with no built-in rules
Apache License 2.0
0 stars 0 forks source link

[client] Decide the fate of multi-peer communication #10

Closed joshuaauerbachwatson closed 1 year ago

joshuaauerbachwatson commented 1 year ago

Currently, the game is still coded to run either multi-peer ("nearby only") or server-based (via a group). I'm not sure multi-peer still works, even. There are two possibilities in the short to mid-term.

  1. Eliminate multi-peer and collapse the Communicator abstraction into its now-only instance. Go all in with server-based.
  2. Keep multi-peer working, fixing any rot that has crept into it. Preserve the abstraction and something like the current model for managing groups with the "nearby only" case being sort of like a group.

Of course (1) is the easier path but (2) could have the advantage of making it easier to quickly test UI changes without the overhead of creating groups and using the server. There will be a longer-term disadvantage in trying to preserve (2) because, as the server becomes more involved in enforcing game-model state machines the peer communication won't be able to maintain parity. Thus the "short to mid-term" sccope.

joshuaauerbachwatson commented 1 year ago

It does appear that multi-peer is broken. When I execute 'Find Players' under the simulator it appears to do the right thing. But, when I execute it on my actual iPad I get an error: 'Error Domain=NSNetServices Error Domain Code = -72008 "null"'

joshuaauerbachwatson commented 1 year ago

https://stackoverflow.com/questions/65190065/nsnetservicebrowser-did-not-search-with-error-72008-on-ios-14

It appears that the use of the local network is now something that has to be declared in info.plist and the user has to answer a prompt the first time around saying it's ok (similar to prompts for use of the camera, microphone, etc.). The article purports to show how info.plist should be modified. Although both the simulator and the iPad versions of the app were running iOS > 13 (where this comes into play), I think the simulator bypasses many of these permissions kinds of things.

Will try that solution.

joshuaauerbachwatson commented 1 year ago

Yes. That works, and the version with the fix in it is now installable via the ad hoc method. Will leave this open pending the resolution of issue #11. since it would be nice to have at least one more tester on this.

joshuaauerbachwatson commented 1 year ago

It's now pretty clear to me that this is fixed so I'm closing this. Issue #11 remains open until I can verify that the ad hoc distribution technique works for users other than me.