|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
#include <history.h>
Public Member Functions | |
| void | Record (uint32_t id, std::chrono::nanoseconds time, Place place) |
| std::optional< Place > | At (uint32_t id, std::chrono::nanoseconds time) const |
| void | Leave (uint32_t id) |
| Forgets a player who's left. | |
Static Public Attributes | |
| static constexpr std::chrono::seconds | kKept {1} |
| A second: more than any blow goes back. | |
Where each player has been, a place a tick, for the last second, which a World keeps. A client draws everyone else a moment in the past, so a blow it aimed at a player can be checked against where that player was then, not where they are now.
| std::optional< Place > nanommo::History::At | ( | uint32_t | id, |
| std::chrono::nanoseconds | time ) const |
Where the player was at the time, between their places on either side of it. Before their oldest, it's that, and after their newest, that. Or nothing, for a player it has no places of.
Definition at line 20 of file history.cc.
| void nanommo::History::Leave | ( | uint32_t | id | ) |
Forgets a player who's left.
Definition at line 42 of file history.cc.
| void nanommo::History::Record | ( | uint32_t | id, |
| std::chrono::nanoseconds | time, | ||
| Place | place ) |
The player is at the place at the time, on the world's clock, which only goes on. Their places from more than kKept before it go.
Definition at line 12 of file history.cc.
|
staticconstexpr |