Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-06 21:07:11 +0000
committerStijn Buys <ingar@osirion.org>2008-05-06 21:07:11 +0000
commit91d3a0352088611d3b78d3344b7a2bf2d4955a0a (patch)
tree74c0a6adf15ae15aa144f66f20272c1fd58a7db3 /src/core/netconnection.cc
parent8fefc1d995083f0d4a9873f216ccc6e15688d0a9 (diff)
client-side frame interpolation: frames and timers
Diffstat (limited to 'src/core/netconnection.cc')
-rw-r--r--src/core/netconnection.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/core/netconnection.cc b/src/core/netconnection.cc
index dda339c..55480d2 100644
--- a/src/core/netconnection.cc
+++ b/src/core/netconnection.cc
@@ -267,6 +267,7 @@ void NetConnection::transmit()
* msg public <name> <text>
* die
* ent
+ * frame
* sup
* pif
*/
@@ -305,6 +306,12 @@ void NetConnection::parse_incoming_message(const std::string & message)
} else if (command == "ping") {
+ } else if (command == "frame") {
+ float timestamp;
+ if (msgstream >> timestamp) {
+ game()->reset_clientstate(timestamp);
+ }
+
} else if (command == "die") {
unsigned int id;
if (msgstream >> id) {
@@ -339,14 +346,17 @@ void NetConnection::parse_incoming_message(const std::string & message)
}
}
} else if (command == "sup") {
- unsigned int id;
- if (msgstream >> id) {
- //con_debug << "Received update entity id " << id << std::endl;
- Entity *entity = Entity::find(id);
- if (!entity) {
- con_warn << "Update for unknown entity " << id << std::endl;
- } else
- entity->recieve_server_update(msgstream);
+ if (connection_state == Connected)
+ {
+ unsigned int id;
+ if (msgstream >> id) {
+ //con_debug << "Received update entity id " << id << std::endl;
+ Entity *entity = Entity::find(id);
+ if (!entity) {
+ con_warn << "Update for unknown entity " << id << std::endl;
+ } else
+ entity->recieve_server_update(msgstream);
+ }
}
} else if (command == "pif") {