ip address usage

This commit is contained in:
Ethan Weber 2025-07-12 12:46:39 -06:00
parent ceb10e9a06
commit 2f3b80fffa
4 changed files with 132 additions and 15 deletions

View file

@ -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)