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>2009-11-12 20:53:35 +0000
committerStijn Buys <ingar@osirion.org>2009-11-12 20:53:35 +0000
commit5ddb64795cc959916eeedbec8dc3f65c06f49698 (patch)
treeee7231607b0bf49528570e5d3badcdedcb33f54e /src/core/netconnection.cc
parent3605a7bd8fffebfba38d31025b6f33cb82626a3b (diff)
initial commodities and entity inventory, bump network proto version to 18
Diffstat (limited to 'src/core/netconnection.cc')
-rw-r--r--src/core/netconnection.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/netconnection.cc b/src/core/netconnection.cc
index c37fe05..39a25a3 100644
--- a/src/core/netconnection.cc
+++ b/src/core/netconnection.cc
@@ -436,6 +436,8 @@ void NetConnection::send_info_request(Info *info)
* frame
* sup <id>
* pif <id>
+ * pid <id>
+ * inf <id>
* zone
*/
void NetConnection::parse_incoming_message(const std::string & message)
@@ -684,29 +686,27 @@ void NetConnection::parse_incoming_message(const std::string & message)
return;
}
}
+
} else if (command == "inf") {
// incoming info record
- std::string label;
- char c;
-
- while ((msgstream.get(c)) && (c != '"'));
- while ((msgstream.get(c)) && (c != '"'))
- label += c;
-
- if (label.size()) {
- Info *info = Info::find(label);
+ unsigned int id;
+ if (msgstream >> id) {
+
+ Info *info = Info::find(id);
if (!info) {
- info = new Info(label);
- Info::add(info);
+ info = new Info(id);
}
info->receive_server_update(msgstream);
info->clear_timestamp();
+
} else {
con_warn << "Received empty information record!" << std::endl;
}
+
} else if (command == "sup") {
+
if (connection_state == Connected) {
unsigned int id;
if (msgstream >> id) {