mirror of
https://github.com/thegatesbrowser/godot-multiplayer.git
synced 2025-10-16 02:03:43 -04:00
ip address usage
This commit is contained in:
parent
ceb10e9a06
commit
2f3b80fffa
4 changed files with 132 additions and 15 deletions
|
@ -42,10 +42,14 @@ func start_server() -> void:
|
|||
multiplayer.peer_disconnected.connect(peer_disconnected)
|
||||
|
||||
|
||||
func start_client() -> void:
|
||||
var address = host
|
||||
if OS.has_feature("editor") and use_localhost_in_editor:
|
||||
address = "localhost"
|
||||
func start_client(ip_address: String = "") -> void:
|
||||
var address = ip_address
|
||||
if address.is_empty():
|
||||
address = host
|
||||
if OS.has_feature("editor") and use_localhost_in_editor:
|
||||
address = "localhost"
|
||||
|
||||
print("Connecting to server at: " + address)
|
||||
|
||||
var peer = ENetMultiplayerPeer.new()
|
||||
var err = peer.create_client(address, port)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue