|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
#include <predicted_bag.h>
Public Member Functions | |
| PredictedBag (const ItemTable &items) | |
| protocol::Inventory | Shown (const protocol::Inventory &server, float seconds) |
| void | Act (const protocol::Inventory &server, const protocol::ItemAction &action) |
| What the player asked for, done to the bag shown, if the rules allow it. | |
| bool | ahead () const |
Static Public Attributes | |
| static constexpr float | kPatience = 1.0f |
| In seconds. | |
The bag a step ahead of the server: what the player just did with an item, done at once to a copy of the bag, by the rules the server keeps, so that an item lands the moment it's dropped, rather than a round trip later. Once the server's bag comes at a new revision, it's shown instead; if it doesn't come in time, as when the server refused, the copy goes, and the item's back where the server has it.
Definition at line 18 of file predicted_bag.h.
|
inlineexplicit |
Definition at line 23 of file predicted_bag.h.
| void nanommo::PredictedBag::Act | ( | const protocol::Inventory & | server, |
| const protocol::ItemAction & | action ) |
What the player asked for, done to the bag shown, if the rules allow it.
Definition at line 21 of file predicted_bag.cc.
|
inline |
Definition at line 33 of file predicted_bag.h.
| protocol::Inventory nanommo::PredictedBag::Shown | ( | const protocol::Inventory & | server, |
| float | seconds ) |
The bag to show, with the frame's seconds gone by: ours while we're ahead, or the server's.
Definition at line 8 of file predicted_bag.cc.
|
staticconstexpr |
In seconds.
Definition at line 21 of file predicted_bag.h.