mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-29 11:15:16 +08:00
Moved smoothing factor to server options
This commit is contained in:
@@ -2,20 +2,18 @@ var GarageServerGame = require('./garageservergame');
|
||||
|
||||
/*
|
||||
options = {
|
||||
physicsInterval: 15,
|
||||
stateInterval: 45,
|
||||
logging: true,
|
||||
clientSidePrediction: true,
|
||||
interpolation: true,
|
||||
interpolationDelay: 100,
|
||||
smoothingFactor: 0.3,
|
||||
pingInterval: 2000,
|
||||
onPlayerConnect: function (socket),
|
||||
onPlayerInput: function (socket, input),
|
||||
onPlayerDisconnect: function (socket),
|
||||
onPing: function (socket, data),
|
||||
onPlayerState: function (socket, data),
|
||||
onUpdatePlayerPhysics: function (id, state, inputs, deltaTime),
|
||||
onUpdateEntityPhysics: function (id, state, deltaTime)
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -34,6 +32,7 @@ GarageServer.prototype.registerSocketEvents = function (options) {
|
||||
}
|
||||
socket.emit('state', {
|
||||
physicsDelta: (options.physicsInterval ? options.physicsInterval : 15) / 1000,
|
||||
smoothingFactor: options.smoothingFactor ? options.smoothingFactor : 1,
|
||||
interpolation: options.interpolation ? options.interpolation : false,
|
||||
interpolationDelay: options.interpolationDelay ? options.interpolationDelay : 100,
|
||||
pingInterval: options.pingInterval ? options.pingInterval : 2000,
|
||||
|
||||
Reference in New Issue
Block a user