spoint 0.1.669 → 0.1.671
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sdk/TickHandler.js +7 -0
package/package.json
CHANGED
package/src/sdk/TickHandler.js
CHANGED
|
@@ -132,6 +132,13 @@ function processPlayerMovement(players, deps, tick, dt, playerIdleCounts, player
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
|
|
135
|
+
// Player-LOD tiering scratch (see classifyPlayerTiers/filterEncodedPlayersTiered): rebuilt once per
|
|
136
|
+
// buildAndSendSnapshots call (module-level to avoid a fresh Map allocation every tick, same pooling
|
|
137
|
+
// pattern as TickHandlerAOI.js's _spatialCache/_cellPackCache).
|
|
138
|
+
const _playersByIdScratch = new Map()
|
|
139
|
+
const _packWrapper = { type: MSG.SNAPSHOT, payload: null }
|
|
140
|
+
const _packPayload = { seq: 0, tick: 0, serverTime: 0, players: null, entities: null, removed: undefined, delta: 1, dots: undefined }
|
|
141
|
+
|
|
135
142
|
function packSnapshot(seq, encoded) {
|
|
136
143
|
_packPayload.seq = seq; _packPayload.tick = encoded.tick; _packPayload.serverTime = encoded.serverTime
|
|
137
144
|
_packPayload.players = encoded.players; _packPayload.entities = encoded.entities
|