Updated GarageServer.IO API calls to support client side prediction for entities - #20

This commit is contained in:
Jeremiah Billmann
2015-05-20 02:10:07 +00:00
parent 21d8fb2884
commit fbdcfe3da5
12 changed files with 48 additions and 25 deletions
+3 -1
View File
@@ -2,10 +2,12 @@ var history = require('./history');
exports = module.exports = Entity;
function Entity (id, maxHistorySecondBuffer) {
function Entity (id, referrerId, referrerSeq, maxHistorySecondBuffer) {
this.state = {};
this.sequence = 1;
this.id = id;
this.referrerId = referrerId;
this.referrerSeq = referrerSeq;
this.maxHistorySecondBuffer = maxHistorySecondBuffer;
this.stateHistory = [];
this.region = '';
+1 -1
View File
@@ -3,7 +3,7 @@ var entity = require('./entity');
exports = module.exports = Player;
function Player (socket, maxHistorySecondBuffer) {
entity.call(this, socket.id, maxHistorySecondBuffer);
entity.call(this, socket.id, null, null, maxHistorySecondBuffer);
this.socket = socket;
this.inputs = [];
}