Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Enable QBI frequency #1231

Merged
merged 2 commits into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
### Added

- Added support for Unity build callbacks such as `IPostprocessBuildWithReport`. [#1228](https://github.com/spatialos/gdk-for-unity/pull/1228)
- During a build you can now access the `WorkerBuilder.CurrentContext` field which contains all SpatialOS related build information.
- During a build you can now access the `WorkerBuilder.CurrentContext` field which contains all SpatialOS related build information.
- Enabled support for QBI frequency in the QBI Helper Module. [#1231](https://github.com/spatialos/gdk-for-unity/pull/1231)
paulbalaji marked this conversation as resolved.
Show resolved Hide resolved
- Use the `WithMaxFrequencyHz` method when building an `InterestQuery` to define your query's frequency.

### Fixed

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
Expand Down Expand Up @@ -48,14 +49,18 @@ public static InterestQuery Query(Constraint constraint)
/// The maximum frequency (Hz) to return query results.
paulbalaji marked this conversation as resolved.
Show resolved Hide resolved
/// </param>
/// <remarks>
/// Although the `Frequency` of a ComponentInterest.Query can be set, the runtime will ignore this field
/// for now as the feature has not yet been rolled out. Until then, this method will remain private.
/// A frequency of 0 means there will be no rate limiting.
/// </remarks>
/// <returns>
/// An updated <see cref="InterestQuery"/> object.
/// </returns>
private InterestQuery WithMaxFrequencyHz(float frequencyHz)
public InterestQuery WithMaxFrequencyHz(float frequencyHz)
{
if (frequencyHz < 0)
{
throw new ArgumentOutOfRangeException(nameof(frequencyHz), frequencyHz, "The max frequency must be greater than or equal to zero.");
}

query.Frequency = frequencyHz;
return this;
}
Expand Down