mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-05 23:13:46 +08:00
add dynamics correction messages
This commit is contained in:
parent
5bd7e05773
commit
13ad00029c
@ -139,6 +139,9 @@ void ClientSessionReplay::FetchMessages() {
|
|||||||
SessionStream out(nullptr, false);
|
SessionStream out(nullptr, false);
|
||||||
DumpFullState(&out);
|
DumpFullState(&out);
|
||||||
|
|
||||||
|
current_state_.correction_messages_.clear();
|
||||||
|
GetCorrectionMessages(false, ¤t_state_.correction_messages_);
|
||||||
|
|
||||||
fflush(file_);
|
fflush(file_);
|
||||||
current_state_.file_position_ = ftell(file_);
|
current_state_.file_position_ = ftell(file_);
|
||||||
current_state_.message_ = out.GetOutMessage();
|
current_state_.message_ = out.GetOutMessage();
|
||||||
@ -301,6 +304,9 @@ void ClientSessionReplay::RestoreFromCurrentState() {
|
|||||||
Reset(true);
|
Reset(true);
|
||||||
fseek(file_, current_state_.file_position_, SEEK_SET);
|
fseek(file_, current_state_.file_position_, SEEK_SET);
|
||||||
HandleSessionMessage(current_state_.message_);
|
HandleSessionMessage(current_state_.message_);
|
||||||
|
for (const auto& msg : current_state_.correction_messages_) {
|
||||||
|
HandleSessionMessage(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ballistica::scene_v1
|
} // namespace ballistica::scene_v1
|
||||||
|
|||||||
@ -35,6 +35,7 @@ class ClientSessionReplay : public ClientSession,
|
|||||||
struct IntermediateState {
|
struct IntermediateState {
|
||||||
// Message containing full scene state at the moment.
|
// Message containing full scene state at the moment.
|
||||||
std::vector<uint8_t> message_;
|
std::vector<uint8_t> message_;
|
||||||
|
std::vector<std::vector<uint8_t>> correction_messages_;
|
||||||
|
|
||||||
// A position in replay file where we should continue from.
|
// A position in replay file where we should continue from.
|
||||||
long file_position_;
|
long file_position_;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user