mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
27 lines
807 B
GDScript
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()}
|