diff options
author | Satya Ortiz-Gagne <satya.ortiz-gagne@mila.quebec> | 2019-06-10 10:20:39 -0400 |
---|---|---|
committer | Philip Paquette <pcpaquette@gmail.com> | 2019-06-14 15:08:29 -0400 |
commit | 08b9469e2c71e06fdd70d607f281686746755073 (patch) | |
tree | 72066b7920e1c6aa0c8a0b390418c25a1afec1ad /diplomacy/communication | |
parent | 9628cdadbf5a6380098168846dc51e4feadef6ad (diff) |
DAIDE - Added connection_handler and server
- Ability to open and close port when DAIDE games are started and stopped
- Can get the DAIDE port using a request
Diffstat (limited to 'diplomacy/communication')
-rw-r--r-- | diplomacy/communication/requests.py | 11 | ||||
-rw-r--r-- | diplomacy/communication/responses.py | 7 |
2 files changed, 18 insertions, 0 deletions
diff --git a/diplomacy/communication/requests.py b/diplomacy/communication/requests.py index b7f7671..a6bb622 100644 --- a/diplomacy/communication/requests.py +++ b/diplomacy/communication/requests.py @@ -114,6 +114,17 @@ class _AbstractGameRequest(_AbstractChannelRequest): # Connection requests. # ==================== +class GetDaidePort(_AbstractRequest): + """ Get game DAIDE port """ + __slots__ = ['game_id'] + params = { + strings.GAME_ID: str + } + + def __init__(self, **kwargs): + self.game_id = None + super(GetDaidePort, self).__init__(**kwargs) + class SignIn(_AbstractRequest): """ SignIn request. Expected response: responses.DataToken diff --git a/diplomacy/communication/responses.py b/diplomacy/communication/responses.py index a928720..58edd6f 100644 --- a/diplomacy/communication/responses.py +++ b/diplomacy/communication/responses.py @@ -161,6 +161,13 @@ class DataGames(UniqueData): strings.DATA: parsing.SequenceType(parsing.JsonableClassType(DataGameInfo)) # list of game info. } +class DataPort(UniqueData): + """ Unique data containing a DAIDE port. """ + __slots__ = [] + params = { + strings.DATA: int # DAIDE port + } + class DataTimeStamp(UniqueData): """ Unique data containing a timestamp. """ __slots__ = [] |