diplomacy.daide.responses¶
DAIDE Responses - Contains a list of responses sent by the server to the client
-
class
diplomacy.daide.responses.
DaideResponse
(**kwargs)[source]¶ Bases:
diplomacy.communication.responses._AbstractResponse
Represents a DAIDE response.
-
class
diplomacy.daide.responses.
MapNameResponse
(map_name, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a MAP DAIDE response. Sends the name of the current map to the client.
Syntax:
MAP ('name')
-
class
diplomacy.daide.responses.
MapDefinitionResponse
(map_name, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a MDF DAIDE response. Sends configuration of a map to a client
Syntax:
MDF (powers) (provinces) (adjacencies)
powers syntax:
power power ...
power syntax:
AUS # Austria ENG # England FRA # France GER # Germany ITA # Italy RUS # Russia TUR # Turkey
provinces syntax:
(supply_centres) (non_supply_centres)
supply_centres syntax:
(power centre centre ...) (power centre centre ...) ...
supply_centres power syntax:
(power power ...) # This is currently not supported AUS # Austria ENG # England FRA # France GER # Germany ITA # Italy RUS # Russia TUR # Turkey UNO # Unknown power
non_supply_centres syntax:
province province ... # List of provinces
adjacencies syntax:
(prov_adjacencies) (prov_adjacencies) ...
prov_adjacencies syntax:
province (unit_type adjacent_prov adjacent_prov ...) (unit_type adjacent_prov adjacent_prov ...) ...
unit_type syntax:
AMY # List of provinces an army can move to FLT # List of provinces a fleet can move to (FLT coast) # List of provinces a fleet can move to from the given coast
adjacent_prov syntax:
province # A province which can be moved to (province coast) # A coast of a province that can be moved to
-
class
diplomacy.daide.responses.
HelloResponse
(power_name, passcode, level, deadline, rules, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a HLO DAIDE response. Sends the power to be played by the client with the passcode to rejoin the game and the details of the game.
Syntax:
HLO (power) (passcode) (variant) (variant) ...
Variant syntax:
LVL n # Level of the syntax accepted MTL seconds # Movement time limit RTL seconds # Retreat time limit BTL seconds # Build time limit DSD # Disables the time limit when a client disconects AOA # Any orders accepted
LVL 10:
Variant syntax:
PDA # Accept partial draws NPR # No press during retreat phases NPB # No press during build phases PTL seconds # Press time limit
-
__init__
(power_name, passcode, level, deadline, rules, **kwargs)[source]¶ Builds the response
Parameters: - power_name – The name of the power being played.
- passcode – Integer. A passcode to rejoin the game.
- level – Integer. The daide syntax level of the game
- deadline – Integer. The number of seconds per turn (0 to disable)
- rules – The list of game rules.
-
-
class
diplomacy.daide.responses.
SupplyCenterResponse
(powers_centers, map_name, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a SCO DAIDE response. Sends the current supply centre ownership.
Syntax:
SCO (power centre centre ...) (power centre centre ...) ...
-
class
diplomacy.daide.responses.
CurrentPositionResponse
(phase_name, powers_units, powers_retreats, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a NOW DAIDE response. Sends the current turn, and the current unit positions.
Syntax:
NOW (turn) (unit) (unit) ...
Unit syntax:
power unit_type province power unit_type province MRT (province province ...)
-
class
diplomacy.daide.responses.
ThanksResponse
(order_bytes, results, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a THX DAIDE response. Sends the result of an order after submission.
Syntax:
THX (order) (note)
Note syntax:
MBV # Order is OK. FAR # Not adjacent. NSP # No such province NSU # No such unit NAS # Not at sea (for a convoying fleet) NSF # No such fleet (in VIA section of CTO or the unit performing a CVY) NSA # No such army (for unit being ordered to CTO or for unit being CVYed) NYU # Not your unit NRN # No retreat needed for this unit NVR # Not a valid retreat space YSC # Not your supply centre ESC # Not an empty supply centre HSC # Not a home supply centre NSC # Not a supply centre CST # No coast specified for fleet build in StP, or an attempt to build a fleet inland, or an army at sea. NMB # No more builds allowed NMR # No more removals allowed NRS # Not the right season
-
class
diplomacy.daide.responses.
MissingOrdersResponse
(phase_name, power, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a MIS DAIDE response. Sends the list of unit for which an order is missing or indication about required disbands or builds.
Syntax:
MIS (unit) (unit) ... MIS (unit MRT (province province ...)) (unit MRT (province province ...)) ... MIS (number)
-
__init__
(phase_name, power, **kwargs)[source]¶ Builds the response
Parameters: - phase_name – The name of the current phase (e.g. ‘S1901M’)
- power (diplomacy.engine.power.Power) – The power to check for missing orders
-
-
class
diplomacy.daide.responses.
OrderResultResponse
(phase_name, order_bytes, results, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a ORD DAIDE response. Sends the result of an order after the turn has been processed.
Syntax:
ORD (turn) (order) (result) ORD (turn) (order) (result RET)
Result syntax:
SUC # Order succeeded (can apply to any order). BNC # Move bounced (only for MTO, CTO or RTO orders). CUT # Support cut (only for SUP orders). DSR # Move via convoy failed due to dislodged convoying fleet (only for CTO orders). NSO # No such order (only for SUP, CVY or CTO orders). RET # Unit was dislodged and must retreat.
-
class
diplomacy.daide.responses.
TimeToDeadlineResponse
(seconds, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a TME DAIDE response. Sends the time to the next deadline.
Syntax:
TME (seconds)
-
class
diplomacy.daide.responses.
AcceptResponse
(request_bytes, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a YES DAIDE request.
Syntax:
YES (TME (seconds)) # Accepts to set the time when a TME message will be sent YES (NOT (TME)) # Accepts to cancel all requested time messages YES (NOT (TME (seconds))) # Accepts to cancel a specific requested time message YES (GOF) # Accepts to wait until the deadline before processing the orders for the turn YES (NOT (GOF)) # Accepts to cancel to wait until the deadline before processing the orders for the turn YES (DRW) # Accepts to draw YES (NOT (DRW)) # Accepts to cancel a draw request
LVL 10:
YES (DRW (power power ...)) # Accepts a partial draw YES (NOT (DRW (power power ...))) # Accepts to cancel a partial draw request (? not mentinned in the DAIDE doc) YES (SND (power power ...) (press_message)) # Accepts a press message YES (SND (turn) (power power ...) (press_message)) # Accepts a press message
-
class
diplomacy.daide.responses.
RejectResponse
(request_bytes, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a REJ DAIDE request.
Syntax:
REJ (NME ('name') ('version')) # Rejects a client in the game REJ (IAM (power) (passcode)) # Rejects a client to rejoin the game REJ (HLO) # Rejects to send the HLO message REJ (HST (turn)) # Rejects to send a copy of a previous ORD, SCO and NOW messages REJ (SUB (order) (order)) # Rejects a submition of orders REJ (SUB (turn) (order) (order)) # Rejects a submition of orders REJ (NOT (SUB (order))) # Rejects a cancellation of a submitted order REJ (MIS) # Rejects to send a copy of the current MIS message REJ (GOF) # Rejects to wait until the deadline before processing the orders for the turn REJ (NOT (GOF)) # Rejects to cancel to wait until the deadline before processing the orders for the turn REJ (TME (seconds)) # Rejects to set the time when a TME message will be sent REJ (NOT (TME)) # Rejects to cancel all requested time messages REJ (NOT (TME (seconds))) # Rejects to cancel a specific requested time message REJ (ADM ('name') ('message') # Rejects the admin message REJ (DRW) # Rejects to draw REJ (NOT (DRW)) # Rejects to cancel a draw request
LVL 10:
REJ (DRW (power power ...)) # Rejects to partially draw REJ (NOT (DRW (power power ...))) # Rejects to cancel a partial draw request REJ (SND (power power ...) (press_message)) # Rejects a press message REJ (SND (turn) (power power ...) (press_message)) # Rejects a press message
-
class
diplomacy.daide.responses.
NotResponse
(response_bytes, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a NOT DAIDE response.
Syntax:
NOT (CCD (power))
-
class
diplomacy.daide.responses.
PowerInCivilDisorderResponse
(power_name, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a CCD DAIDE response. Sends the name of the power in civil disorder.
Syntax:
CCD (power)
-
class
diplomacy.daide.responses.
PowerIsEliminatedResponse
(power_name, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a OUT DAIDE response. Sends the name of the power eliminated.
Syntax:
OUT (power)
-
class
diplomacy.daide.responses.
ParenthesisErrorResponse
(request_bytes, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a PRN DAIDE response.
Syntax:
PRN (message)
-
class
diplomacy.daide.responses.
SyntaxErrorResponse
(request_bytes, error_index, **kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents a HUH DAIDE response.
Syntax:
HUH (message)
-
class
diplomacy.daide.responses.
TurnOffResponse
(**kwargs)[source]¶ Bases:
diplomacy.daide.responses.DaideResponse
Represents an OFF DAIDE response. Requests a client to exit
Syntax:
OFF
-
diplomacy.daide.responses.
MAP
¶
-
diplomacy.daide.responses.
MDF
¶
-
diplomacy.daide.responses.
HLO
¶
-
diplomacy.daide.responses.
SCO
¶
-
diplomacy.daide.responses.
NOW
¶
-
diplomacy.daide.responses.
THX
¶
-
diplomacy.daide.responses.
MIS
¶
-
diplomacy.daide.responses.
ORD
¶
-
diplomacy.daide.responses.
TME
¶
-
diplomacy.daide.responses.
YES
¶
-
diplomacy.daide.responses.
REJ
¶
-
diplomacy.daide.responses.
NOT
¶
-
diplomacy.daide.responses.
CCD
¶ alias of
diplomacy.daide.responses.PowerInCivilDisorderResponse
-
diplomacy.daide.responses.
OUT
¶ alias of
diplomacy.daide.responses.PowerIsEliminatedResponse
-
diplomacy.daide.responses.
OFF
¶
-
diplomacy.daide.responses.
PRN
¶
-
diplomacy.daide.responses.
HUH
¶