diplomacy.communication.notifications¶
Server -> Client notifications.
-
class
diplomacy.communication.notifications.AccountDeleted(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._ChannelNotificationNotification about an account deleted.
-
class
diplomacy.communication.notifications.OmniscientUpdated(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about a grade updated. Sent at channel level.
Properties:
- grade_update:
strOne of ‘promote’ or ‘demote’. - game:
parsing.JsonableClassType(Game)adiplomacy.engine.game.Gameobject.
- grade_update:
-
class
diplomacy.communication.notifications.ClearedCenters(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about centers cleared.
-
class
diplomacy.communication.notifications.ClearedOrders(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about orders cleared.
-
class
diplomacy.communication.notifications.ClearedUnits(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about units cleared.
-
class
diplomacy.communication.notifications.VoteCountUpdated(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about new count of draw votes for a game (for observers).
Properties:
- count_voted:
intnumber of powers that have voted. - count_expected:
intnumber of powers to be expected to vote.
- count_voted:
-
class
diplomacy.communication.notifications.VoteUpdated(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about votes updated for a game (for omniscient observers).
Properties:
- vote:
Dictmapping a power name to a Vote (str) object representing power vote. Possible votes are: yes, no, neutral.
- vote:
-
class
diplomacy.communication.notifications.PowerVoteUpdated(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications.VoteCountUpdatedNotification about a new vote for a specific game power (for player games).
Properties:
- vote:
strvote object representing associated power vote. Can be yes, no, neutral.
- vote:
-
class
diplomacy.communication.notifications.PowersControllers(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about current controller for each power in a game.
Properties:
- powers: A
Dictthat maps a power_name to a controller_namestr. - timestamps: A
Dictthat maps a power_name to timestamp where the controller took over.
- powers: A
-
class
diplomacy.communication.notifications.GameDeleted(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about a game deleted.
-
class
diplomacy.communication.notifications.GameProcessed(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about a game phase update. Sent after game has processed a phase.
Properties:
- previous_phase_data:
diplomacy.utils.game_phase_data.GamePhaseDataof the previous phase - current_phase_data:
diplomacy.utils.game_phase_data.GamePhaseDataof the current phase
- previous_phase_data:
-
class
diplomacy.communication.notifications.GamePhaseUpdate(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about a game phase update.
Properties:
- phase_data:
diplomacy.utils.game_phase_data.GamePhaseDataof the updated phase - phase_data_type:
str. One of ‘state_history’, ‘state’, ‘phase’
- phase_data:
-
class
diplomacy.communication.notifications.GameStatusUpdate(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about a game status update.
Properties:
-status:str. One of ‘forming’, ‘active’, ‘paused’, ‘completed’, ‘canceled’
-
class
diplomacy.communication.notifications.GameMessageReceived(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about a game message received.
Properties:
- message:
diplomacy.engine.message.Messagereceived.
- message:
-
class
diplomacy.communication.notifications.PowerOrdersUpdate(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about a power order update.
Properties:
- orders: List of updated orders (i.e.
str)
- orders: List of updated orders (i.e.
-
class
diplomacy.communication.notifications.PowerOrdersFlag(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about a power order flag update.
Properties:
- order_is_set:
int. O = ORDER_NOT_SET, 1 = ORDER_SET_EMPTY, 2 = ORDER_SET.
- order_is_set:
-
class
diplomacy.communication.notifications.PowerWaitFlag(**kwargs)[source]¶ Bases:
diplomacy.communication.notifications._GameNotificationNotification about a power wait flag update.
Properties:
- wait:
boolthat indicates to wait until the deadline is reached before proceeding. Otherwise if all powers are not waiting, the game is processed as soon as all non-eliminated powers have submitted their orders.
- wait: