Proposal: Star Citizen (game) API for sending commands to the game and receiving events from the game. Technologies: Web sockets (RFC 6455) with commands and events in JSON format (RFC 8259). The following proposal allows for clients to issue commands to the game without having to know the user's key bindings. It also allows the users "sim pit" controls to display the current state accurately or define actions apart from apart for specific key presses. EDIT: Only PLAYER initiated actions would be published as events, NOT changes caused by 3rd party entities (own shields hit, target appeared (type, damage, etc.),) A player driven API could potentially already be implemented for the command interface which could be used by third party applications like Voice Attack and GameGlass. This alone would save repeatedly entering any changes to the player's game configuration in multiple third party applications due to it's central nature. 1. Game opens a http server on localhost (no remote access). 1.1. The server's address and port is written to a known file so that connecting clients can read which address and port to use. e.g. ...\Roberts Space Industries\StarCitizen\LIVE\api-server.json : { "version": "3.15.1", <-- Game version, so client knows what commands and events are available "address": "127.82.83.73", <-- 82 83 73 = RSI in ASCII "port": 9999 <-- some random port } 1.2 Client connects via HTTP and upgrades to Web Socket 2. Communication All commands from the client to the game and all events from the game to the client are sent in the form of JSON structures. 2.1 Commands Commands are implemented by identifying the action to preform based on the ID of the action and NOT a key-press identifier. Commands can also contain additional information if the action requires it, this optional addition information is in the form of a set of key:value pairs. Only a SINGLE command can be sent to the game. Structure: CommandType: { "action":"${action-id}", "data": [ "key": "value" ] } 2.2 Events Events identify the source of the event with additional information specific to the event. Structures: EventsType: { "events": [ {$EventType} ] } EventType: { "source":"${event-id}", "data": [ "key": "value" ] }