Commit graph

12 commits

Author SHA1 Message Date
28c11e2fc2 Bound connection outbound queues 2026-08-10 23:00:20 +03:00
ca019756ec Add vanilla parity harness and harden server boundaries 2026-08-10 22:54:16 +03:00
Master290
57214fbd76 Run the world clock so day and night happen
set_time was declared nowhere and sent never, so the client's sky was frozen
wherever it started: the sun did not move, night did not fall, and nothing in
the world had a time.

26.1.2 replaced the old (gameTime, dayTime, doDaylightCycle) triple with a
registry of named clocks. The packet now carries a fixed-width game time plus a
map from world clock to (totalTicks, partialTick, rate); the client advances
each clock locally at its rate and drives the minecraft:day timeline -- a
keyframe track over a 24000-tick period -- from the overworld clock. The clock
registry is already among the 28 we sync, so the id is looked up rather than
hardcoded and the server refuses to start if it is missing.

The counter rides the entity tick loop because that is the only loop already
running at 20 TPS. It belongs on the single authoritative tick the engine still
needs; putting a sixth ticker beside the five that exist would make that worse.
Broadcast every second, which is what vanilla does -- the client interpolates in
between, so the resend only corrects drift.

The clock also persists now. The world metadata file was written once and never
touched again; it is atomically rewritable, carries gameTime and dayTime, and a
file written before those fields existed still opens and resumes at dawn as it
did. Saved every 30 seconds alongside the chunk autosave, and once more on
shutdown after the final flush.
2026-07-27 02:45:28 +03:00
Master290
4453bdeb55 Gate entities on client chunk residency 2026-07-21 11:25:24 +03:00
Master290
2b07d6be20 Fix terrain streaming and surface spawning 2026-07-21 11:11:19 +03:00
Master290
f0279cdb65 Fix add entity velocity encoding 2026-07-21 10:30:28 +03:00
Master290
6413216876 Fix default spawn packet layout 2026-07-21 10:22:31 +03:00
Master290
cae06eb97e Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
Master290
09a694daf5 Add gravity and player-seeking AI to zombies 2026-06-27 21:16:39 +03:00
Master290
7af0acd3a3 Add basic entity tracking, mob spawning and syncing 2026-06-27 21:13:20 +03:00
Master290
d7c80a8858 Background predictive chunk streaming
Chunk generation and sending no longer block the read loop. The read
loop pushes a non-blocking recenter request and stays free to handle
movement, chat, and keep-alive acks immediately; a per-connection
streamer goroutine generates chunks in a worker pool and sends them
serially under the write mutex.

- network/streamer.go: per-connection streamer. spiralOrder emits
  chunks centre-outward; parallelSend fans Cache.Frame across a worker
  pool (Cache.Frame is already goroutine-safe), parallelGenerate warms
  a one-ring predictive border so movement finds ready chunks; the
  loaded-set is owned solely by the streamer.
- network/play.go: beginPlay launches the streamer and pushes an
  initial recenter instead of the old blocking streamAround;
  onPlayerMove now just calls requestRecenter (non-blocking).
- network/handler.go: ctx (connection lifetime) + streamer field; the
  streamer stops when the read loop ends (cancel on serve exit).
- network/configuration.go: client view_distance is saved (clamped
  2..16) and drives the streamer radius.
- Tests: spiral order (centre-first, ring structure) and the
  non-blocking recenter guarantee the read loop relies on.
2026-06-25 00:54:57 +03:00
Master290
a7bb9496ae Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775)
Vanilla-faithful overworld generator (final_density + multi-noise biomes),
full connection lifecycle (status/login/configuration/play), chunk streaming,
creative block editing, and the protocol/nbt/registry infrastructure.
2026-06-24 00:32:51 +03:00