Changes between Version 29 and Version 30 of WikiStart


Ignore:
Timestamp:
05/14/19 11:58:55 (6 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v29 v30  
    6565This 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.
    6666
    67 === Run Session
    68 This section describes the RunSession service. It is available at {{{http:..:8080//runserver/runsession}}}.
    69 This service starts up and runs a complete session when 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
     68This section describes the [source:/src/main/java/genius2/runserver/RunNego.java RunNego] service. It is available at {{{http:..:8080//runserver/run}}}.
     69This service starts up and runs a complete Nego (session or tournament) when it is accessed (http get or post).
     70To 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.
    7171
    72 Typically the settings looks like this (assuming you want to use SAOP protocol):
     72Typically the settings looks like this (session with SAOP protocol):
    7373{{{
    7474{"SAOPSettings": {
     
    8282The "SAOPSettings" indicates that these settings are SAOPSettings and (see Settings.getProtocol) will be interpreted by the SAOP protocol.
    8383
     84
    8485The 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.
    8586
    8687The deadline contains the deadline for the SAOP, which is how long the negotiation can last.
    8788
    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):
     89To run a tournament, the NegoSettings typically look like this:
    9490{{{
    9591{"AllPermutationsSettings":{
     
    10096 "sessionsettings":{"SAOPSettings":{"participants":[],"deadline":{"deadlinetime":{"millis":10}}}}}}
    10197}}}
     98
    10299
    103100The parties is a list of party URIs, just like in the session settings
     
    111108sessionsettings 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.
    112109
    113 === View Running Sessions
     110
     111=== View Running Negotiations
    114112The 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.
    115113
    116 === View Running Tournaments
    117 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.
    118114
     115