public void SendNewMaxNumberOfBlocks(int maxNumber) { var msg = new SetMaxNumberOfBlocksMsg(); msg.MaxNumber = maxNumber; msg.EntityId = m_projector.EntityId; Sync.Layer.SendMessageToAllAndSelf(ref msg); }
private static void OnSetMaxNumberOfBlocks(ref SetMaxNumberOfBlocksMsg msg, MyNetworkClient sender) { MyEntity projectorEntity; MyEntities.TryGetEntityById(msg.EntityId, out projectorEntity); var projector = projectorEntity as MyProjector; if (projector != null) { projector.OnSetMaxNumberOfBlocks(msg.MaxNumber); } }
private static void OnSetMaxNumberOfBlocks(ref SetMaxNumberOfBlocksMsg msg, MyNetworkClient sender) { MyEntity projectorEntity; MyEntities.TryGetEntityById(msg.EntityId, out projectorEntity); var projector = projectorEntity as MyProjector; if (projector != null) { projector.OnSetMaxNumberOfBlocks(msg.MaxNumber); if (Sync.IsServer) { Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId); } } }