port(m1): wave 7j — Material/Plane/Socket overloads + IDictionary extension (24->12)

- Material.SetVector(int nameID, Vector4); Plane(Vector3, float d) ctor; Socket.On
  (SocketIOEventTypes, callback) overload.
- Global GetValueOrDefault(this IDictionary<,>) extension — the BCL form only binds to
  IReadOnlyDictionary, so the IDictionary call mis-resolved to JsonDataExtension.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-06 01:00:12 -04:00
parent ad58994b8e
commit f63d1cc2e2
3 changed files with 13 additions and 1 deletions

View File

@@ -99,3 +99,13 @@ namespace BestHTTP.Decompression.Zlib
public static class TimeNativePlugin { public static float GetDeviceOperatingTime() => 0f; }
public static class Packsize { public static bool Test() => true; }
public static class DllCheck { public static bool Test() => true; }
// The BCL's CollectionExtensions.GetValueOrDefault only binds to IReadOnlyDictionary;
// copied code calls it on an IDictionary<,> static type (where the only by-name match is
// the copied JsonDataExtension.GetValueOrDefault(JsonData,...) — wrong receiver). Supply the
// IDictionary form globally so the call resolves.
public static class ShimDictionaryExtensions
{
public static TValue GetValueOrDefault<TKey, TValue>(this System.Collections.Generic.IDictionary<TKey, TValue> dict, TKey key, TValue defaultValue)
=> dict != null && dict.TryGetValue(key, out var v) ? v : defaultValue;
}