public void SendChangeSensorPlaySoundRequest(bool PlaySound) { var msg = new ChangeMySensorPlaySoundMsg(); msg.EntityId = m_block.EntityId; msg.PlaySound = PlaySound; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request); }
static void ChangeSensorPlaySoundSuccess(ref ChangeMySensorPlaySoundMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var block = entity as MySensorBlock; if (block != null) { block.PlayProximitySound = msg.PlaySound; } }
static void ChangeSensorPlaySoundRequest(ref ChangeMySensorPlaySoundMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var block = entity as MySensorBlock; if (block != null) { block.PlayProximitySound = msg.PlaySound; Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId, MyTransportMessageEnum.Success); } }