public void ServerSetFrequency(BaseEntity.RPCMessage msg)
    {
        if (msg.player == null || !msg.player.CanBuild())
        {
            return;
        }
        if (!this.playerUsable)
        {
            return;
        }
        if (UnityEngine.Time.time < this.nextChangeTime)
        {
            return;
        }
        this.nextChangeTime = UnityEngine.Time.time + 2f;
        int num = msg.read.Int32();

        if (RFManager.IsReserved(num))
        {
            RFManager.ReserveErrorPrint(msg.player);
            return;
        }
        RFManager.ChangeFrequency(this.frequency, num, this, false, this.IsPowered());
        this.frequency = num;
        this.MarkDirty();
        base.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
    }
Esempio n. 2
0
    public void ServerSetFrequency(BaseEntity.RPCMessage msg)
    {
        if (msg.player == null || !msg.player.CanBuild())
        {
            return;
        }
        if (base.GetOwnerPlayer() != msg.player)
        {
            return;
        }
        if (UnityEngine.Time.time < this.nextChangeTime)
        {
            return;
        }
        this.nextChangeTime = UnityEngine.Time.time + 2f;
        int num = msg.read.Int32();

        if (RFManager.IsReserved(num))
        {
            RFManager.ReserveErrorPrint(msg.player);
            return;
        }
        RFManager.ChangeFrequency(this.frequency, num, this, false, base.IsOn());
        this.frequency = num;
        base.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
        Item item = this.GetItem();

        if (item != null)
        {
            item.MarkDirty();
        }
    }
Esempio n. 3
0
    public void ServerSetFrequency(BaseEntity.RPCMessage msg)
    {
        if (Object.op_Equality((Object)msg.player, (Object)null) || !msg.player.CanBuild() || (double)Time.get_time() < (double)this.nextChangeTime)
        {
            return;
        }
        this.nextChangeTime = Time.get_time() + 2f;
        int newFrequency = msg.read.Int32();

        RFManager.ChangeFrequency(this.frequency, newFrequency, (IRFObject)this, true, true);
        this.frequency = newFrequency;
        this.SendNetworkUpdateImmediate(false);
    }
Esempio n. 4
0
    public void ServerSetFrequency(BaseEntity.RPCMessage msg)
    {
        if (Object.op_Equality((Object)msg.player, (Object)null) || !msg.player.CanBuild())
        {
            return;
        }
        int newFrequency = msg.read.Int32();

        RFManager.ChangeFrequency(this.frequency, newFrequency, (IRFObject)this, true, true);
        this.frequency = newFrequency;
        this.MarkDirty();
        this.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
    }
    public void ServerSetFrequency(BaseEntity.RPCMessage msg)
    {
        if (msg.player == null || !msg.player.CanBuild())
        {
            return;
        }
        int num = msg.read.Int32();

        RFManager.ChangeFrequency(this.frequency, num, this, true, true);
        this.frequency = num;
        this.MarkDirty();
        base.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
    }
    public void ServerSetFrequency(BaseEntity.RPCMessage msg)
    {
        if (msg.player == null || !msg.player.CanBuild())
        {
            return;
        }
        if (UnityEngine.Time.time < this.nextChangeTime)
        {
            return;
        }
        this.nextChangeTime = UnityEngine.Time.time + 2f;
        int num = msg.read.Int32();

        RFManager.ChangeFrequency(this.frequency, num, this, true, true);
        this.frequency = num;
        base.SendNetworkUpdateImmediate(false);
    }
Esempio n. 7
0
    public void ServerSetFrequency(BaseEntity.RPCMessage msg)
    {
        if (Object.op_Equality((Object)msg.player, (Object)null) || !msg.player.CanBuild() || (Object.op_Inequality((Object)this.GetOwnerPlayer(), (Object)msg.player) || (double)Time.get_time() < (double)this.nextChangeTime))
        {
            return;
        }
        this.nextChangeTime = Time.get_time() + 2f;
        int num = msg.read.Int32();

        if (RFManager.IsReserved(num))
        {
            RFManager.ReserveErrorPrint(msg.player);
        }
        else
        {
            RFManager.ChangeFrequency(this.frequency, num, (IRFObject)this, false, this.IsOn());
            this.frequency = num;
            this.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
            this.GetItem()?.MarkDirty();
        }
    }
Esempio n. 8
0
    public void ServerSetFrequency(RPCMessage msg)
    {
        if (msg.player == null || !msg.player.CanBuild() || GetOwnerPlayer() != msg.player || UnityEngine.Time.time < nextChangeTime)
        {
            return;
        }
        nextChangeTime = UnityEngine.Time.time + 2f;
        int num = msg.read.Int32();

        if (RFManager.IsReserved(num))
        {
            RFManager.ReserveErrorPrint(msg.player);
        }
        else
        {
            if (Interface.CallHook("OnRfFrequencyChange", this, num, msg.player) != null)
            {
                return;
            }
            RFManager.ChangeFrequency(frequency, num, this, false, IsOn());
            frequency = num;
            SendNetworkUpdate();
            Item item = GetItem();
            if (item != null)
            {
                if (item.instanceData == null)
                {
                    item.instanceData            = new ProtoBuf.Item.InstanceData();
                    item.instanceData.ShouldPool = false;
                }
                item.instanceData.dataInt = frequency;
                item.MarkDirty();
            }
            Interface.CallHook("OnRfFrequencyChanged", this, num, msg.player);
        }
    }
Esempio n. 9
0
 public void ChangeFrequency(int newFreq)
 {
     RFManager.ChangeFrequency(this.frequency, newFreq, (IRFObject)this, true, true);
     this.frequency = newFreq;
 }