Beispiel #1
0
        public void SendChangeRadioAntennaRequest(float broadcastRadius, bool on)
        {
            var msg = new ChangeRadioAntennaMsg();

            msg.EntityId        = m_broadcaster.Parent.EntityId;
            msg.BroadcastRadius = broadcastRadius;
            msg.BroadcastOn     = on;

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
 static void ChangeRadioBroadcasterRequest(ref ChangeRadioAntennaMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     var broadcasterOwner = entity as IMyComponentOwner<MyDataBroadcaster>;
     if (broadcasterOwner != null)
     {
         Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success);
     }
 }
        public void SendChangeRadioAntennaRequest(float broadcastRadius, bool on)
        {
            var msg = new ChangeRadioAntennaMsg();

            msg.EntityId = m_broadcaster.Parent.EntityId;
            msg.BroadcastRadius = broadcastRadius;
            msg.BroadcastOn = on;

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
Beispiel #4
0
        static void ChangeRadioBroadcasterRequest(ref ChangeRadioAntennaMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            var broadcasterOwner = entity as IMyComponentOwner <MyDataBroadcaster>;

            if (broadcasterOwner != null)
            {
                Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success);
            }
        }
Beispiel #5
0
        static void ChangeRadioBroadcasterSuccess(ref ChangeRadioAntennaMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            MyDataBroadcaster broadcaster;

            if (entity.Components.TryGet <MyDataBroadcaster>(out broadcaster))
            {
                var radio = broadcaster as MyRadioBroadcaster;
                radio.BroadcastRadius  = msg.BroadcastRadius;
                radio.Enabled          = msg.BroadcastOn;
                radio.WantsToBeEnabled = msg.BroadcastOn;
            }
        }
Beispiel #6
0
        static void ChangeRadioBroadcasterSuccess(ref ChangeRadioAntennaMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            MyDataBroadcaster broadcaster;
            var broadcasterOwner = entity as IMyComponentOwner <MyDataBroadcaster>;

            if (broadcasterOwner != null)
            {
                broadcasterOwner.GetComponent(out broadcaster);
                (broadcaster as MyRadioBroadcaster).BroadcastRadius  = msg.BroadcastRadius;
                (broadcaster as MyRadioBroadcaster).Enabled          = msg.BroadcastOn;
                (broadcaster as MyRadioBroadcaster).WantsToBeEnabled = msg.BroadcastOn;
            }
        }
 static void ChangeRadioBroadcasterSuccess(ref ChangeRadioAntennaMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     MyDataBroadcaster broadcaster;
     var broadcasterOwner = entity as IMyComponentOwner<MyDataBroadcaster>;
     if (broadcasterOwner != null)
     {
         broadcasterOwner.GetComponent(out broadcaster);
         (broadcaster as MyRadioBroadcaster).BroadcastRadius = msg.BroadcastRadius;
         (broadcaster as MyRadioBroadcaster).Enabled = msg.BroadcastOn;
         (broadcaster as MyRadioBroadcaster).WantsToBeEnabled = msg.BroadcastOn;
     }
 }