| 43 | |
| 44 | =Technical insides |
| 45 | |
| 46 | This section deals with the techniques inside the runserver and may be relevant when you need to communicate directly with it, e.g. when you build your own GUI or start up your own sessions and tournaments from a script. |
| 47 | |
| 48 | ==Communication protocol |
| 49 | |
| 50 | This section describes the communication protocols with the runserver. Other implementations of a runserver should adhere to the same communication protocols to ensure compatibility with genius2. |
| 51 | |
| 52 | === RunSession |
| 53 | The main service available on the runserver is the RunSession service. It is available at http://runserver/runsession. |
| 54 | This service starts up and runs a complete session when it is accessed (http get or post). |
| 55 | To start a session, the http get must include a JSON-serialized genius2.protocol.session.SessionSettings object. Typically this looks like this (assuming you want to use SAOP protocol): |
| 56 | {{{ |
| 57 | {"SAOPSettings": { |
| 58 | "participants":[ |
| 59 | {"party":"http://party1","profile":"ws://profile1"}, |
| 60 | {"party":"http://party2","profile":"ws://profile2"}], |
| 61 | "deadline":{"deadlinetime":{"millis":100}} |
| 62 | }} |
| 63 | }}} |
| 64 | |
| 65 | The "SAOPSettings" indicates that these settings are SAOPSettings and (see Settings.getProtocol) will be interpreted by the SAOP protocol. |
| 66 | |
| 67 | The participants is a list with PartyWithProfile items: a "party" field containing a http address on a partiesserver, and a "profile" field containing a websocket address on a profilesserver. |
| 68 | |
| 69 | The deadline contains the deadline for the SAOP, which is how long the negotiation can last. |
| 70 | |
| 71 | |