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/netserver.cc')
-rw-r--r--src/core/netserver.cc53
1 files changed, 6 insertions, 47 deletions
diff --git a/src/core/netserver.cc b/src/core/netserver.cc
index 0e44189..c632284 100644
--- a/src/core/netserver.cc
+++ b/src/core/netserver.cc
@@ -730,54 +730,13 @@ void NetServer::parse_incoming_message(NetClient *client, const std::string & me
}
Info *info = 0;
- if (id == 0) {
- // the client is requesting an information record by type and label
- std::string typelabelstr;
- std::string infolabelstr;
- std::string n;
- char c;
-
- // read type label
- n.clear();
- while ((msgstream.get(c)) && (c != '"'));
- while ((msgstream.get(c)) && (c != '"'))
- n +=c;
- typelabelstr.assign(n);
- if (!typelabelstr.size()) {
- con_warn << "^B" << client->player()->name() << "^W invalid info request" << std::endl;
- return;
- }
-
- InfoType *infotype = InfoType::find(typelabelstr);
- if (!infotype)
- return;
-
- // read info label
- n.clear();
- while ((msgstream.get(c)) && (c != '"'));
- while ((msgstream.get(c)) && (c != '"'))
- n +=c;
- infolabelstr.assign(n);
- if (!infolabelstr.size()) {
- con_warn << "^B" << client->player()->name() << "^W invalid info request" << std::endl;
- return;
+ if (id) {
+ info = Info::find(id);
+ if (info) {
+ con_debug << "Sending info for " << info->id() << " " << info->type()->label() << ":" << info->label() << std::endl;
+ send_info_update(client, info);
+ client->transmit();
}
-
- //con_debug << "Received info request for " << infotype << ":" << infolabelstr << std::endl;
-
- info = Info::find(infotype, infolabelstr);
- } else {
- //con_debug << "Received info request for id " << id << std::endl;
-
- // the client is requesting an information record by id
- info = Info::find(id);
- }
-
- if (info) {
- //con_debug << "Sending info for " << info->id() << " " << info->type()->label() << ":" << info->label() << std::endl;
-
- send_info_update(client, info);
- client->transmit();
}
return;