public void SendSensorIsActiveChangedRequest(bool IsActive) { var msg = new ChangeMySensorActivityMsg(); msg.EntityId = m_block.EntityId; msg.IsActive = IsActive; Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); }
static void ChangeSensorIsActiveSuccess(ref ChangeMySensorActivityMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var block = entity as MySensorBlock; if (block != null) { block.IsActive = msg.IsActive; } }
static void ChangeSensorIsActiveRequest(ref ChangeMySensorActivityMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var block = entity as MySensorBlock; if (block != null) { block.IsActive = msg.IsActive; Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId, MyTransportMessageEnum.Success); } }