Add direct-connect multiplayer foundation
This commit is contained in:
parent
9e9850dd20
commit
24f8263175
36 changed files with 2633 additions and 45 deletions
34
network/network_transport.gd
Normal file
34
network/network_transport.gd
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
class_name NetworkTransport
|
||||
extends Node
|
||||
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue