From 2e26ae581062ca636dd02718e7cbbf71e022b04a Mon Sep 17 00:00:00 2001 From: notoraptor Date: Mon, 26 Aug 2019 15:02:44 -0400 Subject: Client sends a 'UnknownToken' request when it receives a notification for an unknown token. --- diplomacy/communication/requests.py | 7 +++++++ diplomacy/communication/responses.py | 8 ++++++++ 2 files changed, 15 insertions(+) (limited to 'diplomacy/communication') 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'] -- cgit v1.2.3