diff --git a/README.md b/README.md index d4ec28417342a13b21fe0129d3034247a08ccbb2..81a144b4509c53f00ac09f956f5bb6a5aae33c00 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ IvmiScene provides a number of settings to help you design immersive instruments * XR Mode * ... + ### IVMI-node IVMI-node are the main components of any IVMI instruments. IVMI-node contains IVMI-properties. By inheriting IVMI-node.gd you are able to define a specific behavior/feedback for each IVMI-property change that occur within the node. You can for example write a code that change the size of the node's mesh when the node is selected. @@ -115,18 +116,21 @@ IVMI-node are the main components of any IVMI instruments. IVMI-node contains IV extends IvmiNode func _ready(): - #Optionally define a node type + # Call default IvmiNode constructor + super._ready() + + # Optionally define a node type _set_ivmi_type("my_node") - #Add custom properties with array of values + # Add custom properties with array of values _add_property("selected", [0]) -func set_property(prop, vals) : - #call default properties handling - super.set_property(prop, vals) +func _set_property(prop, vals) : + # Call default properties handling + super._set_property(prop, vals) - #handle custom properties + # Handle custom properties if prop == "selected": if vals[0]: get_node("MeshInstance").scale.x = 3 diff --git a/core/IvmiScene.gd b/core/IvmiScene.gd index c56a78ff712bf80881884b25ce903f5031565e02..be13df74409d66fdcf932055fafa2c3098f81491 100644 --- a/core/IvmiScene.gd +++ b/core/IvmiScene.gd @@ -278,11 +278,13 @@ func _on_found_server(server_ip, port) : #_network_client.connect_to_server(server_ip, port) pass NetProto.Enet : - print("IVMI : Connecting to server ", server_ip, " ", port) - var peer = ENetMultiplayerPeer.new() - peer.create_client(server_ip, port) - multiplayer.multiplayer_peer = peer - multiplayer.connected_to_server.connect(_on_network_ready) + if !_is_connected or _server_ip!=server_ip : + print("IVMI : Connecting to server ", server_ip, " ", port) + var peer = ENetMultiplayerPeer.new() + _server_ip=server_ip + peer.create_client(server_ip, port) + multiplayer.multiplayer_peer = peer + multiplayer.connected_to_server.connect(_on_network_ready) func _on_timeout() : diff --git a/core/net/IvmiDiscov.gd b/core/net/IvmiDiscov.gd index 2bf8d102c28b649f3a029d5d8370dcdc49845219..c80801c40cb9706071ac3f571fe2812d65972349 100644 --- a/core/net/IvmiDiscov.gd +++ b/core/net/IvmiDiscov.gd @@ -25,8 +25,11 @@ func start() : print("IVMI : Starting Network Discovery") var mcadd = "239.215.216.217" var mcprt = 8173 + if _is_server : + _osc_discov.set_output(mcadd, mcprt) + else : + _osc_discov.set_input_port(mcprt) _osc_discov.set_multicast(mcadd) - _osc_discov.set_output(mcadd, mcprt) #retrieve local address _local_addr = "127.0.0.1" @@ -39,7 +42,7 @@ func _process(delta) : if _is_server : _ping_time+=delta if _ping_time>5.0 : - _osc_discov.send_msg("/ivmi/hello_from_server","s",[_local_addr, _port]) + _osc_discov.send_msg("/ivmi/hello_from_server","sf",[_local_addr, _port]) _ping_time=0 while _osc_discov.has_msg() : var msg = _osc_discov.get_msg()