@pretty-chitty/core 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretty-chitty/core",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "description": "A TypeScript framework for building high-quality async or realtime 3D strategy board games",
6
6
  "author": "Pretty Chitty, LLC",
@@ -29,11 +29,15 @@ function PlayerEditor({ playerId, match, showBack }: { showBack?: boolean; playe
29
29
  (newConnection.transport as LocalConnectionTransport).connect(newRemoteConnection);
30
30
  match.connect(newRemoteConnection, playerId);
31
31
 
32
- const opponentRemoteConnection = new LocalConnectionTransport();
33
- const opponentConnection = new Connection(new LocalConnectionTransport());
34
- opponentConnection.register(new BadAIClientPrompts<any, any>("p1", opponentConnection), "ClientPrompts");
35
- (opponentConnection.transport as LocalConnectionTransport).connect(opponentRemoteConnection);
36
- match.connect(opponentRemoteConnection, "p1");
32
+ match.players.forEach((p) => {
33
+ if (p.id !== playerId) {
34
+ const opponentRemoteConnection = new LocalConnectionTransport();
35
+ const opponentConnection = new Connection(new LocalConnectionTransport());
36
+ opponentConnection.register(new BadAIClientPrompts<any, any>(p.id, opponentConnection), "ClientPrompts");
37
+ (opponentConnection.transport as LocalConnectionTransport).connect(opponentRemoteConnection);
38
+ match.connect(opponentRemoteConnection, p.id);
39
+ }
40
+ });
37
41
 
38
42
  setLocalConnection(newConnection);
39
43
  setRemoteConnection(newRemoteConnection);