2026-07-29 15:01:46 -04:00
|
|
|
class_name NetworkTransport
|
|
|
|
|
extends Node
|
|
|
|
|
|
2026-08-09 13:31:30 -04:00
|
|
|
@warning_ignore("unused_signal")
|
2026-07-29 15:01:46 -04:00
|
|
|
signal transport_error(message: String)
|
|
|
|
|
|
|
|
|
|
var _peer: MultiplayerPeer
|
|
|
|
|
var _route_description: String = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func start_host(
|
|
|
|
|
_port: int,
|
|
|
|
|
_max_clients: int,
|
|
|
|
|
_bind_address: String = "*",
|
|
|
|
|
) -> Error:
|
|
|
|
|
return ERR_UNAVAILABLE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func connect_to_route(_route: ConnectionRoute) -> Error:
|
|
|
|
|
return ERR_UNAVAILABLE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func disconnect_transport() -> void:
|
|
|
|
|
if _peer != null:
|
|
|
|
|
_peer.close()
|
|
|
|
|
_peer = null
|
|
|
|
|
_route_description = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func get_multiplayer_peer() -> MultiplayerPeer:
|
|
|
|
|
return _peer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func get_route_description() -> String:
|
|
|
|
|
return _route_description
|