Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/netconnection.cc')
-rw-r--r--src/core/netconnection.cc25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/core/netconnection.cc b/src/core/netconnection.cc
index 1bda423..db8e3a2 100644
--- a/src/core/netconnection.cc
+++ b/src/core/netconnection.cc
@@ -394,6 +394,7 @@ void NetConnection::send_say(std::string const &text)
* frame
* sup
* pif
+ * zone
*/
void NetConnection::parse_incoming_message(const std::string & message)
{
@@ -453,9 +454,9 @@ void NetConnection::parse_incoming_message(const std::string & message)
//con_debug << "Received die entity id " << id << std::endl;
Entity *e = Entity::find(id);
if (localcontrol() == e)
- localplayer()->player_control = 0;
+ localplayer()->set_control(0);
if (e)
- Entity::remove(id);
+ Entity::erase(id);
}
} else if (command == "ent") {
@@ -481,9 +482,25 @@ void NetConnection::parse_incoming_message(const std::string & message)
break;
}
}
+ } else if (command.compare("zone") == 0) {
+ unsigned int id;
+ std::string label;
+ if (msgstream >> id) {
+ con_debug << "Received create zone " << id << std::endl;
+ Zone * zone = Zone::find(id);
+
+ // create the zone if necessary
+ if (!zone) {
+ zone = new Zone(msgstream);
+ Zone::add(zone, id);
+ } else {
+ zone->receive_server_update(msgstream);
+ }
+ }
+
} else if (command == "pif") {
//con_debug << "Received update player info" << std::endl;
- connection()->localplayer()->recieve_server_update(msgstream);
+ connection()->localplayer()->receive_server_update(msgstream);
} else if (command == "sup") {
if (connection_state == Connected)
@@ -497,7 +514,7 @@ void NetConnection::parse_incoming_message(const std::string & message)
con_warn << "Update for unknown entity " << id << std::endl;
} else {
// FIXME check of the received update matches the actual entity
- entity->recieve_server_update(msgstream);
+ entity->receive_server_update(msgstream);
}
}
}