Example #1
0
            public void CapacityChange(float capacity)
            {
                var msg = new CapacityMsg();

                msg.EntityId = m_batteryBlock.EntityId;
                msg.capacity = capacity;

                Sync.Layer.SendMessageToServer(ref msg);
            }
Example #2
0
            static void CapacityChange(ref CapacityMsg msg, MyNetworkClient sender)
            {
                MyBatteryBlock batteryBlock;

                if (MyEntities.TryGetEntityById <MyBatteryBlock>(msg.EntityId, out batteryBlock))
                {
                    batteryBlock.CurrentStoredPower = msg.capacity;
                    if (Sync.IsServer)
                    {
                        Sync.Layer.SendMessageToAll(ref msg);
                    }
                }
            }
            public void CapacityChange(float capacity)
            {
                var msg = new CapacityMsg();
                msg.EntityId = m_batteryBlock.EntityId;
                msg.capacity = capacity;

                Sync.Layer.SendMessageToServer(ref msg);
            }
 static void CapacityChange(ref CapacityMsg msg, MyNetworkClient sender)
 {
     MyBatteryBlock batteryBlock;
     if (MyEntities.TryGetEntityById<MyBatteryBlock>(msg.EntityId, out batteryBlock))
     {
         batteryBlock.CurrentStoredPower = msg.capacity;
         if (Sync.IsServer)
             Sync.Layer.SendMessageToAll(ref msg);
     }
 }