@dotrino/lobby 0.6.0 → 0.7.0

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/transport.js +2 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotrino/lobby",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Lobby + matchmaking reciclable para juegos del ecosistema Dotrino: salas, asientos, espectadores, motor de turnos autoritativo, reputación y contactos sobre el proxy/identity/reputation compartidos",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "peerDependencies": {
35
35
  "@dotrino/identity": ">=0.5.0",
36
- "@dotrino/proxy-client": ">=0.13.1",
36
+ "@dotrino/proxy-client": ">=0.18.2",
37
37
  "@dotrino/reputation": ">=0.3.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
package/src/transport.js CHANGED
@@ -111,10 +111,8 @@ export class Transport extends Emitter {
111
111
  const me = this.identity.me
112
112
  const publickey = me && me.publickey
113
113
  if (!publickey) return
114
- const data = { op: 'identify', publickey, token: this.proxy.token, ts: clock.now() }
115
- const signed = await this.identity.signData(data)
116
- const signature = typeof signed === 'string' ? signed : signed.signature
117
- await this.proxy.identify({ data, signature })
114
+ // El sobre lo arma el pilar (`identifyAs`), que le pone el destinatario.
115
+ await this.proxy.identifyAs({ publickey, sign: (d) => this.identity.signData(d) })
118
116
  }
119
117
 
120
118
  /** Demultiplexor: registra un handler para un gameId. Devuelve desuscriptor. */