Class DrawLimits
Wire lockstep. Every constant here mirrors one in
NXTLibrary/src/overlay/DrawTypes.h (or kDrawBatchMax in
src/rpc/Handlers.cpp). Changing a cap on the producer means changing
it here in the same logical change; these are the producer's numbers, not
this host's policy.
Every cap a single call can hit is an explicit producer-side error rather
than a silent truncation — with one exception, documented on
RESOLVED_COMPONENTS_PER_TICK.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe footprint a highlighted entity or tile gets when the caller names none, in tiles.static final longThe TTL the producer applies when a command omitsttl_ms.static final intMost items onedebug_draw_set_batchaccepts.static final intRetained commands per producer, across every connected client.static final intMost decimal places a fixed-point caption may be scaled by.static final intLargest width or height a rect or ellipse may have.static final intLongest key the producer stores, in UTF-8 bytes — its buffer is 48 bytes including the NUL.static final intHighest plane a world highlight may name.static final intRetainedpolycommands, across every connected client.static final intMost points a polyline may have.static final intLargest absolute value a screen coordinate may take.static final intRetainedtextcommands, across every connected client.static final intLongest text atextcommand may carry, in UTF-16 code units — the producer converts the UTF-8 payload into a 128-unit wide buffer and fails the command rather than truncating when it will not fit.static final intThickest stroke.static final intLargest absolute value a world coordinate may take, in wire sub-tiles.static final intLargest absolute value a tile coordinate or tile extent may take, for thehighlight_*calls that speak whole tiles rather than sub-tiles.static final intHighest paint order.static final intLowest plane a world highlight may name.static final intFewest points a polyline may have.static final intThinnest stroke.static final intLowest paint order.static final intComponent highlights the producer re-resolves per tick.static final intFixed-point sub-tile divisions per tile, forDrawSpace.WORLDgeometry.static final longTTL meaning "until replaced, cleared, or my connection closes". -
Method Summary
-
Field Details
-
MAX_KEY_BYTES
public static final int MAX_KEY_BYTESLongest key the producer stores, in UTF-8 bytes — its buffer is 48 bytes including the NUL.Two different counters are called
droppedand an over-long key lands in one but not the other, so be specific about which you are reading: the producer rejects the key before its store is touched, so it never reachesDrawStats.dropped()(the store's process-lifetime counter), but inside a batch it does count intoDrawBatchResult.dropped(), because the batch tallies every non-OK item whatever the reason.- See Also:
-
MAX_TEXT_LENGTH
public static final int MAX_TEXT_LENGTHLongest text atextcommand may carry, in UTF-16 code units — the producer converts the UTF-8 payload into a 128-unit wide buffer and fails the command rather than truncating when it will not fit. This counts JavaString.length(), not UTF-8 bytes, and the two differ for any non-ASCII text.- See Also:
-
MAX_BATCH_ITEMS
public static final int MAX_BATCH_ITEMSMost items onedebug_draw_set_batchaccepts. Over this is a hard error.- See Also:
-
MAX_COMMANDS
public static final int MAX_COMMANDSRetained commands per producer, across every connected client.- See Also:
-
MAX_TEXT_COMMANDS
public static final int MAX_TEXT_COMMANDSRetainedtextcommands, across every connected client.- See Also:
-
MAX_POLY_COMMANDS
public static final int MAX_POLY_COMMANDSRetainedpolycommands, across every connected client.- See Also:
-
MAX_DECIMALS
public static final int MAX_DECIMALSMost decimal places a fixed-point caption may be scaled by. The producer rejects more with"decimals" must be 0..9, and rejectsdecimalswith novalueat all.- See Also:
-
MIN_POLY_POINTS
public static final int MIN_POLY_POINTSFewest points a polyline may have.- See Also:
-
MAX_POLY_POINTS
public static final int MAX_POLY_POINTSMost points a polyline may have.- See Also:
-
MIN_THICKNESS
public static final int MIN_THICKNESSThinnest stroke.- See Also:
-
MAX_THICKNESS
public static final int MAX_THICKNESSThickest stroke.- See Also:
-
MIN_Z
public static final int MIN_ZLowest paint order. The producer storeszin anint16_tand refuses anything outside it withz must be -32768..32767.It did not always. Through phase 1 it was
static_cast<int16_t>(ClampToI32(p.z)), soz(100000)arrived as-31072and quietly painted behind everything instead of in front of it — nothing in the reply, nothing inDrawStats.dropped(), nothing inDraw.list()to show for it. The host check was written as the only thing standing between a caller and that silent reorder; the producer has since made it an explicit error, alongside the same treatment forcolor. So this now agrees with a producer-side refusal rather than substituting for a missing one, and what it buys is the failure arriving at the call site with a stack trace instead of after a round-trip. Same bound, same rejection, one tick earlier.- See Also:
-
MAX_Z
-
MIN_PLANE
public static final int MIN_PLANELowest plane a world highlight may name.- See Also:
-
MAX_PLANE
public static final int MAX_PLANEHighest plane a world highlight may name.Mirrors
overlay::kMaxPlane. A plane is accepted only in world space — on a screen command the producer refuses it withonly world space takes a planerather than ignoring it — and for anything but an entity it is honoured by refusal: seeDrawCommand.Tile.- See Also:
-
MAX_SCREEN_COORDINATE
public static final int MAX_SCREEN_COORDINATELargest absolute value a screen coordinate may take. Out of range is an error, not a clamp.This is also the bound a world command's projected coordinates must land inside, which the producer checks a tick later — so a world command can be accepted and still fail to draw, if what it projects to is off this scale. A point behind the camera projects to a saturated sentinel rather than being clamped, so you learn the point is not on screen instead of getting a line to nowhere.
- See Also:
-
MAX_WORLD_COORDINATE
public static final int MAX_WORLD_COORDINATELargest absolute value a world coordinate may take, in wire sub-tiles.Deliberately larger than
MAX_SCREEN_COORDINATE, because the two gate different quantities: this one bounds what a caller sends, while the screen bound applies to what those coordinates project to. Reusing one number for both would have refused legal world positions — anything past tile 4096 — for failing a limit that is about pixels.Where the number comes from, because it is not round. Every absolute world tile the producer publishes in its snapshot — NPC, player, location, ground item, projectile — is an
int16_t. So the widest tile magnitude any consumer can be holding is|Short.MIN_VALUE|= 32768, and atSUBTILE_SCALEsub-tiles per tile that is 2^23. A bound below this would refuse a coordinate the same producer published a tick earlier.The practical consequence: a tile taken from a snapshot can never exceed this, because the snapshot cannot express one that does. Underground content, which sits at
y + 6400, is nowhere near it.- See Also:
-
MAX_EXTENT
public static final int MAX_EXTENTLargest width or height a rect or ellipse may have.- See Also:
-
DEFAULT_TTL_MS
public static final long DEFAULT_TTL_MSThe TTL the producer applies when a command omitsttl_ms. This API never omits it —DrawStylealways puts a TTL on the wire so the lifetime a command actually got is visible inDraw.list()rather than being an invisible producer-side default.- See Also:
-
TTL_UNTIL_CLEARED
public static final long TTL_UNTIL_CLEAREDTTL meaning "until replaced, cleared, or my connection closes". It is not a way to draw something that outlives the script: ownership is connection-scoped and the producer drops everything a connection drew when its pipe closes.- See Also:
-
RESOLVED_COMPONENTS_PER_TICK
public static final int RESOLVED_COMPONENTS_PER_TICKComponent highlights the producer re-resolves per tick. This is the one cap that is not an error, because it is not reachable from a single call: past it the surplus resolves on a following tick and collection rotates, so nothing is starved permanently — but geometry beyond this many live highlights lags the game by a tick or more, andDrawStats.resolveOverflow()counts the ticks on which that happened.- See Also:
-
SUBTILE_SCALE
public static final int SUBTILE_SCALEFixed-point sub-tile divisions per tile, forDrawSpace.WORLDgeometry.- See Also:
-
MAX_WORLD_TILE
public static final int MAX_WORLD_TILELargest absolute value a tile coordinate or tile extent may take, for thehighlight_*calls that speak whole tiles rather than sub-tiles.Derived rather than written down, because it is
MAX_WORLD_COORDINATEexpressed in the other unit: the producer'sTileToWireis the single place the two meet, and it refuses a tile outside this before multiplying. A separate literal here could disagree with the bound it is supposed to be the same number as.The tile helpers speak TILES; raw
space: "world"primitives speak sub-tiles.draw.tile(key, 3200, 3200)sends3200, whiledraw.rect(...).world()at the same place sends3200 *SUBTILE_SCALE. That is the producer's split, not a host convention, and the handler is the one place they meet — so nothing downstream of it ever sees two units.- See Also:
-
DEFAULT_FOOTPRINT_TILES
public static final int DEFAULT_FOOTPRINT_TILESThe footprint a highlighted entity or tile gets when the caller names none, in tiles. The producer's own default forw/h.- See Also:
-