diff --git a/Basis/Packages/com.basis.framework/Networking/BasisNetworkBehaviour/BasisNetworkBehaviour.cs b/Basis/Packages/com.basis.framework/Networking/BasisNetworkBehaviour/BasisNetworkBehaviour.cs index 8a1846560..57f05c2b4 100644 --- a/Basis/Packages/com.basis.framework/Networking/BasisNetworkBehaviour/BasisNetworkBehaviour.cs +++ b/Basis/Packages/com.basis.framework/Networking/BasisNetworkBehaviour/BasisNetworkBehaviour.cs @@ -118,7 +118,7 @@ private void LowLevelOwnershipReleased(string uniqueEntityID) { if (uniqueEntityID == clientIdentifier) { - ServerOwnershipDestroyed(); + OnServerOwnershipDestroyed(); } } private void LowLevelOwnershipTransfer(string uniqueEntityID, ushort NetIdNewOwner, bool isOwner) @@ -276,7 +276,7 @@ public virtual void OnNetworkReady() /// /// back to no one owning it, (item no longer exists for example) /// - public virtual void ServerOwnershipDestroyed() + public virtual void OnServerOwnershipDestroyed() { } diff --git a/Basis/Packages/com.basis.shim/Shims/BasisNetworkShim.cs b/Basis/Packages/com.basis.shim/Shims/BasisNetworkShim.cs index 2e3fb1657..dac428809 100644 --- a/Basis/Packages/com.basis.shim/Shims/BasisNetworkShim.cs +++ b/Basis/Packages/com.basis.shim/Shims/BasisNetworkShim.cs @@ -18,7 +18,7 @@ public class BasisNetworkShim : BasisNetworkBehaviour public NetworkReadyEvent NetworkReady { set; get; } public OwnershipTransferEvent OwnershipTransfer { set; get; } - public ServerOwnershipDestroyedEvent ServerOwnershipDestroyedE { set; get; } + public ServerOwnershipDestroyedEvent ServerOwnershipDestroyed { set; get; } public NetworkMessageEvent NetworkMessageReceived { set; get; } public PlayerLeftEvent PlayerLeft { set; get; } public PlayerJoinedEvent PlayerJoined { set; get; } @@ -27,9 +27,9 @@ public override void OnNetworkReady() { NetworkReady?.Invoke(); } - public override void ServerOwnershipDestroyed() + public override void OnServerOwnershipDestroyed() { - ServerOwnershipDestroyedE?.Invoke(); + ServerOwnershipDestroyed?.Invoke(); } public override void OnOwnershipTransfer(BasisNetworkPlayer NetNewOwner) { diff --git a/Basis/Packages/com.basis.shim/Shims/CilboxPropBasis.cs b/Basis/Packages/com.basis.shim/Shims/CilboxPropBasis.cs index 7a1f5aba5..07fd45788 100644 --- a/Basis/Packages/com.basis.shim/Shims/CilboxPropBasis.cs +++ b/Basis/Packages/com.basis.shim/Shims/CilboxPropBasis.cs @@ -14,6 +14,24 @@ public class CilboxPropBasis : Cilbox { static HashSet whiteListType = new HashSet(){ // Basis types + "Basis.Scripts.BasisSdk.Interactions.BasisPickUpUseMode", + "Basis.Scripts.Device_Management.Devices.BasisInput", // Restrictive, only used as a type. + "Basis.Scripts.BasisSdk.Interactions.BasisPickupInteractable", // Restrictive (See below), only access field. + "Basis.Scripts.BasisSdk.Interactions.BasisInteractableObject", // Restrictive (See below), only access field. + "Basis.BasisInteractableShim", + "Basis.BasisInteractableShim+ClickEvent", + "Basis.BasisNetworkBehaviour", + "Basis.BasisNetworkShim", + "Basis.BasisNetworkShim+NetworkMessageEvent", + "Basis.BasisNetworkShim+NetworkReadyEvent", + "Basis.BasisNetworkShim+OwnershipTransferEvent", + "Basis.BasisNetworkShim+PlayerJoinedEvent", + "Basis.BasisNetworkShim+PlayerLeftEvent", + "Basis.BasisNetworkShim+ServerOwnershipDestroyedEvent", + "Basis.Network.Core.DeliveryMethod", + "Basis.SafeUtil", + "Basis.Scripts.BasisSdk.Players.BasisLocalPlayer", + "Basis.Scripts.Networking.NetworkedAvatar.BasisNetworkPlayer", // Cilbox types "Cilbox.CilboxPublicUtils", @@ -53,6 +71,8 @@ public class CilboxPropBasis : Cilbox "UnityEngine.AudioSource", "UnityEngine.Color", "UnityEngine.Component", + "UnityEngine.Collider", + "UnityEngine.Collision", "UnityEngine.Debug", "UnityEngine.Events.UnityAction", "UnityEngine.Events.UnityEvent", @@ -70,6 +90,7 @@ public class CilboxPropBasis : Cilbox "UnityEngine.Texture2D", "UnityEngine.Time", "UnityEngine.Transform", + "UnityEngine.Quaternion", "UnityEngine.UI.Button", "UnityEngine.UI.Button+ButtonClickedEvent", "UnityEngine.UI.InputField", @@ -80,11 +101,6 @@ public class CilboxPropBasis : Cilbox "UnityEngine.UI.Text", "UnityEngine.Vector3", "UnityEngine.Vector4", - - "Basis.Scripts.BasisSdk.Interactions.BasisPickUpUseMode", - "Basis.Scripts.Device_Management.Devices.BasisInput", // Restrictive, only used as a type. - "Basis.Scripts.BasisSdk.Interactions.BasisPickupInteractable", // Restrictive (See below), only access field. - "Basis.Scripts.BasisSdk.Interactions.BasisInteractableObject", }; static HashSet whiteListFields = new HashSet(){ @@ -92,9 +108,13 @@ public class CilboxPropBasis : Cilbox "UnityEngine.Vector3.x", "UnityEngine.Vector3.y", "UnityEngine.Vector3.z", + + // Basis types "Basis.Scripts.BasisSdk.Interactions.BasisPickupInteractable.OnPickupUse", "Basis.Scripts.BasisSdk.Interactions.BasisInteractableObject.OnInteractStartEvent", - "Basis.Scripts.BasisSdk.Interactions.BasisInteractableObject.OnInteractEndEvent", + "Basis.Scripts.BasisSdk.Interactions.BasisInteractableObject.OnInteractEndEvent", + "Basis.BasisNetworkBehaviour.CurrentOwnerId", + "Basis.BasisNetworkBehaviour.IsOwnedLocallyOnServer", }; static public HashSet GetWhiteListTypes() { return whiteListType; } @@ -121,6 +141,7 @@ override public bool CheckFieldAllowed( String sType, String sFieldName ) { typeof(UnityEngine.MonoBehaviour), new HashSet{ ".ctor" } }, { typeof(UnityEngine.Events.UnityAction), new HashSet{ ".ctor" } }, { typeof(Basis.Scripts.BasisSdk.Interactions.BasisPickupInteractable), new HashSet { } }, + { typeof(Basis.Scripts.BasisSdk.Interactions.BasisInteractableObject), new HashSet { } }, { typeof(Basis.Scripts.Device_Management.Devices.BasisInput), new HashSet { } }, { typeof(UnityEngine.GameObject), new HashSet{ nameof(GameObject.SetActive), nameof(GameObject.GetComponents) } }, { typeof(System.Type), new HashSet() }, // nothing allowed diff --git a/Basis/Packages/com.basis.shim/Shims/CilboxSceneBasis.cs b/Basis/Packages/com.basis.shim/Shims/CilboxSceneBasis.cs index 3d8709ff6..3054e9cbb 100644 --- a/Basis/Packages/com.basis.shim/Shims/CilboxSceneBasis.cs +++ b/Basis/Packages/com.basis.shim/Shims/CilboxSceneBasis.cs @@ -26,12 +26,12 @@ public class CilboxSceneBasis : Cilbox "Basis.BasisNetworkShim+PlayerJoinedEvent", "Basis.BasisNetworkShim+PlayerLeftEvent", "Basis.BasisNetworkShim+ServerOwnershipDestroyedEvent", - "Basis.BasisUrl", - "Basis.IBasisImageDownload", "Basis.Network.Core.DeliveryMethod", "Basis.SafeUtil", "Basis.Scripts.BasisSdk.Players.BasisLocalPlayer", "Basis.Scripts.Networking.NetworkedAvatar.BasisNetworkPlayer", + "Basis.BasisUrl", + "Basis.IBasisImageDownload", "BasisNetworkCommon+EventTiming", "BasisSDKMirror", "BasisSDKMirror+MirrorClearFlags", diff --git a/Basis/Packages/com.cnlohr.cilbox/Cilbox.cs b/Basis/Packages/com.cnlohr.cilbox/Cilbox.cs index 16e221610..244454a30 100644 --- a/Basis/Packages/com.cnlohr.cilbox/Cilbox.cs +++ b/Basis/Packages/com.cnlohr.cilbox/Cilbox.cs @@ -2875,6 +2875,8 @@ public enum ImportFunctionID OnTriggerExit, OnEnable, OnDisable, + OnCollisionEnter, + OnCollisionExit } } diff --git a/Basis/Packages/com.cnlohr.cilbox/CilboxProxy.cs b/Basis/Packages/com.cnlohr.cilbox/CilboxProxy.cs index 95bd8d40a..5f356c133 100644 --- a/Basis/Packages/com.cnlohr.cilbox/CilboxProxy.cs +++ b/Basis/Packages/com.cnlohr.cilbox/CilboxProxy.cs @@ -477,7 +477,9 @@ void Start() { void Update() { if( proxyWasSetup ) box.InterpretIID( cls, this, ImportFunctionID.Update, null ); } void FixedUpdate() { if( proxyWasSetup ) box.InterpretIID( cls, this, ImportFunctionID.FixedUpdate, null ); } void OnTriggerEnter(Collider c) { if (proxyWasSetup) box.InterpretIID(cls, this, ImportFunctionID.OnTriggerEnter, new object[] { c }); } - void OnTriggerExit(Collider b) { if (proxyWasSetup) box.InterpretIID(cls, this, ImportFunctionID.OnTriggerExit, new object[] { b }); } + void OnTriggerExit(Collider c) { if (proxyWasSetup) box.InterpretIID(cls, this, ImportFunctionID.OnTriggerExit, new object[] { c }); } + void OnCollisionEnter(Collision c) { if (proxyWasSetup) box.InterpretIID(cls, this, ImportFunctionID.OnCollisionEnter, new object[] { c }); } + void OnCollisionExit(Collision c) { if (proxyWasSetup) box.InterpretIID(cls, this, ImportFunctionID.OnCollisionExit, new object[] { c }); } } }