Add direct-connect multiplayer foundation
This commit is contained in:
parent
9e9850dd20
commit
24f8263175
36 changed files with 2633 additions and 45 deletions
24
network/connection_route.gd
Normal file
24
network/connection_route.gd
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
class_name ConnectionRoute
|
||||
extends RefCounted
|
||||
|
||||
enum Kind {
|
||||
DIRECT,
|
||||
}
|
||||
|
||||
var kind: Kind = Kind.DIRECT
|
||||
var direct_endpoint: ConnectionEndpoint
|
||||
var display_description: String = ""
|
||||
|
||||
|
||||
static func direct(endpoint: ConnectionEndpoint) -> ConnectionRoute:
|
||||
var route := ConnectionRoute.new()
|
||||
route.kind = Kind.DIRECT
|
||||
route.direct_endpoint = endpoint
|
||||
route.display_description = (
|
||||
endpoint.normalized_display if endpoint != null else ""
|
||||
)
|
||||
return route
|
||||
|
||||
|
||||
func is_valid() -> bool:
|
||||
return kind == Kind.DIRECT and direct_endpoint != null and direct_endpoint.is_valid()
|
||||
Loading…
Add table
Add a link
Reference in a new issue