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/client | |
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/client')
-rw-r--r-- | diplomacy/client/connection.py | 8 | ||||
-rw-r--r-- | diplomacy/client/response_managers.py | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/diplomacy/client/connection.py b/diplomacy/client/connection.py index f9eb628..b2e6cbc 100644 --- a/diplomacy/client/connection.py +++ b/diplomacy/client/connection.py @@ -437,6 +437,14 @@ class Connection(): self._on_socket_message(msg) # Public methods. + @gen.coroutine + def get_daide_port(self, game_id): + """ Send a GetDaidePort request. + :param game_id: game id + :return: int. the game DAIDE port + """ + request = requests.GetDaidePort(game_id=game_id) + return (yield self.send(request)) @gen.coroutine def authenticate(self, username, password, create_user=False): diff --git a/diplomacy/client/response_managers.py b/diplomacy/client/response_managers.py index 5183ac4..991586f 100644 --- a/diplomacy/client/response_managers.py +++ b/diplomacy/client/response_managers.py @@ -298,6 +298,7 @@ MAPPING = { requests.DeleteGame: on_delete_game, requests.GetAllPossibleOrders: default_manager, requests.GetAvailableMaps: default_manager, + requests.GetDaidePort: default_manager, requests.GetDummyWaitingPowers: default_manager, requests.GetPlayablePowers: default_manager, requests.GetPhaseHistory: on_get_phase_history, |