seika.network

Network

Interface for network related operations for multiplayer.

Properties

None.


Signals

Server and Client signals.

peer_connected

Emitted once a peer is connected to the Server.

peer_disconnected

Emitted once a peer is disconnected from the Server.

message_received

Emitted once a message is received from the network.

Client only signals.

connected_to_server

Emitted once a client successfully connects to a Server.

connection_to_server_failed

Emitted once a client fails to connect to a Server.


Methods

@staticmethod
connect_signal(signal_id: str, listener_node: seika.node.Node, function_name: str) -> None:

Connects to network related signal.


Server

Interface for server related operations for multiplayer.

Properties

None.


Signals

None.


Methods

@staticmethod
start(port: int) -> None:

Starts server on designated port.

@staticmethod
stop() -> None:

Stops previously started server.

@staticmethod
send_message_to_all_clients(message: str) -> None:

Sends message to all connected clients.


Client

Interface for client related operations for multiplayer.

Properties

None.


Signals

None.


Methods

@staticmethod
connect(endpoint: str, port: int) -> None:

Connects to a server with the passed in endpoint and port.

@staticmethod
disconnect() -> None:

Disconnects from a server.

@staticmethod
send_message_to_server(message:str) -> None:

Sends message to the server.