M2.6: server rules (PvP, raiding, locks and friends, death penalty, difficulty, wolf grace), chat, admin commands, server console

This commit is contained in:
Paul Bailey
2026-11-04 22:54:40 +00:00
parent 47fc116839
commit 2ab79b68c6
26 changed files with 1195 additions and 57 deletions

View File

@@ -36,10 +36,17 @@ func setup(w: Node3D) -> void:
Net.player_left.connect(func(n): Actions.notify.emit("%s left" % n))
if Net.world_info.has("day"):
_on_clock(int(Net.world_info.day), float(Net.world_info.time))
# An admin's /weather (otherwise the weather follows from seed and clock).
Net.weather_changed.connect(_on_weather)
if not String(Net.world_info.get("weather", "")).is_empty():
_on_weather(String(Net.world_info.weather))
func _on_weather(state: String) -> void:
world.weather.force(state)
func _exit_tree() -> void:
for sig in [[Net.snapshot, _on_snapshot], [Net.corrected, _on_corrected], [Net.clock, _on_clock],
[Net.players_changed, _sync_avatars]]:
[Net.players_changed, _sync_avatars], [Net.weather_changed, _on_weather]]:
if (sig[0] as Signal).is_connected(sig[1]):
(sig[0] as Signal).disconnect(sig[1])