Merge pull request #95860 from Goutte/doc-upnp-update-to-latest-gdscript

Docs: Update UPnP GDScript snippet to using `Signal.emit` syntax
This commit is contained in:
Rémi Verschelde 2024-08-26 23:29:06 +02:00
commit 8c0209fe33
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 2 deletions

View File

@ -31,13 +31,13 @@
if err != OK: if err != OK:
push_error(str(err)) push_error(str(err))
emit_signal("upnp_completed", err) upnp_completed.emit(err)
return return
if upnp.get_gateway() and upnp.get_gateway().is_valid_gateway(): if upnp.get_gateway() and upnp.get_gateway().is_valid_gateway():
upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "UDP") upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "UDP")
upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "TCP") upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "TCP")
emit_signal("upnp_completed", OK) upnp_completed.emit(OK)
func _ready(): func _ready():
thread = Thread.new() thread = Thread.new()