Steamworks.NET
Steamworks.NET copied to clipboard
New callback dispatcher for .NET Standard 2.1
Breaking changes included
- Enabled unsafe code to use Pointers for heap Allocation Free
-
Changed event handler delegate's signature, use
ref T
instead ofT
to avoid copy the event param. - Throw
System.ArgumentException
instead ofSystem.Exception
when user passed an invalid handler while creatingCallresult<T>
andCallback<T>
Examples for new handler
// For Callresult<T>
void OnCallresult(ref TypeName param, bool iofail)
{
// do your operations
}
// For Callback<T>
void OnCallback(ref TypeName param)
{
// do your operations
}
I don't think we can do 1. as enabling unsafe on Unity is a pain. 2. & 3. seem good but we should probably wait until other breaking changes around here maybe: https://github.com/rlabrecque/Steamworks.NET/issues/389
I don't think we can do 1. as enabling unsafe on Unity is a pain. 2. & 3. seem good but we should probably wait until other breaking changes around here maybe: #389
I will add some #ifdef
later to enable these pointer tricks just on .NET Core platforms. And we can wait for #389 for enough time to evaluate how this breaking changes impacts.
The new dispatcher was moved to a new file now.