Files
2026-08-21 18:52:07 +01:00

27 lines
807 B
GDScript

class_name NetTransport
extends RefCounted
# Narrow construction boundary for Godot's MultiplayerPeer implementations.
# NetworkManager owns polling, RPC policy, and lifecycle; a transport only
# creates a peer. Keeping that split means ENet remains a first-class path
# while Steam can use SDR without duplicating the rest of the networking code.
func transport_id() -> String:
return ""
func is_available() -> bool:
return false
func unavailable_reason() -> String:
return "transport is unavailable"
func create_server(_port: int, _max_clients: int) -> Dictionary:
return {"error": ERR_UNAVAILABLE, "peer": null, "reason": unavailable_reason()}
func create_client(_address: String, _port: int) -> Dictionary:
return {"error": ERR_UNAVAILABLE, "peer": null, "reason": unavailable_reason()}