Esempio n. 1
0
    private void RPC_KnockDoor(BaseEntity.RPCMessage rpc)
    {
        if (!rpc.player.CanInteract())
        {
            return;
        }
        if (!this.knockEffect.isValid)
        {
            return;
        }
        if (UnityEngine.Time.realtimeSinceStartup < this.nextKnockTime)
        {
            return;
        }
        this.nextKnockTime = UnityEngine.Time.realtimeSinceStartup + 0.5f;
        BaseEntity slot = base.GetSlot(BaseEntity.Slot.LowerCenterDecoration);

        if (slot != null)
        {
            DoorKnocker component = slot.GetComponent <DoorKnocker>();
            if (component)
            {
                component.Knock(rpc.player);
                return;
            }
        }
        Effect.server.Run(this.knockEffect.resourcePath, this, 0, Vector3.zero, Vector3.zero, null, false);
        Interface.CallHook("OnDoorKnocked", this, rpc.player);
    }
Esempio n. 2
0
    private void RPC_KnockDoor(BaseEntity.RPCMessage rpc)
    {
        if (!rpc.player.CanInteract() || !this.knockEffect.isValid || (double)Time.get_realtimeSinceStartup() < (double)this.nextKnockTime)
        {
            return;
        }
        this.nextKnockTime = Time.get_realtimeSinceStartup() + 0.5f;
        BaseEntity slot = this.GetSlot(BaseEntity.Slot.LowerCenterDecoration);

        if (Object.op_Inequality((Object)slot, (Object)null))
        {
            DoorKnocker component = (DoorKnocker)((Component)slot).GetComponent <DoorKnocker>();
            if (Object.op_Implicit((Object)component))
            {
                component.Knock(rpc.player);
                return;
            }
        }
        Effect.server.Run(this.knockEffect.resourcePath, (BaseEntity)this, 0U, Vector3.get_zero(), Vector3.get_zero(), (Connection)null, false);
        Interface.CallHook("OnDoorKnocked", (object)this, (object)rpc.player);
    }