public void IsFullChange(bool isFull) { var msg = new IsFullMsg(); msg.EntityId = m_batteryBlock.EntityId; msg.isFull = isFull; Sync.Layer.SendMessageToServer(ref msg); }
static void IsFullChange(ref IsFullMsg msg, MyNetworkClient sender) { MyBatteryBlock batteryBlock; if (MyEntities.TryGetEntityById <MyBatteryBlock>(msg.EntityId, out batteryBlock)) { batteryBlock.m_isFull = msg.isFull; if (Sync.IsServer) { Sync.Layer.SendMessageToAll(ref msg); } } }
static void IsFullChange(ref IsFullMsg msg, MyNetworkClient sender) { MyBatteryBlock batteryBlock; if (MyEntities.TryGetEntityById<MyBatteryBlock>(msg.EntityId, out batteryBlock)) { batteryBlock.m_isFull = msg.isFull; if (Sync.IsServer) Sync.Layer.SendMessageToAll(ref msg); } }