Added onReady callback

This commit is contained in:
Jeremiah Billmann
2013-07-18 22:51:02 -04:00
parent b5449342cd
commit 0453f140d3
2 changed files with 38 additions and 30 deletions
+5
View File
@@ -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);