mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-09-10 11:40:34 +08:00
Added onReady callback
This commit is contained in:
@@ -12,6 +12,7 @@ options = {
|
||||
onPing: function (pingDelay),
|
||||
onUpdatePlayerPhysics: function (state, inputs, deltaTime),
|
||||
onInterpolation: function(previousState, targetState, amount)
|
||||
onReady: function (),
|
||||
logging: true
|
||||
}
|
||||
api methods
|
||||
@@ -199,6 +200,10 @@ var GarageServerIO = (function (socketio) {
|
||||
_stateController.smoothingFactor = data.smoothingFactor;
|
||||
_stateController.worldState = data.worldState;
|
||||
|
||||
if(_options.onReady) {
|
||||
_options.onReady();
|
||||
}
|
||||
|
||||
setInterval(function (){
|
||||
_socket.emit('ping', new Date().getTime());
|
||||
}, _stateController.pingInterval);
|
||||
|
||||
Reference in New Issue
Block a user