aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/communication
diff options
context:
space:
mode:
authornotoraptor <stevenbocco@gmail.com>2019-08-26 15:02:44 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-08-28 06:15:47 -0400
commit2e26ae581062ca636dd02718e7cbbf71e022b04a (patch)
tree1a122316ece505b9ec3324e04ec3e7926f9d5ba4 /diplomacy/communication
parenta42d870221c251bebfd3cc6cc1e1c0d23b9c53b6 (diff)
Client sends a 'UnknownToken' request when it receives a notification for an unknown token.
Diffstat (limited to 'diplomacy/communication')
-rw-r--r--diplomacy/communication/requests.py7
-rw-r--r--diplomacy/communication/responses.py8
2 files changed, 15 insertions, 0 deletions
diff --git a/diplomacy/communication/requests.py b/diplomacy/communication/requests.py
index a6bb622..6f99f15 100644
--- a/diplomacy/communication/requests.py
+++ b/diplomacy/communication/requests.py
@@ -304,6 +304,13 @@ class Logout(_AbstractChannelRequest):
"""
__slots__ = []
+class UnknownToken(_AbstractChannelRequest):
+ """ Request to tell server that a channel token is unknown.
+ Expected response: Nothing - Client does not even wait for a server response.
+ Expected response handler result: None
+ """
+ __slots__ = []
+
class SetGrade(_AbstractChannelRequest):
""" SetGrade request.
Expected response: responses.Ok
diff --git a/diplomacy/communication/responses.py b/diplomacy/communication/responses.py
index f9f9fce..6353150 100644
--- a/diplomacy/communication/responses.py
+++ b/diplomacy/communication/responses.py
@@ -52,6 +52,14 @@ class Ok(_AbstractResponse):
""" Ok response sent by default after handling a request. """
__slots__ = []
+class NoResponse(_AbstractResponse):
+ """ Indicates that no responses are required """
+ __slots__ = []
+
+ def __bool__(self):
+ """ This response always evaluate to false """
+ return False
+
class DataGameSchedule(_AbstractResponse):
""" Response with info about current scheduling for a game. """
__slots__ = ['game_id', 'phase', 'schedule']