Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void LowLevelOwnershipReleased(string uniqueEntityID)
{
if (uniqueEntityID == clientIdentifier)
{
ServerOwnershipDestroyed();
OnServerOwnershipDestroyed();
}
}
private void LowLevelOwnershipTransfer(string uniqueEntityID, ushort NetIdNewOwner, bool isOwner)
Expand Down Expand Up @@ -276,7 +276,7 @@ public virtual void OnNetworkReady()
/// <summary>
/// back to no one owning it, (item no longer exists for example)
/// </summary>
public virtual void ServerOwnershipDestroyed()
public virtual void OnServerOwnershipDestroyed()
{

}
Expand Down
6 changes: 3 additions & 3 deletions Basis/Packages/com.basis.shim/Shims/BasisNetworkShim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -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)
{
Expand Down
33 changes: 27 additions & 6 deletions Basis/Packages/com.basis.shim/Shims/CilboxPropBasis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ public class CilboxPropBasis : Cilbox
{
static HashSet<String> whiteListType = new HashSet<String>(){
// 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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -80,21 +101,20 @@ 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<String> whiteListFields = new HashSet<String>(){
// Unity fields
"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<String> GetWhiteListTypes() { return whiteListType; }
Expand All @@ -121,6 +141,7 @@ override public bool CheckFieldAllowed( String sType, String sFieldName )
{ typeof(UnityEngine.MonoBehaviour), new HashSet<string>{ ".ctor" } },
{ typeof(UnityEngine.Events.UnityAction), new HashSet<string>{ ".ctor" } },
{ typeof(Basis.Scripts.BasisSdk.Interactions.BasisPickupInteractable), new HashSet<string> { } },
{ typeof(Basis.Scripts.BasisSdk.Interactions.BasisInteractableObject), new HashSet<string> { } },
{ typeof(Basis.Scripts.Device_Management.Devices.BasisInput), new HashSet<string> { } },
{ typeof(UnityEngine.GameObject), new HashSet<string>{ nameof(GameObject.SetActive), nameof(GameObject.GetComponents) } },
{ typeof(System.Type), new HashSet<string>() }, // nothing allowed
Expand Down
4 changes: 2 additions & 2 deletions Basis/Packages/com.basis.shim/Shims/CilboxSceneBasis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions Basis/Packages/com.cnlohr.cilbox/Cilbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2875,6 +2875,8 @@ public enum ImportFunctionID
OnTriggerExit,
OnEnable,
OnDisable,
OnCollisionEnter,
OnCollisionExit
}
}

4 changes: 3 additions & 1 deletion Basis/Packages/com.cnlohr.cilbox/CilboxProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }); }
}
}

Loading