diff options
Diffstat (limited to 'src/core/netconnection.cc')
-rw-r--r-- | src/core/netconnection.cc | 26 |
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") { |