Skip to content

Instantly share code, notes, and snippets.

@LarsBK
Last active August 29, 2015 14:01
Show Gist options
  • Save LarsBK/503380a1dbf95cf8dcef to your computer and use it in GitHub Desktop.
Save LarsBK/503380a1dbf95cf8dcef to your computer and use it in GitHub Desktop.

API documentation for localhost:2337

authentication.password.authenticate

Parameters

  • password - string (required)
  • userid - string (required)

Description

Authenticate as the user with userid by providing the password. Returns a login token that can be used as a proof later.

authentication.password.changePassword

Parameters

  • newPassword - string (required)

Description

Change the password. Requires that you are logged in.

authentication.password.create

Parameters

  • newPassword - string (required)
  • userid - string (required)

Description

Create a new password for the given user. Requires that you are logged in as an admin.

debug.ping

Description

Check that the connection works. Returns true.

game.endTurn

Parameters

  • gameid - string (required)

Description

End your turn in the given game. Requires that you are logged in as the user controlling the current team.

game.getDay

Parameters

  • gameid - string (required)

Description

Return the current "day" in the given game. One day passes whenall teams has had their turn.

game.getEntities

Parameters

  • gameid - string (required)

Description

Return the entities in the game in a list of objects. List element N is the entities of teamid N+1. Each element in the list is a <entityid, entitydata> map.

game.getEntityType

Parameters

  • entity - string (required)

(no description)

game.getMap

Parameters

  • mapid - string (required)

(no description)

game.getMapid

Parameters

  • gameid - string (required)

(no description)

game.getTeams

Parameters

  • gameid - string (required)

Description

Return a list of the teams indexed by (teamid - 1) in the given game.

game.getTileset

Parameters

  • tileset - string (required)

(no description)

game.getTurn

Parameters

  • gameid - string (required)

Description

Return the teamid of the team who's turn it is.

game.join

Parameters

  • teamid - integer (required)
  • gameid - string (required)

Description

Join the game with the given gameid as the given team. Return the data of the team joined.

game.sendCommand

Parameters

  • params - object (optional)
  • entityid - integer (required)
  • gameid - string (required)
  • command - string (required)

Description

Send a command to the given entity. You need to be logged in as the user who controlls the team of the entity.

game.waitTurn

Parameters

  • turn - integer (required)
  • gameid - string (required)

(no description)

games.create

Parameters

  • entityset - string (required)
  • mapid - string (required)

Description

Create a new game with the given settings. Returns the id of the new game.

introspection.listMethods

Description

Return a list of the names of all rpc methods.

introspection.methodHelp

Parameters

(string)

Description

Return a human readable description of the method given.

introspection.methodSignature

Parameters

(string)

Description

Return the signature of the method with the given name.

tokens.getTokens

Description

Return a list of all your authentication tokens.

user.getInvitedGames

Parameters

userid - string

(no description)

user.getJoinedGames

Parameters

userid - string

(no description)

user.getScoreBoard

(no description)

user.getUserid

Parameters

username - string

Description

Return the userid of the user with the given username.

user.getUsername

Parameters

userid - string

Description

Return the username of the user with the given userid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment