Skip to content

Commit

Permalink
Make sure the client is initialized with history (so that events in t…
Browse files Browse the repository at this point in the history
…he past can always be handled without resetting)
  • Loading branch information
FrozenCow committed Aug 2, 2013
1 parent a4509c5 commit ccf2b69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions web/network-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ define([],function() {
function handleInitialize(msg) {
this.clientid = msg.clientid;

// Replace all timeframes with the one we received.
this.simulator.timeframes.splice(0,this.simulator.length,msg.timeframe);
this.simulator.resetToTimeFrames(msg.timeframes);

this.status = NetworkClient.STATUS_ACTIVE;

Expand Down
2 changes: 1 addition & 1 deletion web/network-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ define(['./utils'],function(utils) {
client.messenger.send({
type: 'initialize',
clientid: client.id,
timeframe: this.simulator.getLastTimeFrame()
timeframes: this.simulator.timeframes
});

messenger.onmessage = handleMessage.bind(client);
Expand Down

0 comments on commit ccf2b69

Please sign in to comment.