![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
A guest's half of a NetSession: joining, predicting what it owns, being corrected, and drawing the rest late. More...
#include <net_client.h>
Public Member Functions | |
| void | open (const NetAddress &server) |
Start talking to server. Nothing is sent until the first tick has run. | |
| void | close () |
| Tell the server goodbye and forget everything this session held. | |
| bool | receive (Scene &scene, ResourceManager &resources) |
| Take what has arrived, one datagram at a time, then build what was spawned. | |
| void | send () |
| Send a Hello until welcomed, then the commands the server has not heard. | |
| bool | simulates (EntityId entity) const |
Whether this end decides entity: its own, or one it leases. | |
| void | lease (const std::vector< EntityId > &entities) |
| See NetSession::lease. | |
| void | ageLeases () |
| Count every lease down a tick, outside a replay, and hand back the lapsed. | |
| void | beginTick (const InputCommand &command) |
Keep command until the server says it ran it. | |
| void | endTick (const Scene &scene, uint32_t tick) |
Record where this end's own entity ended tick. | |
| void | endReplay (const Scene &scene) |
| Finish the replay and measure what the picture owes for it. | |
| void | applyDrawCorrection (Scene &scene, float deltaTime) |
| Work a little of every outstanding correction off, and apply the rest. | |
| void | removeDrawCorrection (Scene &scene) |
| Take back what applyDrawCorrection applied. | |
| void | forgetWorld () |
| Drop everything naming an entity; see NetSession::forgetWorld. | |
| bool | isPlaying () const |
| From the Welcome until the session ends. | |
A guest's half of a NetSession: joining, predicting what it owns, being corrected, and drawing the rest late.
Holds nothing outside a client's session; NetSession decides when it is asked.
| bool Vkm::Engine::NetClient::receive | ( | Scene & | scene, |
| ResourceManager & | resources ) |
Take what has arrived, one datagram at a time, then build what was spawned.
| scene | The world a Welcome or a snapshot is applied to. |
| resources | Builds the prefabs the server spawned. |