poll is now explicit
This commit is contained in:
parent
59b33559e6
commit
289b111105
1 changed files with 10 additions and 3 deletions
13
index.html
13
index.html
|
@ -92,7 +92,7 @@
|
|||
}
|
||||
|
||||
function onOpen(evt) {
|
||||
doSend();
|
||||
updateUser();
|
||||
}
|
||||
|
||||
function onMessage(evt) {
|
||||
|
@ -104,7 +104,7 @@
|
|||
updateLines(lines);
|
||||
|
||||
setTimeout(function(){
|
||||
doSend();
|
||||
poll();
|
||||
}, speed);
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
function doSend(message) {
|
||||
function updateUser() {
|
||||
var myself = {
|
||||
name: myName,
|
||||
size: {width: window.innerWidth, height: window.innerHeight}
|
||||
|
@ -200,6 +200,13 @@
|
|||
websocket.send(JSON.stringify(packet));
|
||||
}
|
||||
|
||||
function poll(){
|
||||
var packet = {
|
||||
command: 'poll'
|
||||
};
|
||||
websocket.send(JSON.stringify(packet));
|
||||
}
|
||||
|
||||
function changeKind() {
|
||||
line_kind = line_kind + 1;
|
||||
line_kind = line_kind % 2;
|
||||
|
|
Reference in a new issue