Documentation...

This commit is contained in:
Jeremiah Billmann
2013-07-22 20:02:20 -04:00
parent bd58ae5d4a
commit 90f76bc5c0
2 changed files with 23 additions and 23 deletions
+7 -7
View File
@@ -12,18 +12,18 @@ options = {
maxUpdateBuffer: 120,
maxHistorySecondBuffer: 1000,
worldState: {},
onPlayerConnect: function (socket),
onPlayerInput: function (socket, input),
onPlayerDisconnect: function (socket),
onPing: function (socket, data),
onEvent: function (data)
onPlayerConnect(callback(socket)),
onPlayerInput(callback(socket, input)),
onPlayerDisconnect(callback(socket)),
onPing(callback(socket, data)),
onEvent(callback(data))
}
api methods
createGarageServer(io, options)
start()
stop()
getPlayers() : [{ id: '', state: {}, inputs: [{}], stateHistory: [{ state, executionTime }] }]
getEntities() : [{ id: '', state: {}, stateHistory: [{ state, executionTime }] }]
getPlayers() : [{ id, state, [input1, input2,...], [{ state1, executionTime1 }, { state2, executionTime2 }, ...] }]
getEntities() : [{ id, state, [{ state1, executionTime1 }, { state2, executionTime2 }, ...] }]
updatePlayerState(id, state)
updateEntityState(id, state)
addEntity(id)