J3b: chat, the player list (with each player's land) and admin commands across lands; sleep needs everyone in every land, with a 'waiting for everyone else' message

This commit is contained in:
Paul Bailey
2026-11-06 23:42:50 +00:00
parent 85bbed249b
commit 86ebe07899
9 changed files with 404 additions and 27 deletions

View File

@@ -194,9 +194,18 @@ func open() -> void:
get_tree().paused = not _online # a shared world can't be paused by one player
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
if _online:
# Everyone on the server, in whichever land (J3b), with where they are
# once anyone's somewhere else.
var all: Array = Net.everyone()
var lands := {}
for p in all:
lands[String(p.get("land", ""))] = true
var names: Array[String] = []
for p in Net.players.values():
names.append(String(p.name) + (" (admin)" if p.get("admin", false) else ""))
for p in all:
var where := ""
if lands.size() > 1 and not String(p.get("land", "")).is_empty():
where = " · %s" % preload("res://scripts/world/terrain.gd").worldlet_name(String(p.land))
names.append(String(p.name) + (" (admin)" if p.get("admin", false) else "") + where)
names.sort()
_players_label.text = "%s · %d online\n%s" % [Net.server_info.get("server_name", "Server"), names.size(), ", ".join(names)]