|
@ -92,7 +92,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function onOpen(evt) { |
|
|
function onOpen(evt) { |
|
|
doSend(); |
|
|
updateUser(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function onMessage(evt) { |
|
|
function onMessage(evt) { |
|
@ -104,7 +104,7 @@ |
|
|
updateLines(lines); |
|
|
updateLines(lines); |
|
|
|
|
|
|
|
|
setTimeout(function(){ |
|
|
setTimeout(function(){ |
|
|
doSend(); |
|
|
poll(); |
|
|
}, speed); |
|
|
}, speed); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -188,7 +188,7 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function doSend(message) { |
|
|
function updateUser() { |
|
|
var myself = { |
|
|
var myself = { |
|
|
name: myName, |
|
|
name: myName, |
|
|
size: {width: window.innerWidth, height: window.innerHeight} |
|
|
size: {width: window.innerWidth, height: window.innerHeight} |
|
@ -200,6 +200,13 @@ |
|
|
websocket.send(JSON.stringify(packet)); |
|
|
websocket.send(JSON.stringify(packet)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function poll(){ |
|
|
|
|
|
var packet = { |
|
|
|
|
|
command: 'poll' |
|
|
|
|
|
}; |
|
|
|
|
|
websocket.send(JSON.stringify(packet)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function changeKind() { |
|
|
function changeKind() { |
|
|
line_kind = line_kind + 1; |
|
|
line_kind = line_kind + 1; |
|
|
line_kind = line_kind % 2; |
|
|
line_kind = line_kind % 2; |
|
|