u
This commit is contained in:
@@ -248,18 +248,18 @@ Listens for connection attempts from standard Minecraft Java clients.
|
||||
|
||||
Manages bidirectional packet pipelines when in `CLIENT_MODE`.
|
||||
|
||||
| Method | Description |
|
||||
|---|---|
|
||||
| `constructor(client, serverConn, worldState)` | Initializes bridge with client, server connection, and world state references. |
|
||||
| `_getViewDistance()` | Resolves the view distance from configuration or state records. |
|
||||
| `_syncClientViewFromBlockCoords(blockX, blockZ)` | Computes chunk coordinates and updates client view center position. |
|
||||
| `_syncClientViewFromBot()` | Aligns client view center with the bot entity position. |
|
||||
| `_playerBlockCoordsForView()` | Returns coordinates representing the client player's view anchor. |
|
||||
| `_ensureViewIncludesChunk(chunkX, chunkZ)` | Ensures the client's view includes target coordinates prior to sending map chunks. |
|
||||
| `enableMovement()` | Authorizes client movement and syncs view center alignment. |
|
||||
| `start()` | Sets up packet intercept listeners to route packets between legs, excluding blocked elements (e.g. `keep_alive`, `teleport_confirm`, `message_acknowledgement`) and re-signing client chat events. |
|
||||
| `_shouldForwardPlayerInfo(data)` | Filters latency updates for unknown players. |
|
||||
| `stop()` | Tears down the forwarding pipe. |
|
||||
| Method | Description |
|
||||
| --------------------------------------------------| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `constructor(client, serverConn, worldState)` | Initializes bridge with client, server connection, and world state references. |
|
||||
| `_getViewDistance()` | Resolves the view distance from configuration or state records. |
|
||||
| `_syncClientViewFromBlockCoords(blockX, blockZ)` | Computes chunk coordinates and updates client view center position. |
|
||||
| `_syncClientViewFromBot()` | Aligns client view center with the bot entity position. |
|
||||
| `_playerBlockCoordsForView()` | Returns coordinates representing the client player's view anchor. |
|
||||
| `_ensureViewIncludesChunk(chunkX, chunkZ)` | Ensures the client's view includes target coordinates prior to sending map chunks. |
|
||||
| `enableMovement()` | Authorizes client movement and syncs view center alignment. |
|
||||
| `start()` | Sets up packet intercept listeners to route packets between legs, excluding blocked elements (e.g. `keep_alive`, `teleport_confirm`, `message_acknowledgement`) and re-signing client chat events. |
|
||||
| `_shouldForwardPlayerInfo(data)` | Filters latency updates for unknown players. |
|
||||
| `stop()` | Tears down the forwarding pipe. |
|
||||
|
||||
---
|
||||
|
||||
@@ -283,17 +283,17 @@ Master coordinator for world cache segments. Integrates and clears sub-caches on
|
||||
|
||||
#### 🧩 [ChunkCache](file:///home/seb/flayerproxy/src/state/ChunkCache.js) `class`
|
||||
|
||||
Manages loaded map chunks using an LRU cache; block and light updates are merged into chunk columns.
|
||||
Manages loaded map chunks, light maps, and block overlays using an LRU cache.
|
||||
|
||||
| Method | Description |
|
||||
|---|---|
|
||||
| `constructor(maxChunks)` | Initializes chunk storage with LRU capacity limit. |
|
||||
| `_key(x, z)` | Computes string key for map lookups. |
|
||||
| `handleMapChunk(data, rawBuffer)` | Caches chunk data and marks it as active in the LRU tracking queue. |
|
||||
| `handleUpdateLight(data)` | Merges light updates into the cached chunk column. |
|
||||
| `handleUpdateLight(data, rawBuffer)` | Caches light updates. |
|
||||
| `handleUnloadChunk(data)` | Evicts chunk records from cache. |
|
||||
| `handleBlockChange(data)` | Merges single block changes into the cached chunk column. |
|
||||
| `handleMultiBlockChange(data)` | Merges section block updates into the cached chunk column. |
|
||||
| `handleBlockChange(data)` | Appends single block changes as an overlay. |
|
||||
| `handleMultiBlockChange(data)` | Appends multiblock edits as an overlay. |
|
||||
| `_buildChunkEntry(chunkData)` | Assembles raw data, block edits, and light arrays. |
|
||||
| `getChunksForReplay(centerChunkX, centerChunkZ, viewDistance)` | Returns cached chunks sorting closest-first. |
|
||||
| `hasChunkAtBlock(x, z)` | Verifies if a chunk is loaded. |
|
||||
@@ -459,7 +459,7 @@ Replays the cached world state to a connecting client.
|
||||
|
||||
| Function | Description |
|
||||
|---|---|
|
||||
| `replayChunks(write, writeRaw, chunks, center, totalCached)` | Loops through chunk arrays, sending map_chunk buffers (block/light edits already merged), and issues a final `chunk_batch_finished` packet. |
|
||||
| `replayChunks(write, writeRaw, chunks, center, totalCached)` | Loops through chunk arrays, sending raw chunk/light buffers and block overlay edits, and issues a final `chunk_batch_finished` packet. |
|
||||
|
||||
#### 📄 [replayHelpers.js](file:///home/seb/flayerproxy/src/replay/replayHelpers.js) `functions`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user