fix some tests, implement event classes for types, and re-implement logging

This commit is contained in:
Kevin Jahns
2017-10-22 19:12:50 +02:00
parent 755c9eb16e
commit c92f987496
17 changed files with 235 additions and 259 deletions

View File

@@ -1,16 +1,16 @@
import BinaryDecoder from '../Binary/Decoder.js'
import { stringifyUpdate } from './update.js'
import { stringifyStructs } from './integrateRemoteStructs.js'
import { stringifySyncStep1 } from './syncStep1.js'
import { stringifySyncStep2 } from './syncStep2.js'
export function messageToString (y, buffer) {
export function messageToString ([y, buffer]) {
let decoder = new BinaryDecoder(buffer)
decoder.readVarString() // read roomname
let type = decoder.readVarString()
let strBuilder = []
strBuilder.push('\n === ' + type + ' ===\n')
if (type === 'update') {
stringifyUpdate(y, decoder, strBuilder)
stringifyStructs(y, decoder, strBuilder)
} else if (type === 'sync step 1') {
stringifySyncStep1(y, decoder, strBuilder)
} else if (type === 'sync step 2') {