From 5b100b7cd94d638940c7d9384faba1f7805a7151 Mon Sep 17 00:00:00 2001 From: Jeremiah Billmann Date: Tue, 30 Jul 2013 19:29:58 -0400 Subject: [PATCH] Progress: Documentation --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bebe97b..4f17070 100644 --- a/README.md +++ b/README.md @@ -276,46 +276,51 @@ This will enabling console logging of all the events occuring within the GarageS ```js GarageServerIO.addInput(input) ``` +Use this method to notify the server of client inputs. These will be used to determine state from the physics processing. `input` **object literal** - +This can be anything as it pertains to your game - 1, 'left', 'right', etc., whatever you want to make it. #### getPlayerStates --- ```js GarageServerIO.getPlayerStates() : [, {id, state}] ``` +Returns a list of current player states from the most recent broadcast depending on interpolation settings. **_Returns:_ array** `id` **string** - +The id of the player. `state` **object literal** - +Object containing all properties pertaining to an entity state in your game. #### getEntityStates --- ```js GarageServerIO.getEntityStates() : [, {id, state}] ``` +Returns a list of current entity states from the most recent broadcast depending on interpolation settings. **_Returns:_ array** `id` **string** - +The id of the entity. `state` **object literal** - +Object containing all properties pertaining to an entity state in your game. #### getId --- ```js GarageServerIO.getId() : playerid ``` +Gets the id of the client's player. **_Returns:_ string** `playerid` **string** - +Id of the client's player. #### sendServerEvent --- ```js GarageServerIO.sendServerEvent(data) ``` +Send a custom event to the server. `data` **object literal** - +Object containing all properties pertaining to the custom event. ### Server #### createGarageServer