v1.4 - Serialization Type Key Overrides & Several Fixes
General note about installing updates: it is recommended that you remove the current installed package first before updating to a newer one. Some files may have been deleted or moved, which may cause conflicts or compilation errors. The default location for this package in your Unity project is at Assets/Impossible Odds/Toolkit.
As this toolkit is now being battle tested in several projects, feedback and small bug reports start to trickle in. This release focuses on providing stability fixes and add some usability features for the serialization features and custom message behaviour.
Added
- All serialization frameworks can now define a serialization type key override through the
KeyOverride
property on the attribute. This allows to set or infer a type based on a different or already present value in the data. The XML serialization can also define whether the type information should be saved as a child element rather than an attribute using theSetAsElement
property on theXmlType
attribute. - JSON, HTTP body and Photon WebRPC serialization frameworks now also have support for (de)serializing structs.
- A
NullValueProcessor
class for dealing withnull
data during deserialization. This processor will assign a default or null when the value to deserialize is null. This processor is added to every pre-defined serialization definition in the toolkit. This also fixes issue #6.
Updated
- The
HttpMessageHandle
is updated to cope with the deprecated properties of theUnityWebRequest
class set in Unity 2020.2. This gets rid of the warning messages in newer versions of Unity. - The default nested message configurator classes in
HttpMessenger
andWebRpcMessenger
have most of their methods and fields defined as virtual and/or protected, allowing for simple override behaviour without a full custom implementation. - Loosened the type restriction for Type-defining attributes in several serialization frameworks. Instead of just instances of type
string
, instances ofobject
are now accepted. This allows for other kinds of values to serve as type identifiers, e.g. enums. - All pre-defined serialization processors now require the
targetType
parameter of theirDeserialize
method to be non-null. - The
InvokeResponseCallback
method in the Weblink utilities framework now takes an additional generic parameter to reliably retrieve the callback method. This also fixes issue #7.
Fixed
- The type verification check of a value against generic type arguments of a list or dictionary would fail for vaules that were not null. See issue #4.
- All registered targeted callback methods were called when a message completed instead of only the matching ones to the response. See issue #5.
- The
ExactMatchProcessor
would have an unhandled scenario where it would attempt to set the wrong kind of data during deserialization.
Removed
- The
InvokeIfNotNull
delegate extension function with dynamic set of parameters. This method was already marked as deprecated since version 1.2 of this toolkit.