J3c: a land server stopping tells its players and is started afresh when they rejoin; the extra ports to forward on the Host page, the hosting message, the server log and HOSTING.md
This commit is contained in:
@@ -963,6 +963,7 @@ func _on_server_disconnected() -> void:
|
||||
if was == "connecting":
|
||||
_fail(reason if not reason.is_empty() else "the server hung up") # (the next land wouldn't have us)
|
||||
return # (the land we're leaving letting us go)
|
||||
var land_name := on_land()
|
||||
stop_hosting()
|
||||
stop()
|
||||
if was == "connecting":
|
||||
@@ -970,8 +971,19 @@ func _on_server_disconnected() -> void:
|
||||
join_failed.emit(last_reason)
|
||||
else:
|
||||
last_reason = reason if not reason.is_empty() else "The server closed the connection"
|
||||
if reason.is_empty() and not land_name.is_empty():
|
||||
# (Another land's server went: the rest of the server's still up,
|
||||
# and joining again starts that land's server afresh.)
|
||||
last_reason = "Lost the connection to the %s. Join the server again to carry on there." % \
|
||||
preload("res://scripts/world/terrain.gd").worldlet_name(land_name)
|
||||
left.emit(last_reason)
|
||||
|
||||
## Client: the land we're in when it's not the server's home land (we're on
|
||||
## one of its other lands' servers), else "".
|
||||
func on_land() -> String:
|
||||
var here := String(world_info.get("worldlet", ""))
|
||||
return here if not here.is_empty() and here != String(server_info.get("worldlet", here)) else ""
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
if what == NOTIFICATION_WM_CLOSE_REQUEST or what == NOTIFICATION_PREDELETE:
|
||||
if _peer != null:
|
||||
|
||||
Reference in New Issue
Block a user