mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
classref: Sync with current master branch (5ee9831)
This commit is contained in:
@@ -35,7 +35,7 @@ The following example augment the default implementation (:ref:`SceneMultiplayer
|
||||
var base_multiplayer = SceneMultiplayer.new()
|
||||
|
||||
func _init():
|
||||
# Just passthourgh base signals (copied to var to avoid cyclic reference)
|
||||
# Just passthrough base signals (copied to var to avoid cyclic reference)
|
||||
var cts = connected_to_server
|
||||
var cf = connection_failed
|
||||
var pc = peer_connected
|
||||
@@ -45,13 +45,16 @@ The following example augment the default implementation (:ref:`SceneMultiplayer
|
||||
base_multiplayer.peer_connected.connect(func(id): pc.emit(id))
|
||||
base_multiplayer.peer_disconnected.connect(func(id): pd.emit(id))
|
||||
|
||||
func _poll():
|
||||
return base_multiplayer.poll()
|
||||
|
||||
# Log RPC being made and forward it to the default multiplayer.
|
||||
func _rpc(peer: int, object: Object, method: StringName, args: Array) -> int: # Error
|
||||
func _rpc(peer: int, object: Object, method: StringName, args: Array) -> Error:
|
||||
print("Got RPC for %d: %s::%s(%s)" % [peer, object, method, args])
|
||||
return base_multiplayer.rpc(peer, object, method, args)
|
||||
|
||||
# Log configuration add. E.g. root path (nullptr, NodePath), replication (Node, Spawner|Synchronizer), custom.
|
||||
func _object_configuration_add(object, config: Variant) -> int: # Error
|
||||
func _object_configuration_add(object, config: Variant) -> Error:
|
||||
if config is MultiplayerSynchronizer:
|
||||
print("Adding synchronization configuration for %s. Synchronizer: %s" % [object, config])
|
||||
elif config is MultiplayerSpawner:
|
||||
@@ -59,7 +62,7 @@ The following example augment the default implementation (:ref:`SceneMultiplayer
|
||||
return base_multiplayer.object_configuration_add(object, config)
|
||||
|
||||
# Log configuration remove. E.g. root path (nullptr, NodePath), replication (Node, Spawner|Synchronizer), custom.
|
||||
func _object_configuration_remove(object, config: Variant) -> int: # Error
|
||||
func _object_configuration_remove(object, config: Variant) -> Error:
|
||||
if config is MultiplayerSynchronizer:
|
||||
print("Removing synchronization configuration for %s. Synchronizer: %s" % [object, config])
|
||||
elif config is MultiplayerSpawner:
|
||||
|
||||
Reference in New Issue
Block a user