mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-09-09 11:14:19 +08:00
Updated GarageServer.IO API calls to support client side prediction for entities - #20
This commit is contained in:
@@ -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 = '';
|
||||
|
||||
@@ -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 = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user