class ArrayLengthLimiter (Niantic.ARDK.Utilities.BinarySerialization.Contexts.ArrayLengthLimiter)
Overview
Context class used by array serializers to limit the maximum amount of array items in a single serialization (even if from different arrays). This is used to avoid possible Denial of Service attacks where a Stream tells to allocate 2GB of memory or similar. The limit is int items, not actual bytes allocated. By default, the limit is 10 million items, which is around one 10mb for bytes, 40mb for ints. More…
class ArrayLengthLimiter: Niantic.ARDK.Utilities.BinarySerialization.ISerializationContext { public: // properties int AmountInUse; int Limit; // methods void ReserveOrThrow(int amount); };
Detailed Documentation
Context class used by array serializers to limit the maximum amount of array items in a single serialization (even if from different arrays). This is used to avoid possible Denial of Service attacks where a Stream tells to allocate 2GB of memory or similar. The limit is int items, not actual bytes allocated. By default, the limit is 10 million items, which is around one 10mb for bytes, 40mb for ints.
Properties
int AmountInUse
Gets the amount of array items already in use during the current (de)serialization process.
int Limit
Gets or sets the limit of array items that can be serialized or deserialized. This value is used before allocating memory during deserialization, as a way to avoid DoS attacks.
Methods
void ReserveOrThrow(int amount)
Reserves the given amount of “array items” or throw an InvalidOperationException if that