network.ui package
Submodules
host_dialog module
Host Dialog
Dialog that lets the DM choose a port and start hosting a multiplayer session. Displays the machine’s LAN IP address so players know where to connect.
- class network.ui.host_dialog.HostDialog(settings=None, parent=None)
Bases:
QDialogDialog for configuring and starting a hosted multiplayer session.
- Parameters:
settings – Optional
SettingsManagerused to pre-fill the default port.parent – Parent widget.
- property port: int
The port number selected by the user.
join_dialog module
Join Dialog
Dialog that lets a player enter host address, port, and player name to connect to a hosted multiplayer session.
- class network.ui.join_dialog.JoinDialog(settings=None, parent=None)
Bases:
QDialogDialog for connecting to a remote multiplayer session.
- Parameters:
settings – Optional
SettingsManagerused to pre-fill host, port, and player name from saved preferences.parent – Parent widget.
- property host: str
The host address entered by the user.
- property player_name: str
The player name entered by the user (defaults to
"Player").
- property port: int
The port number selected by the user.
session_panel module
Session Panel
Dockable panel displayed during an active multiplayer session. Shows connection status, player list with claimed entities, a chat log with input field, and a disconnect button.
- class network.ui.session_panel.SessionPanel(parent=None)
Bases:
QWidgetPanel shown during an active multiplayer session.
Displays connection status, a player list with claimed entities, a chat area (read-only log + input field), and a disconnect button.
- Signals:
chat_submitted(str): Emitted when the user sends a chat message. disconnect_requested(): Emitted when the user clicks Disconnect.
- Parameters:
parent – Parent widget.
- add_player(player_id: str, name: str)
Add a player to the list.
- Parameters:
player_id (str) – Unique player identifier.
name (str) – Display name.
- append_chat(sender: str, message: str)
Append a message to the chat log.
- Parameters:
sender (str) – The display name of the sender.
message (str) – The chat text.
- chat_submitted
Emitted when the user sends a chat message (text).
- clear()
Reset the panel to its initial state.
- disconnect_requested
Emitted when the user clicks the Disconnect button.
- remove_player(player_id: str)
Remove a player from the list.
- Parameters:
player_id (str) – Unique player identifier.
- set_connected(session_id: str)
Update the status label for client mode.
- Parameters:
session_id (str) – A session identifier to display.
- set_entity_claim(entity_id: str, player_id: str)
Record that player_id has claimed entity_id.
- Parameters:
entity_id (str) – The entity’s unique identifier.
player_id (str) – The player who claimed it.
- set_hosting(address: str)
Update the status label for host mode.
- Parameters:
address (str) – The
host:portstring to display.