Changes between Version 26 and Version 27 of WikiStart


Ignore:
Timestamp:
03/28/19 16:34:27 (6 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v26 v27  
    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 === RunSession
    68 The main service available on the runserver is the RunSession service. It is available at {{{http:..:8080//runserver/runsession}}}.
     67=== Run Session
     68This section describes the RunSession service. It is available at {{{http:..:8080//runserver/runsession}}}.
    6969This service starts up and runs a complete session when it is accessed (http get or post).
    7070To 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):
     
    8484The deadline contains the deadline for the SAOP, which is how long the negotiation can last.
    8585
    86 === Running Sessions
     86== Run Tournament
     87This section describes the RunTournament service. It is available at {{{http:..:8080//runserver/runtournament}}}.
     88This service starts up and runs a complete tournament when it is accessed (http get or post).
     89To start a tournament, the http get must include a JSON-serialized genius2.protocol.session.TournamentSettings object. Typically this looks like this (assuming you want to use AllPermutations protocol):
     90{{{
     91{"AllPermutationsSettings":{
     92 "parties":["http://server/../party1","http://server/../party2"],
     93 "profiles":["ws://server/../profile1","ws://server/../profile2","ws://server/../profile3"],
     94 "reuseParties":false,
     95 "partiesPerSession":2,
     96 "sessionsettings":{"SAOPSettings":{"participants":[],"deadline":{"deadlinetime":{"millis":10}}}}}}
     97}}}
     98
     99The parties is a list of party URIs, just like in the session settings
     100
     101The profiles is a list of profile URIs, just like in the session settings
     102
     103If reuseParties is set to to false, parties are drawn from the list without return. If it is set to true, parties are drawn with return (meaning all parties can occur multiple times in each session)
     104
     105partiesPerSession sets the number of parties (and matching profiles) for each session. Profiles are always drawn without return (never appear twice in a session)
     106
     107sessionsettings 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.
     108
     109=== View Running Sessions
    87110The 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.
    88111
     112=== View Running Tournaments
     113The 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.
     114