[MaxLength]
class StageTime.SDK.MaxLengthAttribute
Sizes a SyncedAttribute field. Everything it reserves counts against the 96 synced words a script has, whether it is used or not.
On a string: the most UTF-8 bytes it holds, 1 to 380 (one byte per English letter, two for most accented letters, up to four for emoji). Uses 1 + bytes / 4 words. Without it a synced string holds 60 bytes (16 words). Longer text is cut.
On an array or a list: the most elements it holds. Its length can change from 0 up to that (items = new int[3];, list.Add(x)) and the length is synced too. Uses 1 word for the length plus MaxLength × element words. For strings, the second number is each string's byte limit ([Synced, MaxLength(8, 32)] string[] lines; 60 when left out).
Properties
Length
int Length
Bytes of a string, or elements of an array or list.
StringLength
int StringLength
Bytes of each string in a string array or list (0 = 60).
Methods
MaxLengthAttribute
MaxLengthAttribute(int length)
Bytes of a string, or elements of an array or list.
MaxLengthAttribute
MaxLengthAttribute(int length, int stringLength)
Elements of a string array or list, and the bytes of each string.