name :)
This commit is contained in:
parent
d399f2b65f
commit
07da40dce7
4 changed files with 30 additions and 14 deletions
|
|
@ -15,13 +15,13 @@ function send(message) {
|
|||
|
||||
let clientSeq
|
||||
let events
|
||||
function connect(gameId, clientId) {
|
||||
function connect(gameId, clientId, name) {
|
||||
clientSeq = 0
|
||||
events = {}
|
||||
conn = new WsClient(WS_ADDRESS, clientId + '|' + gameId)
|
||||
return new Promise(r => {
|
||||
conn.connect()
|
||||
send([Protocol.EV_CLIENT_INIT])
|
||||
send([Protocol.EV_CLIENT_INIT, name])
|
||||
conn.onSocket('message', async ({ data }) => {
|
||||
const msg = JSON.parse(data)
|
||||
const msgType = msg[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue