|
|
|
@ -233,6 +233,7 @@ Ricochet.prototype.onMessage = function(ws, rawBody) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (message.type) { |
|
|
|
|
case 'heartbeat': this.msgHeartbeat(ws); break; |
|
|
|
|
case 'newround': this.msgNewRound(); break; |
|
|
|
|
case 'objective': this.msgObjective(); break; |
|
|
|
|
case 'robots': this.msgRobots(); break; |
|
|
|
@ -247,6 +248,10 @@ Ricochet.prototype.onMessage = function(ws, rawBody) { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
//===== Message handlers
|
|
|
|
|
Ricochet.prototype.msgHeartbeat = function() { |
|
|
|
|
this.messenger.messageOne(ws, { type: 'heartbeat' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Ricochet.prototype.msgNewRound = function() { |
|
|
|
|
this.objective = this.freshObjective(); |
|
|
|
|
this.state = STATE.PLAY; |
|
|
|
|