Now that we can receive game messages from several games at once, make sure the Game module only handles the ones for the current game
This commit is contained in:
parent
81216e3f01
commit
c5e5a7c958
1 changed files with 7 additions and 5 deletions
|
@ -80,11 +80,13 @@ function previously(states) {
|
||||||
function initMessageHandlers() {
|
function initMessageHandlers() {
|
||||||
window.addEventListener('focus', catchUp);
|
window.addEventListener('focus', catchUp);
|
||||||
Messaging.addEventListener(["Game"], function(o) {
|
Messaging.addEventListener(["Game"], function(o) {
|
||||||
delay(handleGameMessage(o.state));
|
if(o.state.public.coordinates.gameID == globalState.game.public.coordinates.gameID) {
|
||||||
if(document.hasFocus() && getQueue().length == 1) {
|
delay(handleGameMessage(o.state));
|
||||||
catchUp();
|
if(document.hasFocus() && getQueue().length == 1) {
|
||||||
} else {
|
catchUp();
|
||||||
StatusHandler.set("♪");
|
} else {
|
||||||
|
StatusHandler.set("♪");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue