diplomacy.daide.requests

Daide Requests - Contains a list of requests sent by client to server

class diplomacy.daide.requests.RequestBuilder[source]

Bases: object

Builds DaideRequest from bytes or tokens

static from_bytes(daide_bytes, **kwargs)[source]

Builds a request from DAIDE bytes

Parameters:daide_bytes – The bytes representation of a request
Returns:The DaideRequest built from the bytes
class diplomacy.daide.requests.DaideRequest(**kwargs)[source]

Bases: diplomacy.communication.requests._AbstractGameRequest

Represents a DAIDE request.

__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.NameRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a NME DAIDE request. Can be sent by the client as soon as it connects to the server.

Syntax:

NME ('name') ('version')
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.ObserverRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a NME DAIDE request. Can be sent by the client as soon as it connects to the server.

Syntax:

OBS
parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.IAmRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a IAM DAIDE request. Can be sent by the client at anytime to rejoin the game.

Syntax:

IAM (power) (passcode)
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.HelloRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a HLO DAIDE request. Sent by the client to request a copy of the HLO message.

Syntax:

HLO
parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.MapRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a MAP DAIDE request. Sent by the client to request a copy of the MAP message.

Syntax:

MAP
parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.MapDefinitionRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a MDF DAIDE request. Sent by the client to request the map definition of the game.

Syntax:

MDF
parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.SupplyCentreOwnershipRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a SCO DAIDE request. Sent by the client to request a copy of the last SCO message.

Syntax:

SCO
parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.CurrentPositionRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a NOW DAIDE request. Sent by the client to request a copy of the last NOW message.

Syntax:

NOW
parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.HistoryRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a HST DAIDE request. Sent by the client to request a copy of a previous ORD, SCO and NOW messages.

Syntax:

HST (turn)
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.SubmitOrdersRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a SUB DAIDE request. Sent by the client to submit orders.

Syntax:

SUB (order) (order) ...
SUB (turn) (order) (order) ...

order syntax:

(unit) HLD                                       # Hold
(unit) MTO province                              # Move to
(unit) SUP (unit)                                # Support
(unit) SUP (unit) MTO (prov_no_coast)            # Support to move
(unit) CVY (unit) CTO province                   # Convoy
(unit) CTO province VIA (sea_prov sea_prov ...)  # Convoy to via provinces
(unit) RTO province                              # Retreat to
(unit) DSB                                       # Disband (R phase)
(unit) BLD                                       # Build
(unit) REM                                       # Remove (A phase)
(unit) WVE                                       # Waive
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.MissingOrdersRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a MIS DAIDE request. Sent by the client to request a copy of the current MIS message.

Syntax:

MIS
parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.GoFlagRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a GOF DAIDE request. Sent by the client to notify that the client is ready to process the turn.

Syntax:

GOF
parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.TimeToDeadlineRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a TME DAIDE request. Sent by the client to request a TME message or to request it at a later time.

Syntax:

TME
TME (seconds)
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.DrawRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a DRW DAIDE request. Sent by the client to notify that the client would accept a draw.

Syntax:

DRW

LVL 10:

DRW (power power ...)
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.SendMessageRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a SND DAIDE request

Syntax:

SND (power ...) (press_message)
SND (power ...) (reply)
SND (turn) (power ...) (press_message)
SND (turn) (power ...) (reply)

Press message syntax:

PRP (arrangement)
CCL (press_message)
FCT (arrangement)
TRY (tokens)

Reply syntax:

YES (press_message)
REJ (press_message)
BWX (press_message)
HUH (press_message)
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.NotRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a NOT DAIDE request. Sent by the client to cancel a previous request.

Syntax:

NOT (SUB)                       # Cancel all submitted orders
NOT (SUB (order))               # Cancel specific submitted order
NOT (GOF)                       # Do not process orders until the deadline
NOT (TME)                       # Cancel all requested time messages
NOT (TME (seconds))             # Cancel specific requested time message
NOT (DRW)                       # Cancel all draw requests
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.AcceptRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a YES DAIDE request.

Syntax:

YES (MAP ('name'))
YES (SVE ('gamename'))
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.RejectRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a REJ DAIDE request.

Syntax:

REJ (SVE ('gamename'))
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.ParenthesisErrorRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a PRN DAIDE request. Sent by the client to specify an error in the set of parenthesis.

Syntax:

PRN (message)
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.SyntaxErrorRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a HUH DAIDE request. Sent by the client to specify an error in a message.

Syntax:

HUH (message)
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

class diplomacy.daide.requests.AdminMessageRequest(**kwargs)[source]

Bases: diplomacy.daide.requests.DaideRequest

Represents a ADM DAIDE request. Can be sent by the client to send a message to all clients. Should not be used for negotiation.

Syntax:

ADM ('message')
__init__(**kwargs)[source]

Constructor

parse_bytes(daide_bytes)[source]

Builds the request from DAIDE bytes

diplomacy.daide.requests.NME

alias of diplomacy.daide.requests.NameRequest

diplomacy.daide.requests.OBS

alias of diplomacy.daide.requests.ObserverRequest

diplomacy.daide.requests.IAM

alias of diplomacy.daide.requests.IAmRequest

diplomacy.daide.requests.HLO

alias of diplomacy.daide.requests.HelloRequest

diplomacy.daide.requests.MAP

alias of diplomacy.daide.requests.MapRequest

diplomacy.daide.requests.MDF

alias of diplomacy.daide.requests.MapDefinitionRequest

diplomacy.daide.requests.SCO

alias of diplomacy.daide.requests.SupplyCentreOwnershipRequest

diplomacy.daide.requests.NOW

alias of diplomacy.daide.requests.CurrentPositionRequest

diplomacy.daide.requests.HST

alias of diplomacy.daide.requests.HistoryRequest

diplomacy.daide.requests.SUB

alias of diplomacy.daide.requests.SubmitOrdersRequest

diplomacy.daide.requests.MIS

alias of diplomacy.daide.requests.MissingOrdersRequest

diplomacy.daide.requests.GOF

alias of diplomacy.daide.requests.GoFlagRequest

diplomacy.daide.requests.TME

alias of diplomacy.daide.requests.TimeToDeadlineRequest

diplomacy.daide.requests.DRW

alias of diplomacy.daide.requests.DrawRequest

diplomacy.daide.requests.SND

alias of diplomacy.daide.requests.SendMessageRequest

diplomacy.daide.requests.NOT

alias of diplomacy.daide.requests.NotRequest

diplomacy.daide.requests.YES

alias of diplomacy.daide.requests.AcceptRequest

diplomacy.daide.requests.REJ

alias of diplomacy.daide.requests.RejectRequest

diplomacy.daide.requests.PRN

alias of diplomacy.daide.requests.ParenthesisErrorRequest

diplomacy.daide.requests.HUH

alias of diplomacy.daide.requests.SyntaxErrorRequest

diplomacy.daide.requests.ADM

alias of diplomacy.daide.requests.AdminMessageRequest