From 9376b35db201c5f3b07a7909cc9fea000fd6f544 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Fri, 5 Jun 2026 23:56:52 -0400 Subject: [PATCH] =?UTF-8?q?port(m1):=20wave=206c=20=E2=80=94=20Unity=20+?= =?UTF-8?q?=20Steam/FB/Adjust=20static-class=20shims=20(696->572)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Off-battle-path static surfaces (CS0103 cluster): - UnityStatics: Gizmos, Physics2D, Caching, GUIUtility, Cursor, ColorUtility, ScreenCapture, RenderSettings, JsonUtility, Social + CursorLockMode enum. - RaycastHit2D implicit-bool operator; ILocalUser in SocialPlatforms. - Steamworks: Callback.Create, AppId_t/CSteamID/HAuthTicket/SteamNetworkingIdentity, MicroTxn/GetAuthSessionTicket response structs, SteamAPI/User/Utils/Client statics. Removed empty dup GetAuthSessionTicketResponse_t from ThirdParty.cs. - Facebook.Unity: FB + ILoginResult + FacebookDelegate; com.adjust.sdk.Adjust; global TimeNativePlugin/Packsize native-plugin stubs. Co-Authored-By: Claude Opus 4.8 --- SVSim.BattleEngine/Shim/External/LooseEnds.cs | 67 +++++++++++++++++-- SVSim.BattleEngine/Shim/External/SdkStubs.cs | 13 +++- .../Shim/External/ThirdParty.cs | 6 -- .../Shim/UnityEngine/UnityShim.cs | 2 +- .../Shim/UnityEngine/UnityShim2.cs | 1 + .../Shim/UnityEngine/UnityStatics.cs | 48 +++++++++++++ 6 files changed, 123 insertions(+), 14 deletions(-) diff --git a/SVSim.BattleEngine/Shim/External/LooseEnds.cs b/SVSim.BattleEngine/Shim/External/LooseEnds.cs index 854f30c..c916c45 100644 --- a/SVSim.BattleEngine/Shim/External/LooseEnds.cs +++ b/SVSim.BattleEngine/Shim/External/LooseEnds.cs @@ -44,12 +44,52 @@ namespace MiniJSON namespace Steamworks { - // Steam callback wrapper (engine only references the type). - public sealed class Callback { } - // Microtransaction auth response struct (referenced as a callback type arg). - public struct MicroTxnAuthorizationResponse_t { } - // Steam warning-message hook delegate (referenced as a type only). + // Steam callback wrapper. Engine constructs via Callback.Create(handler). + public sealed class Callback + { + public delegate void DispatchDelegate(T param); + public static Callback Create(DispatchDelegate func) => new Callback(); + } + public enum EResult { k_EResultOK = 1 } + public struct AppId_t + { + public uint m_AppId; + public AppId_t(uint v) { m_AppId = v; } + public static explicit operator AppId_t(uint v) => new AppId_t(v); + public override string ToString() => m_AppId.ToString(); + } + public struct CSteamID { public ulong m_SteamID; } + public struct HAuthTicket { } + public struct SteamNetworkingIdentity { } + // Microtransaction auth response struct (callback payload). + public struct MicroTxnAuthorizationResponse_t + { + public AppId_t m_unAppID; + public ulong m_ulOrderID; + public byte m_bAuthorized; + } + public struct GetAuthSessionTicketResponse_t + { + public HAuthTicket m_hAuthTicket; + public EResult m_eResult; + } + // Steam warning-message hook delegate. public delegate void SteamAPIWarningMessageHook_t(int severity, System.Text.StringBuilder debugText); + + public static class SteamAPI + { + public static bool Init() => false; + public static bool RestartAppIfNecessary(AppId_t appId) => false; + public static void RunCallbacks() { } + public static void Shutdown() { } + } + public static class SteamUser + { + public static HAuthTicket GetAuthSessionTicket(byte[] pTicket, int cbMaxTicket, out uint pcbTicket, ref SteamNetworkingIdentity identity) { pcbTicket = 0; return default; } + public static CSteamID GetSteamID() => default; + } + public static class SteamUtils { public static AppId_t GetAppID() => default; } + public static class SteamClient { public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t hook) { } } } // AOT P/Invoke callback attribute (IL2CPP) + StandaloneFileBrowser anchor. @@ -64,7 +104,22 @@ namespace SFB { internal class _ShimAnchor { } } // ---- third-party SDK namespace anchors (referenced via `using`) ---- namespace Facebook { internal class _ShimAnchor { } } -namespace Facebook.Unity { internal class _ShimAnchor { } } +namespace Facebook.Unity +{ + public interface ILoginResult + { + string Error { get; } + bool Cancelled { get; } + string RawResult { get; } + } + public delegate void FacebookDelegate(T result); + public static class FB + { + public static bool IsLoggedIn => false; + public static void LogInWithReadPermissions(System.Collections.Generic.List permissions, FacebookDelegate callback) { } + public static void LogOut() { } + } +} namespace RedShellSDK { internal class _ShimAnchor { } } namespace ZXing { internal class _ShimAnchor { } } namespace ZXing.QrCode { internal class _ShimAnchor { } } diff --git a/SVSim.BattleEngine/Shim/External/SdkStubs.cs b/SVSim.BattleEngine/Shim/External/SdkStubs.cs index 717f9e8..2308042 100644 --- a/SVSim.BattleEngine/Shim/External/SdkStubs.cs +++ b/SVSim.BattleEngine/Shim/External/SdkStubs.cs @@ -79,6 +79,17 @@ namespace PlatformSupport.Collections.ObjectModel internal class _ShimAnchor { } } namespace Convention { internal class _ShimAnchor { } } -namespace com.adjust.sdk { internal class _ShimAnchor { } } +namespace com.adjust.sdk +{ + public static class Adjust + { + public static bool IsEditor() => true; + public static void addSessionCallbackParameter(string key, string value) { } + } +} namespace BestHTTP.Decompression { internal class _ShimAnchor { } } namespace BestHTTP.SocketIO.Transports { internal class _ShimAnchor { } } + +// Native plugins (no decomp source) referenced unqualified from global scope. +public static class TimeNativePlugin { public static float GetDeviceOperatingTime() => 0f; } +public static class Packsize { public static void Test() { } } diff --git a/SVSim.BattleEngine/Shim/External/ThirdParty.cs b/SVSim.BattleEngine/Shim/External/ThirdParty.cs index 57ca103..2ec1f4b 100644 --- a/SVSim.BattleEngine/Shim/External/ThirdParty.cs +++ b/SVSim.BattleEngine/Shim/External/ThirdParty.cs @@ -36,12 +36,6 @@ namespace UnityEngine.Networking // ---- CRI Atom/Mana audio+movie middleware: see External/CriShim.cs ---- -// ---- Steamworks.NET ---- -namespace Steamworks -{ - public struct GetAuthSessionTicketResponse_t { } -} - // ---- BestHTTP Socket.IO ---- namespace BestHTTP.SocketIO { diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs index 42764c6..5ff7fbd 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim.cs @@ -46,7 +46,7 @@ namespace UnityEngine public struct Plane { public Plane(Vector3 normal, Vector3 point) { } public bool Raycast(Ray r, out float enter) { enter = 0; return false; } } public struct Ray { public Ray(Vector3 origin, Vector3 dir) { this.origin = origin; this.direction = dir; } public Vector3 origin; public Vector3 direction; public Vector3 GetPoint(float d) => origin; } public struct RaycastHit { public Vector3 point; public Vector3 normal; public float distance; public Collider collider; public Transform transform; public GameObject gameObject; } - public struct RaycastHit2D { public Vector3 point; public Vector3 normal; public float distance; public Collider2D collider; public Transform transform; } + public struct RaycastHit2D { public Vector3 point; public Vector3 normal; public float distance; public Collider2D collider; public Transform transform; public static implicit operator bool(RaycastHit2D hit) => hit.collider != null; } public struct LayerMask { public int value; public static int NameToLayer(string n) => 0; public static implicit operator int(LayerMask m) => m.value; } // ---- core object model ---- diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim2.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim2.cs index 34578b6..90e1778 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityShim2.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityShim2.cs @@ -65,4 +65,5 @@ namespace UnityEngine.SocialPlatforms // Cute.IAchievementCallback; adding one here makes the unqualified name ambiguous. public interface IAchievement { } public interface IAchievementDescription { } + public interface ILocalUser { void Authenticate(System.Action callback); } } diff --git a/SVSim.BattleEngine/Shim/UnityEngine/UnityStatics.cs b/SVSim.BattleEngine/Shim/UnityEngine/UnityStatics.cs index 4bfef44..a2eb4db 100644 --- a/SVSim.BattleEngine/Shim/UnityEngine/UnityStatics.cs +++ b/SVSim.BattleEngine/Shim/UnityEngine/UnityStatics.cs @@ -6,6 +6,54 @@ using System; namespace UnityEngine { + public enum CursorLockMode { None, Locked, Confined } + + public static class Gizmos + { + public static Color color { get; set; } + public static void DrawLine(Vector3 from, Vector3 to) { } + } + public static class Physics2D + { + public static RaycastHit2D GetRayIntersection(Ray ray, float distance = Mathf.Infinity) => default; + public static RaycastHit2D GetRayIntersection(Ray ray, float distance, int layerMask) => default; + public static Collider2D OverlapPoint(Vector2 point, int layerMask) => null; + public static Collider2D[] OverlapPointAll(Vector2 point, int layerMask) => Array.Empty(); + } + public static class Caching + { + public static bool ready => true; + public static bool ClearCache() => true; + } + public static class GUIUtility { public static string systemCopyBuffer { get; set; } } + public static class Cursor + { + public static CursorLockMode lockState { get; set; } + public static bool visible { get; set; } + } + public static class ColorUtility + { + public static bool TryParseHtmlString(string htmlString, out Color color) { color = default; return false; } + } + public static class ScreenCapture { public static void CaptureScreenshot(string filename) { } } + public static class RenderSettings { public static bool fog { get; set; } } + public static class JsonUtility + { + public static T FromJson(string json) => default!; + public static object FromJson(string json, Type type) => null; + public static string ToJson(object obj) => ""; + public static string ToJson(object obj, bool prettyPrint) => ""; + public static void FromJsonOverwrite(string json, object objectToOverwrite) { } + } + public static class Social + { + public static UnityEngine.SocialPlatforms.ILocalUser localUser => null; + public static void ReportProgress(string achievementID, double progress, Action callback) { } + public static void LoadAchievements(Action callback) { } + public static void LoadAchievementDescriptions(Action callback) { } + public static void ShowAchievementsUI() { } + } + public static class PlayerPrefs { public static void DeleteAll() { }