-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better history API #359
Better history API #359
Conversation
78cc506
to
5084f1e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #359 +/- ##
==========================================
+ Coverage 89.93% 90.12% +0.19%
==========================================
Files 44 46 +2
Lines 2484 2563 +79
==========================================
+ Hits 2234 2310 +76
- Misses 250 253 +3 ☔ View full report in Codecov by Sentry. |
8799e20
to
941f97b
Compare
bc1b7b9
to
e5b3f71
Compare
Marking as ready for review. Most added lines are just tests. |
src/client/confirm_history.rs
Outdated
/// Triggered for an entity when it receives changes for a tick. | ||
/// | ||
/// See also [`ConfirmHistory`]. | ||
#[derive(Debug, Event, Clone, Copy)] | ||
pub struct HistoryConfirmed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename to EntityChanged
? The name HistoryConfirmed
is confusing to me since you haven't necessarily confirmed anything - there could be more mutation messages for this tick or previous ticks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about EntityReplicated
? 🤔 EntityChanged
sounds like something from Bevy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about MutateTickConfirmed
-> MutateTickReceived
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that
@@ -366,14 +370,15 @@ fn send_messages( | |||
trace!("no changes to send for {:?}", client.id()); | |||
} | |||
|
|||
if !mutate_message.is_empty() { | |||
if !mutate_message.is_empty() || track_mutate_messages { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you want to send empty messages? Just to confirm they are empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, necessary to differentiate between missed ticks and ticks without changes.
Implements the proposal from #338:
HistoryConfirmed
event forConfirmHistory
.ServerMutateTicks
resource that provides an API similar toHistoryConfirmed
, but for received mutate messages. To activate it, third-party crate needs to callTrackAppExt::track_mutate_messages
. I decided on an app extension method to avoid require user to set it in the plugin. And not via resource since it's something that should be configured before the app starts.MutateTickConfirmed
for the addedServerMutateTicks
.Requires #356, I will retarget to the master after the merge.