Esempio n. 1
0
            public void SendProducerEnableChange(bool producerEnabled)
            {
                var msg = new ProducerEnabledMsg();

                msg.EntityId        = m_batteryBlock.EntityId;
                msg.ProducerEnabled = producerEnabled;

                Sync.Layer.SendMessageToServer(ref msg);
            }
Esempio n. 2
0
            static void OnProducerEnableChange(ref ProducerEnabledMsg msg, MyNetworkClient sender)
            {
                MyBatteryBlock batteryBlock;

                if (MyEntities.TryGetEntityById <MyBatteryBlock>(msg.EntityId, out batteryBlock))
                {
                    batteryBlock.ProducerEnabled = msg.ProducerEnabled;
                    if (Sync.IsServer)
                    {
                        Sync.Layer.SendMessageToAll(ref msg);
                    }
                }
            }
Esempio n. 3
0
            static void OnProducerEnableChange(ref ProducerEnabledMsg msg, MyNetworkClient sender)
            {
                MyBatteryBlock batteryBlock;

                if (MyEntities.TryGetEntityById <MyBatteryBlock>(msg.EntityId, out batteryBlock))
                {
                    batteryBlock.SourceComp.SetProductionEnabledByType(MyResourceDistributorComponent.ElectricityId, msg.ProducerEnabled);
                    if (Sync.IsServer)
                    {
                        Sync.Layer.SendMessageToAll(ref msg);
                    }
                }
            }
            public void SendProducerEnableChange(bool producerEnabled)
            {
                var msg = new ProducerEnabledMsg();
                msg.EntityId = m_batteryBlock.EntityId;
                msg.ProducerEnabled = producerEnabled;

                Sync.Layer.SendMessageToServer(ref msg);
            }
 static void OnProducerEnableChange(ref ProducerEnabledMsg msg, MyNetworkClient sender)
 {
     MyBatteryBlock batteryBlock;
     if (MyEntities.TryGetEntityById<MyBatteryBlock>(msg.EntityId, out batteryBlock))
     {
         batteryBlock.ProducerEnabled = msg.ProducerEnabled;
         if (Sync.IsServer)
             Sync.Layer.SendMessageToAll(ref msg);
     }
 }
Esempio n. 6
0
 static void OnProducerEnableChange(ref ProducerEnabledMsg msg, MyNetworkClient sender)
 {
     MyBatteryBlock batteryBlock;
     if (MyEntities.TryGetEntityById<MyBatteryBlock>(msg.EntityId, out batteryBlock))
     {
         batteryBlock.SourceComp.SetProductionEnabledByType(MyResourceDistributorComponent.ElectricityId, msg.ProducerEnabled);
         if (Sync.IsServer)
             Sync.Layer.SendMessageToAll(ref msg);
     }
 }