socha.api.protocol.protocol¶
Module Contents¶
Classes¶
A RoomMessage that can be received by observers. |
|
If the game is over the server will _send this message to the clients and closes the connection afterward. |
|
Request a client to _send a Move. |
|
Is sent by one party immediately before this party closes the communication connection and should make the |
|
Authenticates a client as administrator to _send AdminLobbyRequest`s. |
|
Deletes the GameRoom and cancels the Game within. |
|
Sent to all administrative clients after a player joined a GameRoom via a JoinRoomRequest. |
|
Sent to client as response to successfully joining a GameRoom as Observer. |
|
Indicates to observers that the game has been (un)paused. |
|
Slots for a game which contains the player's name and its attributes. |
|
When the client is authenticated as administrator, |
|
When the client is authenticated as administrator, |
|
Joins any room that is open. |
|
Join a prepared room with a reservation code. |
|
To join a room with a room_id. |
|
This holds the fragments of a winning definition. |
|
Sent to all clients after a player joined a GameRoom via a Join Request. |
|
Score of the players when the game has ended. |
|
The definition of a result of a game. |
|
Is _send when a game is won by one of the players. |
|
Then result of a game when its over. |
|
Welcome message is sent to the client when the client joins the room. |
|
Result of a game. |
|
The original message that was sent by the client. |
|
This sends the server when the client sent a erroneous message. |
|
A RoomMessage that does not concern the progress of the game. |
|
A RoomMessage that does not concern the progress of the game. |
|
This is the root element of the protocol. |
- class socha.api.protocol.protocol.LastAction¶
-
- class_value: str | None¶
- class_binding: object | None¶
- distance: int | None¶
- card: List[str] | None¶
- amount: int | None¶
- value: str¶
- class socha.api.protocol.protocol.LastMove¶
-
- class_value: str | None¶
- class_binding: object | None¶
- distance: int | None¶
- card: List[str] | None¶
- amount: int | None¶
- class socha.api.protocol.protocol.Hare¶
-
- team: str | None¶
- position: int | None¶
- salads: int | None¶
- carrots: int | None¶
- last_action: LastAction | None¶
- class socha.api.protocol.protocol.State¶
Bases:
socha.api.protocol.room_message.ObservableRoomMessageA RoomMessage that can be received by observers.
- class_value: str | None¶
- start_team: str | None¶
- turn: int | None¶
- class socha.api.protocol.protocol.OriginalRequest¶
Bases:
socha.api.protocol.protocol_packet.ProtocolPacket- class_value: str | None¶
- reservation_code: str | None¶
- class socha.api.protocol.protocol.Errorpacket¶
Bases:
socha.api.protocol.protocol_packet.ProtocolPacket- message: str | None¶
- original_request: OriginalRequest | None¶
- class socha.api.protocol.protocol.Left¶
Bases:
socha.api.protocol.protocol_packet.ProtocolPacketIf the game is over the server will _send this message to the clients and closes the connection afterward.
- room_id: str | None¶
- class socha.api.protocol.protocol.MoveRequest¶
Bases:
socha.api.protocol.room_message.RoomMessageRequest a client to _send a Move.
- class socha.api.protocol.protocol.Close¶
Bases:
socha.api.protocol.protocol_packet.ProtocolPacketIs sent by one party immediately before this party closes the communication connection and should make the receiving party also close the connection.
This should not be sent manually, the XFluxClient will automatically _send it when stopped.
- class socha.api.protocol.protocol.Authenticate¶
Bases:
socha.api.protocol.protocol_packet.AdminLobbyRequestAuthenticates a client as administrator to _send AdminLobbyRequest`s. Is not answered if successful.
- password: str | None¶
- class socha.api.protocol.protocol.Cancel¶
Bases:
socha.api.protocol.protocol_packet.AdminLobbyRequestDeletes the GameRoom and cancels the Game within.
- room_id: str | None¶
- class socha.api.protocol.protocol.JoinedGameRoom¶
Bases:
socha.api.protocol.room_message.ObservableRoomMessageSent to all administrative clients after a player joined a GameRoom via a JoinRoomRequest.
- room_id: str | None¶
- player_count: int | None¶
- class socha.api.protocol.protocol.Observe¶
Bases:
socha.api.protocol.protocol_packet.AdminLobbyRequestSent to client as response to successfully joining a GameRoom as Observer.
- room_id: str | None¶
- class socha.api.protocol.protocol.Pause¶
Bases:
socha.api.protocol.protocol_packet.AdminLobbyRequestIndicates to observers that the game has been (un)paused.
- room_id: str | None¶
- pause: bool | None¶
- class socha.api.protocol.protocol.Slot¶
Bases:
socha.api.protocol.room_message.RoomOrchestrationMessageSlots for a game which contains the player’s name and its attributes.
- display_name: str | None¶
- can_timeout: bool | None¶
- reserved: bool | None¶
- class socha.api.protocol.protocol.Step¶
Bases:
socha.api.protocol.room_message.RoomOrchestrationMessageWhen the client is authenticated as administrator, it can _send this step request to the server to advance the game for one move. This is not possible if the game is not paused.
- room_id: str | None¶
- class socha.api.protocol.protocol.Prepare¶
Bases:
socha.api.protocol.room_message.RoomOrchestrationMessageWhen the client is authenticated as administrator, it can _send this request to prepare the room for the game.
- game_type: str | None¶
- pause: bool | None¶
- class socha.api.protocol.protocol.Join¶
Bases:
socha.api.protocol.protocol_packet.LobbyRequestJoins any room that is open. If no room is open, a new room is created by the server.
- class socha.api.protocol.protocol.JoinPrepared¶
Bases:
socha.api.protocol.protocol_packet.LobbyRequestJoin a prepared room with a reservation code.
- reservation_code: str | None¶
- class socha.api.protocol.protocol.JoinRoom¶
Bases:
socha.api.protocol.protocol_packet.LobbyRequestTo join a room with a room_id.
- room_id: str | None¶
- class socha.api.protocol.protocol.Fragment¶
This holds the fragments of a winning definition.
- name: str | None¶
- aggregation: str | None¶
- relevant_for_ranking: bool | None¶
- class socha.api.protocol.protocol.Joined¶
Bases:
socha.api.protocol.protocol_packet.ResponsePacketSent to all clients after a player joined a GameRoom via a Join Request.
- room_id: str | None¶
- class socha.api.protocol.protocol.Score¶
Score of the players when the game has ended.
- part: List[int]¶
- class socha.api.protocol.protocol.Winner¶
-
- team: str | None¶
- regular: bool | None¶
- reason: str | None¶
- class socha.api.protocol.protocol.Definition¶
The definition of a result of a game. If for instance one player made an error move, the game is over and the other player wins, the definition will tell that the other player wins, because of the error.
- class socha.api.protocol.protocol.Entry¶
Is _send when a game is won by one of the players. This element contains the winning player and the score of the player.
- class socha.api.protocol.protocol.Scores¶
Then result of a game when its over.
- class socha.api.protocol.protocol.WelcomeMessage¶
Bases:
socha.api.protocol.room_message.RoomOrchestrationMessageWelcome message is sent to the client when the client joins the room. In this message the server tells the client which team it is.
- team: socha._socha.TeamEnum¶
- class socha.api.protocol.protocol.Result¶
Bases:
socha.api.protocol.room_message.ObservableRoomMessageResult of a game. This will the server _send after a game is finished.
- definition: Definition¶
- class socha.api.protocol.protocol.OriginalMessage¶
The original message that was sent by the client. Is sent by the server if an error occurs.
- class_value: str | None¶
- distance: int | None¶
- card: List[str]¶
- class socha.api.protocol.protocol.Error¶
This sends the server when the client sent a erroneous message.
- message: str¶
- originalMessage: OriginalMessage¶
- class socha.api.protocol.protocol.Data¶
-
- class_value: str | None¶
- class_binding: object | None¶
- definition: Definition | None¶
- original_message: OriginalMessage | None¶
- distance: int | None¶
- card: List[str] | None¶
- amount: int | None¶
- color: str | None¶
- class socha.api.protocol.protocol.Room¶
Bases:
socha.api.protocol.protocol_packet.ProtocolPacket- room_id: str | None¶
- class socha.api.protocol.protocol.Observed¶
Bases:
socha.api.protocol.room_message.RoomOrchestrationMessageA RoomMessage that does not concern the progress of the game.
- room_id: str | None¶
- class socha.api.protocol.protocol.Prepared¶
Bases:
socha.api.protocol.room_message.RoomOrchestrationMessageA RoomMessage that does not concern the progress of the game.
- room_id: str | None¶
- reservation: List[str]¶
- class socha.api.protocol.protocol.Protocol¶
This is the root element of the protocol. Even it’s in here it will never be called, because the children of this root element have to be handled separately.
- authenticate: Authenticate | None¶
- joined_game_room: JoinedGameRoom | None¶