public void SendChangeLightBlinkIntervalRequest(float blinkInterval) { var msg = new ChangeLightBlinkIntervalMsg(); msg.EntityId = m_light.EntityId; msg.BlinkIntervalSeconds = blinkInterval; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request); }
static void ChangeLightBlinkIntervalRequest(ref ChangeLightBlinkIntervalMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); if (entity is MyLightingBlock) { Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success); } }
static void ChangeLightBlinkIntervalSuccess(ref ChangeLightBlinkIntervalMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var light = entity as MyLightingBlock; if (light != null) { light.BlinkIntervalSeconds = msg.BlinkIntervalSeconds; } }