Changes between Version 29 and Version 30 of WikiStart
- Timestamp:
- 05/14/19 11:58:55 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiStart
v29 v30 65 65 This section deals with the communication protocols with the runserver. These 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. Other implementations of a runserver should adhere to the same communication protocols to ensure compatibility with genius2. 66 66 67 === Run Session68 This section describes the RunSession service. It is available at {{{http:..:8080//runserver/runsession}}}.69 This service starts up and runs a complete sessionwhen it is accessed (http get or post).70 To start a session, the http get must include a JSON-serialized genius2.protocol.session.SessionSettings object. The javadoc in the [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/protocol/src/main/java/genius2/protocol/session/saop/SAOPSettings.java source code] gives all details, here we discuss it only briefly.67 === Run Negotiation 68 This section describes the [source:/src/main/java/genius2/runserver/RunNego.java RunNego] service. It is available at {{{http:..:8080//runserver/run}}}. 69 This service starts up and runs a complete Nego (session or tournament) when it is accessed (http get or post). 70 To start a negotiation, the http get must include a JSON-serialized [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/protocol/src/main/java/genius2/protocol/NegoSettings.java genius2.protocol.NegoSettings] object. All details are in the javadocs, here we discuss it only briefly. 71 71 72 Typically the settings looks like this ( assuming you want to useSAOP protocol):72 Typically the settings looks like this (session with SAOP protocol): 73 73 {{{ 74 74 {"SAOPSettings": { … … 82 82 The "SAOPSettings" indicates that these settings are SAOPSettings and (see Settings.getProtocol) will be interpreted by the SAOP protocol. 83 83 84 84 85 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. 85 86 86 87 The deadline contains the deadline for the SAOP, which is how long the negotiation can last. 87 88 88 == Run Tournament 89 This section describes the RunTournament webservice. It is available at {{{http:..:8080//runserver/runtournament}}}. 90 This service starts up and runs a complete tournament when it is accessed (http get or post). 91 To start a tournament, the http get must include a JSON-serialized genius2.protocol.session.TournamentSettings object. The javadoc in the [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/protocol/src/main/java/genius2/protocol/tournament/allpermutations/AllPermutationsSettings.java source code] provides all the details, here we give a brief overview. 92 93 Typically this looks like this (assuming you want to use AllPermutations protocol): 89 To run a tournament, the NegoSettings typically look like this: 94 90 {{{ 95 91 {"AllPermutationsSettings":{ … … 100 96 "sessionsettings":{"SAOPSettings":{"participants":[],"deadline":{"deadlinetime":{"millis":10}}}}}} 101 97 }}} 98 102 99 103 100 The parties is a list of party URIs, just like in the session settings … … 111 108 sessionsettings contains basically all the normal run-sessionsettings. This is used as a "template" for all sessions of the tournament. You can put any use any session setting here, and each session will be run according to the protocol you select here. In the example we use the SAOP protocol which takes participants and deadline as arguments, as discussed above. The participants list this time is empty, the AllPermutationsProtocol adds the the required parties to this list. So if you provide a non-empty list here, then these parties would be present in every session in the tournament. 112 109 113 === View Running Sessions 110 111 === View Running Negotiations 114 112 The websocket address {{{ws:..runserver/websocket/sessions}}} sends updates of the current list of running sessions. The list is sent as a JSON List of strings , each string being the session ID of the running session. Every time the list changes, a new complete list is sent to clients listening to the websocket. 115 113 116 === View Running Tournaments117 The websocket address {{{ws:..runserver/websocket/tournaments}}} sends updates of the current list of running tournaments. The list is sent as a JSON List of strings , each string being the tournament ID of the running tournament. Every time the list changes, a new complete list is sent to clients listening to the websocket.118 114 115