Commit graph

3 commits

Author SHA1 Message Date
Kamron Batman
c94084b48f fix(opl): cap per-property length + chunk OplTextBlock to avoid legacy 2D-client crash
The legacy 2D (EA) client copies each OPL property's argument into a fixed ~512-char
(1024-byte) buffer; a single property that exceeds it overruns the heap and crashes the
client. OplTextBlock previously emitted one entry regardless of length.

- ObjectPropertyList.MaxArgumentLength (504 chars, under the ~510 ceiling).
- ClampArgument backstop in both InternalAdd paths (span + interpolation): truncates an
  oversized argument and logs the offending entity/cliloc.
- AddChunked(ReadOnlySpan<char>): splits newline-joined text across multiple cycling
  passthrough properties, breaking only at '\n', so none exceeds the cap.
- OplTextBlock.Dispose emits via AddChunked; AddChunked added to IPropertyList.
2026-06-26 00:45:51 -07:00
Kamron Batman
42ae2a1146 refactor(opl): drop redundant Add(string) overload; OplTextBlock depends on IPropertyList
string converts implicitly to ReadOnlySpan<char>, so Add(ReadOnlySpan<char>) subsumes
Add(string); $"..." literals still bind to the interpolated-string-handler overload
(zero-alloc). OplTextBlock now holds an IPropertyList instead of the concrete
ObjectPropertyList.
2026-06-26 00:45:50 -07:00
Kamron Batman
374de148fd feat(opl): add OplTextBlock multi-line builder 2026-06-26 00:45:50 -07:00